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サーバーは、EPICS(実験物理学および産業用制御システム)のプロセス変数(PV)と連携するために設計されたPythonベースのサーバーです。PV値の取得、PV値の設定、PVに関する詳細情報の取得を行うためのツールセットを提供します。このサーバーはmcpフレームワークを使用して構築されており、stdio経由で通信するため、大規模な制御システムやワークフローへの統合に適しています。
  • このツールは、ハードウェアまたはソフトウェア パラメータの監視と制御に EPICS PV が使用される環境で特に役立ちます。

特徴

  • EPICS MCP サーバーは次のツールを提供します。
  1. get_pv_value
    • リポジトリ内の単一のファイルを作成または更新する
    • 入力:
      • pv_name (文字列): PV 変数の名前。
    • 戻り値: ステータス ( successまたはerror ) と取得された値またはエラー メッセージを含む JSON オブジェクト。
  2. PV値の設定
    • 指定された PV に新しい値を設定します。
    • 入力:
      • pv_name (文字列): PV 変数の名前。
      • pv_value (文字列): PV に設定する新しい値。
    • 戻り値: ステータス ( successまたはerror ) と確認メッセージまたはエラー メッセージを含む JSON オブジェクト。
  3. 取得PV情報
    • 指定された PV に関する詳細情報を取得します。
    • 入力:
      • pv_name (文字列): PV 変数の名前。
    • 戻り値: ステータス ( successまたはerror ) と PV に関する詳細情報またはエラー メッセージを含む JSON オブジェクト。

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

EPICS プロセス変数と対話する Python ベースのサーバー。ユーザーは、標準化されたインターフェースを通じて 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