Skip to main content
Glama

Hedera Testnet Mirror Node MCP Server

Official
by hedera-dev

Hedera 测试网镜像节点 MCP 服务器

此代码库包含一个模型上下文协议 (MCP) 服务器,用于与 Hedera 测试网镜像节点 API 交互。该服务器使用FastMCP构建,这是一个用于创建 MCP 服务器的 TypeScript 框架。它使用Zod模式进行输入验证。

特征

  • 端点集成:自动将以 OpenAPI 规范格式定义的 Hedera Mirror Node API 转换为与 MCP 兼容的工具。
  • 服务器发送事件 (SSE) 支持:客户端无法通过 SSE 传输连接到此 MCP 服务器。
  • 模式验证:确保请求参数符合使用 Zod 定义的模式。

先决条件

在运行服务器之前,请确保已安装以下内容:

  • Bun ,或者任何其他能够直接运行 Typescript 的环境。

安装

(1)克隆存储库

git clone https://github.com/hedera-dev/mirrornode-mcp-server

(2)导航到项目目录

cd mirrornode-mcp-server

(3)安装依赖项

npm install

用法

要启动 MCP 服务器:

bun mcpServer.ts

成功启动后,您应该看到:

MCP server started

该服务器将可通过配置的 SSE 端点访问。

http://localhost:3333/hedera-testnet-mirror-node-api/sse

项目结构

  • mcpServer.ts :初始化并启动 MCP 服务器的入口点。
  • openApiZod.ts :包含镜像节点 API 端点定义和使用zodios API 客户端(如使用zod模式定义增强的axios )。
    • 请注意,此文件是使用openapi-zod-client加上一些手动修改以编程方式生成的。

工作原理

(1)API客户端创建

使用createApiClient函数为 Hedera 测试网镜像节点创建一个 API 客户端。MCP 服务器充当此 HTTP API 客户端与其自身的 SSE 传输之间的代理。

(2)端点转换:

来自endpointDefinitions的每个端点定义都由convertZodiosToMcp函数处理,该函数:

  • 验证端点是否使用GET方法。
  • 将参数映射到 Zod 模式。
  • 定义一个执行函数,进行相应的API调用并返回结果。
  • 向 MCP 服务器注册该工具。

(3)服务器初始化:

MCP 服务器通过 SSE 传输启动。

依赖项

  • FastMCP :用于构建 MCP 服务器的框架。
  • Zod :TypeScript 优先的模式声明和验证库。
  • openapi-zod-client :从 OpenAPI 规范文件生成 Zodios 代码。

作者

布伦丹·格雷茨

执照

麻省理工学院

-
security - not tested
-
license - not tested
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

与 Hedera Testnet 镜像节点 API 交互的服务器,将其 OpenAPI 定义的端点转换为可通过服务器发送事件 (SSE) 访问的 MCP 兼容工具。

  1. 特征
    1. 先决条件
      1. 安装
        1. 用法
          1. 项目结构
            1. 工作原理
              1. 依赖项
                1. 作者
                  1. 执照

                    Related MCP Servers

                    • -
                      security
                      A
                      license
                      -
                      quality
                      This tool creates a Model Context Protocol (MCP) server that acts as a proxy for any API that has an OpenAPI v3.1 specification. This allows you to use Claude Desktop to easily interact with both local and remote server APIs.
                      Last updated -
                      176
                      641
                      JavaScript
                      MIT License
                      • Apple
                      • Linux
                    • A
                      security
                      A
                      license
                      A
                      quality
                      A TypeScript-based MCP server that enables testing of REST APIs through Cline. This tool allows you to test and interact with any REST API endpoints directly from your development environment.
                      Last updated -
                      1
                      10
                      23
                      JavaScript
                      MIT License
                      • Apple
                    • -
                      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
                      A
                      license
                      -
                      quality
                      An MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.
                      Last updated -
                      2
                      Python
                      MIT License

                    View all related MCP servers

                    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/hedera-dev/mirrornode-mcp-server'

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