Myth
Auto-generates MCP servers for Celo smart contracts, converting contract ABIs into AI-callable tools.
README
Myth
Myth auto-generates Model Context Protocol (MCP) servers for Celo smart contracts. Give it a verified contract address and it fetches the ABI from Blockscout, maps every function and event to an MCP tool, and launches a server your AI agent can call.
Built for Celo's agent-friendly properties: sub-cent gas, fast finality, and stablecoin gas payment via feeCurrency.
Open source under MIT. Contributions welcome — see CONTRIBUTING.md.
Architecture
[Contract Address] → [Blockscout ABI] → [ABI → Zod/JSON Schema] → [MCP Server]
↓
[EIP-1967 Proxy Resolver] → implementation ABI
| Step | Module | What it does |
|---|---|---|
| 1 | blockscout.ts |
GET ?module=contract&action=getabi&address={addr} |
| 2 | abi-to-zod.ts |
Maps Solidity types → Zod validators + JSON Schema |
| 3 | abi-events.ts |
Generates query event tools from ABI events |
| 4 | celo-tx.ts |
Attaches feeCurrency on write txs (pay gas in cUSD/USDT) |
| 5 | create-server.ts |
Wires tools into @modelcontextprotocol/sdk |
| 6 | registry.ts |
Multi-contract registry at ~/.myth/registry.json |
Install
# Global CLI
npm install -g @gideondern/myth-celo-mcp
# Or run without installing
npx -y --package @gideondern/myth-celo-mcp myth --help
npm: https://www.npmjs.com/package/@gideondern/myth-celo-mcp
Quick Start
# Infra workflow: add → list → serve
myth add -a 0x765DE816845861e75A25fCA122bb6898B8B1282a -n celo-mainnet --alias cusd
myth list
myth serve # serves registry (uses ~/.myth/cache for fast restarts)
# Single contract without registry
myth serve -a 0x765DE816845861e75A25fCA122bb6898B8B1282a -n celo-mainnet
# HTTP transport (for remote agents)
myth serve -a 0x765DE816845861e75A25fCA122bb6898B8B1282a -n celo-mainnet --http --port 3100
# Generate a standalone package with manifest + Cursor config
myth generate -a 0x765DE816845861e75A25fCA122bb6898B8B1282a -n celo-mainnet -o ./generated/cusd
Registry & ABI cache
Contracts live in ~/.myth/registry.json. ABIs are cached in ~/.myth/cache/<network>/ (24h TTL).
myth add -a 0x765DE816845861e75A25fCA122bb6898B8B1282a -n celo-mainnet --alias cusd
myth list
myth sync cusd --force # refresh ABI from Blockscout
myth remove cusd
myth serve # all registry contracts (cache-first)
myth serve --http # HTTP transport
Tools are prefixed by alias: cusd_balanceOf, cusd_event_Transfer, etc.
Cursor Integration
Add to ~/.cursor/mcp.json (already configured if you used the setup step):
{
"mcpServers": {
"myth-cusd": {
"command": "npx",
"args": [
"-y",
"--package",
"@gideondern/myth-celo-mcp",
"myth",
"serve",
"-a",
"0x765DE816845861e75A25fCA122bb6898B8B1282a",
"-n",
"celo-mainnet"
],
"env": {
"MYTH_FEE_CURRENCY": "cUSD"
}
}
}
}
Serve every contract in your registry (~/.myth/registry.json):
{
"mcpServers": {
"myth-registry": {
"command": "npx",
"args": ["-y", "--package", "@gideondern/myth-celo-mcp", "myth", "serve", "--registry"]
}
}
}
Reload Cursor MCP after saving. For write tools, add MYTH_PRIVATE_KEY to env.
Built-in Meta Tools
Every server includes:
| Tool | Description |
|---|---|
myth_contract_info |
Contract addresses, networks, tool counts |
myth_fee_currencies |
Available stablecoins per network for gas |
Networks
| Network | Blockscout API | Default RPC |
|---|---|---|
celo-mainnet |
https://celo.blockscout.com/api | https://forno.celo.org |
celo-sepolia |
https://celo-sepolia.blockscout.com/api | https://forno.celo-sepolia.celo-testnet.org |
Environment Variables
| Variable | Description |
|---|---|
MYTH_CONTRACT_ADDRESS |
Target contract |
MYTH_NETWORK |
celo-mainnet or celo-sepolia |
MYTH_RPC_URL |
Override RPC endpoint |
MYTH_PRIVATE_KEY |
Wallet for write transactions |
MYTH_FEE_CURRENCY |
Stablecoin for gas (cUSD, USDT, or 0x...) |
MYTH_REGISTRY_PATH |
Registry file (default: ~/.myth/registry.json) |
MYTH_BLOCKSCOUT_API_KEY |
Optional Blockscout PRO API key |
Programmatic API
import {
fetchContractAbi,
abiToMcpTools,
launchMythServer,
launchHttpServer,
addToRegistry,
} from "@gideondern/myth-celo-mcp";
await launchMythServer({
contractAddress: "0x765DE816845861e75A25fCA122bb6898B8B1282a",
network: "celo-mainnet",
feeCurrency: "cUSD",
});
await launchHttpServer({
config: { contractAddress: "0x...", network: "celo-mainnet" },
port: 3100,
});
Development
git clone https://github.com/gideondern/myth-celo-mcp.git
cd myth-celo-mcp
npm install
npm run build
node dist/cli.js add -a 0x765DE816845861e75A25fCA122bb6898B8B1282a -n celo-mainnet --alias cusd
node dist/cli.js serve
References
- celo-mcp — Official Celo MCP server (Python)
- evm-mcp-server — Dynamic EVM tool patterns
- Blockscout Contract API
License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。