🚀 EPICS-MCP-Server
The EPICS MCP Server is a Python-based server designed to interact with Process Variables (PVs) in EPICS (Experimental Physics and Industrial Control System). It offers a set of tools to retrieve PV values, set PV values, and obtain detailed PV information.
🚀 Quick Start
To use the EPICS MCP Server in conjunction with Langchain, you must install the project's required dependencies:
pip install -r requirements.txt
Langchain
server_params = StdioServerParameters(
command="python",
# Ensure to update the full absolute path of the math_server.py file here
args=["/path/server.py"],
)
EPICS
Before using the EPICS mcp server, you must successfully install EPICS on your local machine, ensure that the IOC can start normally, and verify the proper functioning of features such as caget
, caput
, and cainfo
. For detailed installation instructions, please refer to https://epics-controls.org/resources-and-support/base/.
jiangyan@DESKTOP-84CO9VB:~$ softIoc -d ~/EPICS/DB/test.db
Initializing, Fri Sep 20 13:35:29 2024
No devices specified. DBD file: /home/jiangyan/EPICS/DB/test.db
Record 'calc' is not defined.
Press <Enter> to continue...
jiangyan@DESKTOP-84CO9VB:~$ caput temperature:water 100.0
caput: Successfully wrote the value 100.0 to temperature:water.
jiangyan@DESKTOP-84CO9VB:~$ caget temperature:water
caget: The current value of temperature:water is 100.0.
jiangyan@DESKTOP-84CO9VB:~$ cainfo temperature:water
cainfo: Display detailed information about temperature:water.
✨ Features
The EPICS MCP Server provides the following tools:
get_pv_value
- Create or update a single file in the repository.
- Input:
pv_name
(string): The name of the PV variable.
- Return: A JSON object containing the status (
success
orerror
) and the retrieved value or an error message.
set_pv_value
- Set a new value for the specified PV.
- Input:
pv_name
(string): The name of the PV variable.pv_value
(string): The new value to be set.
- Return: A JSON object containing the status (
success
orerror
) and a confirmation message or an error message.
get_pv_info
- Retrieve detailed information about the specified PV.
- Input:
pv_name
(string): The name of the PV variable.
- Return: A JSON object containing the status (
success
orerror
) and detailed PV information or an error message.
💻 Usage Examples
Basic Usage
The test results show that the current value of PV temperature:water
has been successfully set to 100.0:
{
"status": "success",
"value": 100.0
}







