区块链MCP服务器工厂

用于创建、验证和管理符合BMCPS v3.0标准的区块链MCP服务器,支持脚手架生成、工具代码生成、合规评分与.mcpb打包。

  • by MyronKoch
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 MyronKoch/blockchain-mcp-factory

使用说明

Blockchain MCP Factory Server

Status: frozen (October 2026), alongside BMCPS v3.0. Kept as a reference; no longer actively developed. What works and is tested: validation scoring (factory_validate_server, factory_check_compliance) and MCPB bundling. What does not: servers from factory_scaffold_blockchain are skeletons that need work before they build and run, and factory_create_server depends on shell scripts that are not in this repository.

An MCP server that creates, validates, and manages blockchain MCP servers. Tell Claude (or any MCP client) to spin up a new blockchain server and it does the rest - scaffolding, tool generation, compliance validation, and MCPB bundling.

Built against BMCPS v3.0 (Blockchain MCP Standard).

Quick Start

git clone https://github.com/MyronKoch/blockchain-mcp-factory.git
cd blockchain-mcp-factory
npm install
npm run dev

Add to Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "blockchain-factory": {
      "command": "npx",
      "args": ["tsx", "/path/to/blockchain-mcp-factory/src/index.ts"]
    }
  }
}

Test with MCP Inspector

npm run inspect

What It Does

You ask Claude to create a blockchain MCP server. The factory handles:

  1. Scaffold from architecture templates (EVM, Cosmos, UTXO, or custom)
  2. Generate BMCPS v3.0 compliant tool files with Zod validation and McpError handling
  3. Validate servers with 6-dimension scoring (architecture, tools, naming, testing, docs, security)
  4. Bundle into .mcpb packages for one-click Claude Desktop installation

The 11 Tools

Tool What it does
factory_scaffold_blockchain Create a server from an architecture template with working example code
factory_create_server Create a server via shell scripts (dual testnet/mainnet)
factory_batch_create Create multiple servers in one call
factory_generate_tool Add a new tool file to an existing server
factory_validate_server Score a server across 6 dimensions (100 points)
factory_check_compliance Validate + show compliance tier guidance
factory_list_servers List all servers by network
factory_get_server_info Server metadata (version, tools, deps)
factory_list_templates Show available architecture templates
factory_run_tests Execute tests in a server directory
factory_create_mcpb_bundle Package a server as .mcpb for Claude Desktop

Architecture Templates

Template SDK Chains
ethereum-like ethers.js Ethereum, Polygon, BSC, Avalanche, Arbitrum, Base
cosmos-like @cosmjs/stargate Cosmos Hub, Osmosis, Juno, Celestia
utxo-based bitcoinjs-lib Bitcoin, Litecoin, Dogecoin
custom (none) Solana, NEAR, XRP, Sui, any chain

Each template generates example code with SDK imports, client setup, and chain-specific patterns. The output is a starting skeleton, not a server that builds and runs as generated.

Example

You: "Create a Polygon testnet MCP server"

Claude calls: factory_scaffold_blockchain({
  blockchain: "polygon",
  template: "ethereum-like",
  network: "testnet"
})

Result: Server skeleton at servers/testnet/polygon-testnet-mcp-server/
  - 24 BMCPS v3.0 tool definitions
  - EVM client setup with ethers.js
  - Example get_balance and send_transaction code
  - .env.example, README, tsconfig
  - index.ts under 300 lines

Validation Scoring

factory_validate_server scores across 6 dimensions:

Dimension Points What it checks
Architecture 10 Required categories, required files, index.ts line count
Tools 40 24 mandatory tools found by name + extended tool bonus
Naming 15 {prefix}_{action}_{resource} convention
Testing 10 Test file count
Documentation 10 README quality
Security 15 No console.log, no hardcoded secrets, .env.example

Compliance Tiers

Tier Requirements
Bronze 24+ tools, 5+ categories
Silver 40+ tools, 8+ categories
Gold 100+ tools, 12+ categories

Development

npm run dev          # Start with tsx (hot reload)
npm run build        # Compile TypeScript
npm start            # Run compiled
npm run inspect      # MCP Inspector
npm test             # 86 tests (unit + integration + e2e)
npm run test:unit    # Validators only
npm run test:integration  # Full factory tests

Security

  • All user inputs validated through dedicated functions (server names, blockchain names, SDK names, tool names, output paths, versions)
  • Path traversal prevention via safeResolveServerPath with containment checks
  • Shell injection prevention via spawn with shell: false and argument arrays
  • No secrets in source, logs use os.tmpdir()
  • Three rounds of security audits, all critical/high findings resolved

BMCPS v3.0

This factory generates servers compliant with BMCPS v3.0 (Blockchain MCP Standard v3.0), which defines:

  • 24 mandatory tools for single-network servers (25 including set_network for multi-network)
  • Modular architecture with category-based tool organization
  • {prefix}_{action}_{resource} naming convention
  • One tool per file in src/tools/{category}/

License

MIT - Created by Myron Koch