헤데라 테스트넷 미러노드 MCP 서버
이 저장소에는 Hedera Testnet Mirror Node API와 연동되는 모델 컨텍스트 프로토콜(MCP) 서버가 포함되어 있습니다. 이 서버는 MCP 서버 생성을 위한 TypeScript 프레임워크인 FastMCP를 사용하여 구축되었습니다. 입력 검증에는 Zod 스키마를 사용합니다.
특징
- 엔드포인트 통합 : OpenAPI 사양 형식으로 정의된 Hedera Mirror Node API를 MCP 호환 도구로 자동 변환합니다.
- 서버 전송 이벤트(SSE) 지원 : 클라이언트는 SSE 전송을 통해 이 MCP 서버에 연결할 수 없습니다.
- 스키마 검증 : Zod를 사용하여 요청 매개변수가 정의된 스키마를 준수하는지 확인합니다.
필수 조건
서버를 실행하기 전에 다음이 설치되어 있는지 확인하세요.
- Bun 또는 Typescript를 직접 실행할 수 있는 다른 환경.
설치
(1) 저장소 복제
지엑스피1
(2) 프로젝트 디렉토리로 이동합니다.
Copy
(3) 종속성 설치
Copy
용법
MCP 서버를 시작하려면:
Copy
성공적으로 시작하면 다음이 표시됩니다.
Copy
구성된 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 Servers
- -securityAlicense-qualityThis 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 -548514JavaScriptMIT License
- AsecurityAlicenseAqualityA 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 -11023JavaScriptMIT License
- -securityAlicense-qualityA Python-based MCP server that integrates OpenAPI-described REST APIs into MCP workflows, enabling dynamic exposure of API endpoints as MCP tools.Last updated -239PythonMIT License
- -securityAlicense-qualityAn MCP server that exposes HTTP methods defined in an OpenAPI specification as tools, enabling interaction with APIs via the Model Context Protocol.Last updated -2PythonMIT License