MCP Blockchain Server
MCP 블록체인 서버 및 DApp
AI 보조자가 블록체인 스마트 계약과 상호 작용할 수 있도록 하는 동시에 사용자가 개인 키와 거래 서명에 대한 완전한 통제력을 유지할 수 있는 안전한 시스템입니다.
개요
이 프로젝트는 AI-블록체인 통합의 핵심 과제를 해결합니다. 즉, AI 보조원이 블록체인 데이터를 읽고 거래를 준비하는 동시에 사용자가 거래 서명 및 개인 키에 대한 독점적 제어권을 유지할 수 있도록 하는 것입니다.
이 시스템은 다음으로 구성됩니다.
MCP 서버 : AI 어시스턴트가 사용할 수 있는 도구로 블록체인 작업을 노출하는 모델 컨텍스트 프로토콜 서버
웹 DApp : 지갑 연결 및 거래 서명을 위한 사용자 인터페이스를 제공하는 React 애플리케이션
데이터베이스 : 사용자, API 키, 거래 기록을 저장하기 위한 PostgreSQL 데이터베이스
캐싱 : 자주 액세스되는 데이터를 캐싱하기 위한 Redis
Related MCP server: ows-mcp-wallet
특징
MCP 서버 기능
블록체인 데이터 액세스 : 잔액, 계약 상태 및 기타 온체인 데이터 읽기
거래 준비 : 사용자 승인을 위한 서명되지 않은 거래 생성
다중 체인 지원 : Ethereum, Polygon 및 기타 EVM 호환 체인과 함께 작동합니다.
스마트 계약 상호 작용 : 지원되는 네트워크에서 검증된 스마트 계약에서 읽기
보안 우선 설계 : 개인 키는 사용자의 지갑을 떠나지 않습니다.
웹 DApp 기능
지갑 통합 : MetaMask 및 기타 Web3 지갑과 연결
거래 검토 : 서명하기 전에 거래 세부 정보를 검토하기 위한 명확한 UI
거래 서명 : 연결된 지갑으로 거래 서명
거래 추적 : 제출된 거래의 상태를 모니터링합니다.
모바일 호환성 : 반응형 디자인은 모든 기기에서 작동합니다.
보안 원칙
개인 키 격리 : 키는 사용자의 지갑을 떠나지 않습니다.
거래 확인 : 거래 세부 정보를 검토하기 위한 명확한 UI
API 인증 : 안전한 API 키 관리
속도 제한 : 남용 방지
입력 검증 : 모든 입력을 정리합니다.
감사 로깅 : 모든 작업 추적
HTTPS 전용 : 보안 통신
콘텐츠 보안 정책 : XSS 방지
거래 흐름
AI 어시스턴트가 MCP 서버를 통해 거래를 요청합니다.
MCP 서버는 UUID를 사용하여 서명되지 않은 트랜잭션을 준비합니다.
MCP 서버는 AI 어시스턴트에게 트랜잭션 URL을 반환합니다.
AI 어시스턴트가 사용자에게 URL을 제공합니다.
사용자가 브라우저에서 URL을 엽니다.
사용자가 지갑을 연결하고 거래 세부 정보를 검토합니다.
사용자는 지갑을 사용하여 거래를 승인하고 서명합니다.
웹 DApp이 서명된 거래를 블록체인에 제출합니다.
거래 상태가 업데이트되고 추적됩니다.
시작하기
필수 조건
Node.js(v18 이상)
npm 또는 yarn
포스트그레스큐엘
Redis(선택 사항, 캐싱용)
Infura API 키(블록체인 접근용)
Etherscan API 키(계약 ABI용)
설치
저장소를 복제합니다.
지엑스피1
종속성 설치:
npm install
# or
yarn install환경 변수 설정: 루트 디렉토리에
.env파일을 만듭니다(또는.env.example에서 복사).
cp .env.example .env
# Edit .env with your configurations데이터베이스 설정:
# For detailed instructions, see the Database Setup Guide
# docs/database-setup.md
# Create the PostgreSQL database
createdb mcp_blockchain
# Run database migrations
npm run db:migrate
# or
yarn db:migratePostgreSQL을 설치하고 구성하는 방법에 대한 자세한 지침은 데이터베이스 설치 가이드를 참조하세요.
서버를 시작합니다:
npm run dev
# or
yarn devDocker Compose 사용
Docker를 사용하여 빠르게 시작하려면 다음을 수행하세요.
# Create .env file with required environment variables
cp .env.example .env
# Edit .env with your configurations
# Start the services
docker-compose up -d이렇게 시작됩니다:
PostgreSQL 데이터베이스
Redis 캐시
MCP 서버
웹 디앱
개발
서버 구조
src/mcp: MCP 서버 구현src/services: 핵심 비즈니스 로직 서비스src/utils: 유틸리티 함수src/index.ts: 메인 진입점
웹 DApp 구조
web/src/components: React 컴포넌트web/src/hooks: 사용자 정의 React 후크web/src/services: API 서비스web/src/pages: 페이지 구성 요소
MCP 서버 사용
MCP 서버는 AI 어시스턴트가 사용할 수 있는 여러 도구를 제공합니다.
get-chains: 지원되는 블록체인 네트워크 목록을 가져옵니다.get-balance: 주소에 대한 계좌 잔액을 가져옵니다.read-contract: 스마트 계약에서 데이터를 읽습니다.prepare-transaction: 사용자 승인을 위해 서명되지 않은 거래를 준비합니다.get-transaction-status: 거래의 현재 상태를 가져옵니다.
도구 사용 예시
// Example of using the get-balance tool
const result = await callTool("get-balance", {
chainId: "1",
address: "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"
});문제 해결
종속성 문제가 발생하는 경우:
# MCP SDK issue - install directly from GitHub
npm uninstall @modelcontextprotocol/sdk
npm install modelcontextprotocol/typescript-sdk데이터베이스 연결 문제에 대해서는 데이터베이스 설정 가이드를 참조하세요.
특허
이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여되었습니다. 자세한 내용은 라이선스 파일을 참조하세요.
Available Tools
5 toolsget-balanceGet native balanceARead-only
Get an address's native-token balance (e.g. ETH) on a given chain.
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The wallet/contract address to check. | |
| chainId | Yes | Chain id, e.g. "1" for Ethereum or "11155111" for Sepolia. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already provide readOnlyHint=true and openWorldHint=true, so the agent knows it's a safe, read-only operation. The description clarifies the asset type (native token) but adds no further behavioral traits like error handling or rate limits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence containing all essential information with no redundant words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple balance query tool with readOnlyHint, the description is largely complete. However, it omits the return format (e.g., wei or decimal) and potential error conditions, which could be helpful given no output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema has 100% coverage with descriptions for both parameters (address, chainId). The description adds context about native tokens but no additional parameter-level details beyond what the schema provides, aligning with baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Get') and identifies the resource ('native-token balance') with an example ('ETH'). It clearly states the scope ('on a given chain'), differentiating it from sibling tools like 'get-chains' or 'get-transaction-status'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, contexts where it is appropriate, or when to avoid it, such as for token balances other than native.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-chainsList supported chainsARead-only
List the blockchain networks this server supports, with their chain ids and native currencies.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true (safe read) and openWorldHint=true (dynamic results). The description adds that it returns chain ids and native currencies, which is consistent and adds value. No further behavioral traits disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, front-loaded with the verb and resource, no extraneous words. Each word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given zero parameters, no output schema, and annotations covering safety and dynamism, the description is fully adequate for a simple listing tool. It specifies what is returned (chain ids and native currencies) without needing more.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist (schema coverage 100%), so the description's job of explaining the tool's action is fulfilled. The description adds meaning beyond the empty schema by detailing the output content.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists blockchain networks with chain ids and native currencies. The verb 'list' and resource 'supported chains' are specific and distinguish it from siblings like get-balance or prepare-transaction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit when-to-use or alternatives given, but the context implies it is for retrieving supported networks. Since siblings are functionally distinct, no exclusion guidance is needed, though mentioning its use as a prerequisite could improve clarity.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get-transaction-statusGet transaction statusARead-only
Check the current status of a prepared transaction by its id.
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The transaction id returned by prepare-transaction. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds 'current status', implying time-sensitivity, beyond the readOnlyHint and openWorldHint annotations. However, it does not disclose what the status entails, potential behaviors, or any side effects, leaving some ambiguity.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no wasted words. Every word serves a purpose, making it highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one parameter, no output schema, annotations present), the description is minimally adequate but lacks clarity on the return value or possible status types, which could improve completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with a clear parameter description. The tool description adds no additional meaning beyond what is already in the schema, so baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'check', the resource 'status of a prepared transaction', and the method 'by its id'. It distinguishes from siblings like get-balance and prepare-transaction by focusing on transaction status.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when you have a transaction id from prepare-transaction, but it does not explicitly state when to use or when not to use this tool, nor does it mention alternatives among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
prepare-transactionPrepare a transaction for signingA
Create an unsigned transaction and return a URL the user opens to review and sign it in their own wallet. Private keys never reach this server. Share the returned URL with the user.
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Recipient address. | |
| data | No | Calldata hex for contract interactions. Defaults to "0x". | |
| value | No | Amount of native token to send, e.g. "0.01". Defaults to "0". | |
| chainId | Yes | Chain id, e.g. "1". | |
| gasLimit | No | Optional gas limit (integer). The wallet estimates if omitted. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds value beyond annotations by disclosing that private keys never reach the server, a key security trait. With annotations already indicating openWorldHint=true, the description reinforces the user-involved workflow.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with zero waste. Purpose is front-loaded and essential information is efficiently conveyed.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema, but the description explains the return is a URL for the user to review and sign. This covers the essential output without needing further detail.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and parameter descriptions in the schema are clear. The description does not need to duplicate param details, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool creates an unsigned transaction and returns a URL for user signing. It distinguishes itself from sibling tools which are read-only or informational (get-balance, get-chains, etc.).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage when needing to prepare a transaction for signing, but does not explicitly state when not to use or provide alternatives. It gives practical instructions (share URL with user) but lacks exclusion criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read-contractRead a smart contractARead-only
Call a read-only (view/pure) contract method. Provide abi as human-readable signatures (e.g. ["function balanceOf(address) view returns (uint256)"]) for zero-config use, or set ETHERSCAN_API_KEY to auto-fetch verified ABIs.
| Name | Required | Description | Default |
|---|---|---|---|
| abi | No | Optional ABI: a signature string, array of signatures, or JSON ABI. | |
| args | No | Arguments for the method, in order. | |
| method | Yes | Method name to call, e.g. "balanceOf". | |
| address | Yes | Contract address. | |
| chainId | Yes | Chain id, e.g. "1". |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already provide readOnlyHint and openWorldHint. Description adds behavioral context: calls view/pure methods, details ABI handling (zero-config or auto-fetch). No contradictions. Adequate beyond annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences; first sentence states core purpose, second explains ABI configuration. No unnecessary words, front-loaded with key information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and generic nature of the tool, the description sufficiently covers how to invoke it. Mentions zero-config and Etherscan integration. Could optionally mention return format, but not critical.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline 3. Description adds specific meaning for the abi parameter (how to provide signatures or use Etherscan), going beyond the schema's generic 'Optional ABI' description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool calls read-only (view/pure) contract methods, with specific verb and resource ('call a... contract method'), and distinguishes from sibling tools like prepare-transaction by emphasizing read-only.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides clear context for when to use (calling read-only methods) and explains ABI provision options (human-readable signatures or Etherscan). Implicitly excludes state-changing methods, but no explicit when-not-to-use statement.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.4.0- First observed
get-balance - First observed
get-chains - First observed
get-transaction-status - First observed
prepare-transaction - First observed
read-contract
TDQS
Scored across 5 tools
Each tool targets a distinct blockchain operation: balance query, chain listing, transaction status, transaction preparation, and contract reading. No functional overlap.
All tool names follow a consistent verb_noun pattern with snake_case (e.g., get-balance, prepare-transaction). No mixing of styles.
With 5 tools, the server covers core blockchain interactions without being excessive or too sparse. Each tool serves a clear purpose.
The tool set covers essential operations: balance, chain info, contract reading, and transaction lifecycle. Missing features like event log retrieval or gas estimation, but for basic blockchain interactions it is largely complete.
Maintenance
Related MCP Connectors
Crypto wallet for AI agents: balances, payments, swaps and trading with owner controls.
Provide AI agents and automation tools with contextual access to blockchain data including balance…
Trusted execution infrastructure for AI agents. Proposal-only protocol with human consent.
Governed AI actions with signed, verifiable receipts: free keyless reads, human-approved writes.
Related MCP Servers
- AlicenseBqualityDmaintenanceTransforms AI assistants into autonomous crypto trading agents with real-time market analysis, portfolio management, and trade execution across 17+ blockchains.3229 npm54MIT
- AlicenseAqualityDmaintenanceEnables AI agents to check balances and send transactions across multiple blockchains with automatic spending limit protection and policy enforcement.3MIT
- FlicenseNot gradedqualityDmaintenanceEnable AI agents to manage Safe multisig wallets across multiple blockchains.-
- AlicenseBqualityCmaintenanceNon-custodial TEE key management and signing for AI agents, supporting multiple blockchains.12MIT