OpenRPC MCP Server

OpenRPC MCP Server

通过开放RPC提供JSON-RPC功能的模型上下文协议(MCP)服务器。

简介

OpenRPC MCP 服务器通过 OpenRPC 为 Model Context Protocol (MCP) 提供 JSON-RPC 功能。

OpenRPC示意图

安装与配置

安装依赖

npm install

配置 Claude Desktop

根据您的操作系统,编辑配置文件:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json

添加以下配置:

{
  "mcpServers": {
    "openrpc": {
      "command": "npx",
      "args": ["-y", "openrpc-mcp-server"]
    }
  }
}

使用方法

主要工具

  • rpc_call: 调用任意 JSON-RPC 方法

    • 指定服务器 URL、方法名称和参数
    • 返回 JSON 格式结果
  • rpc_discover: 发现可用的 JSON-RPC 方法

    • 使用 OpenRPC 的 rpc.discover 规范
    • 列出指定服务器上的所有方法

开发

构建服务器

npm run build

开发模式(自动重建)

npm run watch

调试

使用 MCP Inspector 进行调试:

npm run inspector

访问提供的 URL 以打开浏览器中的调试工具。