EPICS MCP Server

by Jacky1-Jiang
MIT License
2

Integrations

  • Enables integration with LangChain, allowing the EPICS MCP Server to be used as part of LangChain workflows for controlling and monitoring EPICS Process Variables.

  • Built as a Python-based server, allowing users to leverage Python's ecosystem for EPICS control system integration and automation.

EPICS-MCP服务器

概述

  • EPICS MCP 服务器是一款基于 Python 的服务器,旨在与 EPICS(实验物理和工业控制系统)过程变量 (PV) 交互。它提供了一组工具来检索 PV 值、设置 PV 值以及获取有关 PV 的详细信息。该服务器使用 mcp 框架构建,并通过 stdio 进行通信,因此非常适合集成到更大型的控制系统或工作流程中。
  • 该工具在使用 EPICS PV 监控和控制硬件或软件参数的环境中特别有用。

特征

  • EPICS MCP 服务器提供以下工具:
  1. 获取 pv_value
    • 在存储库中创建或更新单个文件
    • 输入:
      • pv_name (字符串):PV 变量的名称。
    • 返回:包含状态( successerror )和检索到的值或错误消息的 JSON 对象。
  2. 设置 pv_value
    • 为指定的 PV 设置新值。
    • 输入:
      • pv_name (字符串):PV 变量的名称。
      • pv_value (字符串):要为 PV 设置的新值。
    • 返回:包含状态( successerror )和确认消息或错误消息的 JSON 对象。
  3. 获取 pv_info
    • 获取有关指定 PV 的详细信息。
    • 输入:
      • pv_name (字符串):PV 变量的名称。
    • 返回:一个 JSON 对象,包含状态( successerror )以及有关 PV 或错误消息的详细信息。

与 Langchain 一起使用

  • 要将其与 Langchain 一起使用,您必须安装项目所需的依赖项。
pip install -r requirements.txt
  • 朗查因

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

  • 在使用 EPCIS mcp 服务器之前,您必须在本地计算机上成功安装 EPCIS,确保 IOC 能够正常启动,并验证cagetcaputcainfo等功能是否正常运行。详细安装说明请参阅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

测试结果

  • Mcp 客户端:
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 )
  • 结果:
================================ 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.
-
security - not tested
A
license - permissive license
-
quality - not tested

基于 Python 的服务器与 EPICS 过程变量交互,允许用户通过标准化界面检索 PV 值、设置 PV 值以及获取有关 PV 的详细信息。

  1. 概述
    1. 特征
      1. 与 Langchain 一起使用
        1. 朗查因
        2. 史诗
      2. 测试结果

        Related MCP Servers

        • -
          security
          A
          license
          -
          quality
          A Python-based MCP server that integrates OpenAPI-described REST APIs into MCP workflows, enabling dynamic exposure of API endpoints as MCP tools.
          Last updated -
          2
          39
          Python
          MIT License
          • Linux
          • Apple
        • -
          security
          F
          license
          -
          quality
          This is an MCP server that facilitates building tools for interacting with various APIs and workflows, supporting Python-based development with potential for customizable prompts and user configurations.
          Last updated -
          Python
        • -
          security
          A
          license
          -
          quality
          A Python server implementation that enables integration with the PeakMojo API, providing access to various resources like users, personas, scenarios, and tools for managing PeakMojo functionality.
          Last updated -
          Python
          MIT License
          • Linux
        • A
          security
          A
          license
          A
          quality
          A server that provides a persistent Python REPL environment through the MCP protocol, allowing execution of Python code, variable management, and package installation.
          Last updated -
          3
          3
          Python
          MIT License

        View all related MCP servers

        ID: p0tkd4xtmu