Skip to main content
Glama
hedera-dev

Hedera Testnet Mirror Node MCP Server

Official
by hedera-dev

헤데라 테스트넷 미러노드 MCP 서버

이 저장소에는 Hedera Testnet Mirror Node API와 연동되는 모델 컨텍스트 프로토콜(MCP) 서버가 포함되어 있습니다. 이 서버는 MCP 서버 생성을 위한 TypeScript 프레임워크인 FastMCP를 사용하여 구축되었습니다. 입력 검증에는 Zod 스키마를 사용합니다.

특징

  • 엔드포인트 통합 : OpenAPI 사양 형식으로 정의된 Hedera Mirror Node API를 MCP 호환 도구로 자동 변환합니다.

  • 서버 전송 이벤트(SSE) 지원 : 클라이언트는 SSE 전송을 통해 이 MCP 서버에 연결할 수 없습니다.

  • 스키마 검증 : Zod를 사용하여 요청 매개변수가 정의된 스키마를 준수하는지 확인합니다.

Related MCP server: MyPostmanServer

필수 조건

서버를 실행하기 전에 다음이 설치되어 있는지 확인하세요.

  • Bun 또는 Typescript를 직접 실행할 수 있는 다른 환경.

설치

(1) 저장소 복제

지엑스피1

(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 코드를 생성합니다.

작가

브렌던 그레츠

특허

MIT

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A server for Model Context Protocol (MCP) that uses Server-Sent Events (SSE) for streaming communication, enabling tools like the HackerNews API to be accessed through a secure HTTP+SSE transport.
    29
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A lightweight Node.js-based MCP server that exposes custom tools via HTTP and Server-Sent Events (SSE) for clients like Postman. It allows users to register tools with type-safe validation to establish bidirectional communication with MCP clients.
    1,439 npm
    1
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    A standalone MCP server that exposes API endpoints as tools for AI assistants by proxying requests to a target API defined in an OpenAPI specification. It supports various authentication methods and utilizes Server-Sent Events (SSE) to facilitate integration with clients like Claude and ChatGPT.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    MCP server that exposes Zulip REST API tools via SSE, enabling message retrieval, stream/topic listing, draft management, and notifications.
    -