Skip to main content
Glama
eunsang284

EPICS MCP Server

by eunsang284

EPICS-MCP-Server

Overview

  • The EPICS MCP Server is a Python-based server designed to interact with EPICS (Experimental Physics and Industrial Control System) process variables (PVs). It provides a set of tools to retrieve PV values, set PV values, and fetch detailed information about PVs. The server is built using the mcp framework and communicates over stdio, making it suitable for integration into larger control systems or workflows.

  • This tool is particularly useful in environments where EPICS PVs are used for monitoring and controlling hardware or software parameters.

Features

  • The EPICS MCP Server provides the following tools:

  1. get_pv_value

    • Create or update a single file in a repository

    • Inputs:

      • pv_name (string): The name of the PV variable.

    • Returns: A JSON object containing the status (success or error) and the retrieved value or an error message.

  2. set_pv_value

    • Set a new value for a specified PV.

    • Inputs:

      • pv_name (string): The name of the PV variable.

      • pv_value (string): The new value to be set for the PV.

    • Returns: A JSON object containing the status (success or error) and a confirmation message or an error message.

  3. get_pv_info

    • Fetches detailed information about a specified PV.

    • Inputs:

      • pv_name (string): The name of the PV variable.

    • Returns: A JSON object containing the status (success or error) and the detailed information about the PV or an error message.

Usage with Langchain

  • To use this with Langchain, you must install the dependencies required for the project.

pip install -r requirements.txt
  • Langchain

server_params = StdioServerParameters(
    command="python",
    # Make sure to update to the full absolute path to your math_server.py file
    args=["/path/server.py"],
)
  • EPICS

  • Before using the EPCIS mcp server, you must successfully install EPCIS on your local machine, ensure that IOC can start normally, and verify that functions such as caget, caput, and cainfo are working properly. For detailed installation instructions, please refer to https://epics-controls.org/resources-and-support/base/.

jiangyan@DESKTOP-84CO9VB:~$ softIoc -d ~/EPICS/DB/test.db
Starting iocInit
############################################################################
## EPICS R7.0.8
## Rev. 2025-02-13T14:29+0800
## Rev. Date build date/time:
############################################################################
iocRun: All initialization complete
epics>
jiangyan@DESKTOP-84CO9VB:~$ caget temperature:water
temperature:water              88
jiangyan@DESKTOP-84CO9VB:~$ caput temperature:water 100
Old : temperature:water              88
New : temperature:water              100
jiangyan@DESKTOP-84CO9VB:~$ cainfo temperature:water
temperature:water
    State:            connected
    Host:             127.0.0.1:5056
    Access:           read, write
    Native data type: DBF_DOUBLE
    Request type:     DBR_DOUBLE
    Element count:    1

Test Result

  • Mcp client:

async def run():
    async with stdio_client(server_params) as (read, write):
        async with ClientSession(read, write) as session:
            # Initialize the connection
            await session.initialize()

            # Get tools
            tools = await load_mcp_tools(session)

            # Create and run the agent
            agent = create_react_agent(model, tools)
            agent_response = await agent.ainvoke({"messages": "To query the value of a PV (Process Variable) named temperature:water"})
            return agent_response
)
  • Result:

================================ Human Message =================================

To query the value of a PV (Process Variable) named temperature:water
================================== Ai Message ==================================
Tool Calls:
 get_pv_value (call_vvbXwi51CyYUxEM0hcyvCFCY)
Call ID: call_vvbXwi51CyYUxEM0hcyvCFCY
 Args:
   pv_name: temperature:water
================================= Tool Message =================================
Name: get_pv_value

{
 "status": "success",
 "value": 88.0
}
================================== Ai Message ==================================

The current value of the PV named `temperature:water` is 88.0.
A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    A Python-based server that interacts with EPICS process variables, allowing users to retrieve PV values, set PV values, and fetch detailed information about PVs through a standardized interface.
    Last updated
    4
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    Enables AI assistants to interact with SIEMENS PLC S7-1500/1200 controllers through their JSON-RPC API, supporting authentication, tag browsing, variable read/write operations, alarm management, and diagnostic buffer access.
    Last updated
    10
  • A
    license
    -
    quality
    D
    maintenance
    Enables AI assistants to interact with B\&R Automation Studio projects by building code, running ARsim simulators, and reading or writing OPC UA variables. It facilitates industrial automation development and real-time variable integration through natural language commands.
    Last updated
    12
    MIT
  • A
    license
    -
    quality
    C
    maintenance
    Provides AI assistants with natural language access to IMAS data structures and enables remote facility exploration through SSH.
    Last updated
    8
    Creative Commons Attribution No Derivatives 4.0 International

View all related MCP servers

Related MCP Connectors

  • Provide real-time data querying and visualization by integrating Tako with your agents. Generate o…

  • Manage SRG+ hubs, channels, content, assets, users, and workspaces from any MCP-aware AI agent.

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/eunsang284/EPICS-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server