{
  "markdown": "# @telegraph/mcp-server\n\nMCP server exposing [Telegraph Protocol](https://github.com/telegraphprotocol/Telegraph) AI inference APIs as tools with automatic x402 micropayments.\n\nConnects any MCP-compatible agent (Claude Desktop, Cursor, ElizaOS, LangChain, OpenClaw, Goose, etc.) to Telegraph's network of AI miners — weather forecasting, deepfake detection, LLM inference, AI-text detection, signal monitoring — with zero crypto code in the agent. The MCP server handles private key custody, payment signing, and transaction settlement internally.\n\n> Miners can be Bittensor subnets, hosted models, or any private API integrated via YAML. Some tool and field names still say `subnet` for legacy reasons — read it as \"miner\".\n\n## Documentation\n\n| Document | Description |\n|---|---|\n| [Architecture](docs/architecture.md) | MCP protocol, tool categories, x402 auto-payment, client integrations |\n| [Troubleshooting](docs/troubleshooting.md) | Common issues and solutions |\n\n## Quick Start\n\n### Option A — npx (no clone, recommended once published)\n\n```bash\nTELEGRAPH_NODE_URL=http://13.237.89.59:7044 \\\nTELEGRAPH_ENGINE_URL=http://13.237.89.59:8080 \\\nTELEGRAPH_DAEMON_URL=http://13.237.89.59:8081 \\\nTELEGRAPH_EVM_PRIVATE_KEY=0xyour_key_here \\\nnpx -y telegraph-protocol-mcp\n```\n\n### Option B — from source\n\n```bash\n# 1. Clone and enter\ngit clone https://github.com/telegraphprotocol/telegraph-mcp\ncd telegraph-mcp\n\n# 2. Copy and edit .env\ncp .env.example .env\n# Edit: set TELEGRAPH_EVM_PRIVATE_KEY=0xyour_key_here\n\n# 3. Install and build\nnpm install && npm run build\n\n# 4. Run\nnpm start\n```\n\n> Published to npm as [`telegraph-protocol-mcp`](https://www.npmjs.com/package/telegraph-protocol-mcp) and listed on the [MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.telegraphprotocol/telegraph`. Maintainers: see [PUBLISHING.md](./PUBLISHING.md).\n\n## Architecture\n\n```\nAgent (Claude / Cursor / Eliza / etc.)\n       │\n       │ MCP protocol (JSON-RPC over stdio)\n       │\n┌──────▼─────────────────────────────────────────┐\n│  Telegraph MCP Server (runs locally)            │\n│                                                 │\n│  ┌─────────┐  ┌──────────┐  ┌───────────────┐  │\n│  │ Node    │  │ Engine   │  │ Daemon        │  │\n│  │ :7044   │  │ :8080    │  │ :8081         │  │\n│  ├─────────┤  ├──────────┤  ├───────────────┤  │\n│  │ Status  │  │ Subnets  │  │ Health        │  │\n│  │ Health  │  │ Ask      │  │ Categories    │  │\n│  │ Subnets │  │ Direct   │  │ Questions     │  │\n│  │ Dynamic │  │          │  │               │  │\n│  └─────────┘  └──────────┘  └───────────────┘  │\n│                                                 │\n│  X402 payment handled transparently:            │\n│    request → 402 → sign EIP-3009 → retry        │\n└─────────────────────────────────────────────────┘\n```\n\n## Configuration\n\nAll via environment variables (`.env` file or inline):\n\n| Variable | Required | Default | Description |\n|----------|----------|---------|-------------|\n| `TELEGRAPH_NODE_URL` | Yes | `http://localhost:7044` | Telegraph node URL |\n| `TELEGRAPH_ENGINE_URL` | Yes | `http://localhost:8080` | Engine server URL |\n| `TELEGRAPH_DAEMON_URL` | Yes | `http://localhost:8081` | Daemon API URL |\n| `TELEGRAPH_EVM_PRIVATE_KEY` | Yes* | — | EVM private key (`0x`-prefixed hex) |\n| `TELEGRAPH_SOLANA_PRIVATE_KEY` | No* | — | Solana private key (base58) |\n| `EVM_NETWORK` | No | `eip155:*` | EVM CAIP-2 network |\n| `SVM_NETWORK` | No | `solana:*` | Solana CAIP-2 network |\n| `REFRESH_INTERVAL_MS` | No | `300000` | Miner-tool refresh interval (ms). 0 to disable. |\n\n*At least one private key required.\n\n## Available Tools\n\n### Node Tools (no payment)\n| Tool | Description |\n|------|-------------|\n| `tg_node_status` | Node status, public key, chain info |\n| `tg_node_subnets_health` | Miner integration health check |\n| `tg_node_list_subnets` | Full miner catalog with metadata, schemas, endpoints |\n\n### Engine Tools\n| Tool | Payment | Description |\n|------|---------|-------------|\n| `tg_engine_list_subnets` | Free | List the miners the Engine can route to |\n| `tg_engine_ask` | x402 | Auto-routed inference (LLM picks the best miner for your query) |\n| `tg_engine_ask_subnet` | x402 | Direct inference through a specific miner by ID |\n\n### Daemon Tools (no payment)\n| Tool | Description |\n|------|-------------|\n| `tg_daemon_health` | Daemon health check |\n| `tg_daemon_categories` | Signal categories (POLITICS, ECONOMICS, TECHNOLOGY, CLIMATE, HEALTH, CRYPTO, SPORTS, …) |\n| `tg_daemon_questions` | Query collected signals with filters (category, source, time, interest) |\n\n### Dynamic Miner Tools (auto-discovered, x402 payment)\nTools for each miner endpoint are auto-generated from the Telegraph node's live integration registry. The live set changes on-chain, so treat this as a snapshot, not the source of truth (call `tg_node_list_subnets` for the current catalog):\n\n| Miner | Tools |\n|--------|-------|\n| **Zeus (18)** — Weather | `tg_zeus_predict` |\n| **ItsAI (32)** — AI text detection | `tg_itsai_text_detector_detect` |\n| **Sapling (33)** — AI content detection | `tg_sapling_ai_detector_detect` |\n| **BitMind (34)** — Deepfake | `tg_bitmind_detect_image`, `tg_bitmind_detect_video`, `tg_bitmind_preprocess_video`, `tg_bitmind_get_video_upload_url` |\n| **OpenAI (102)** — LLM / images | `tg_openai_chat`, `tg_openai_responses`, `tg_openai_embed`, `tg_openai_images_generate`, `tg_openai_moderate` |\n\n**These update automatically.** New miners registered on-chain appear within 5 minutes. Deregistered miners are cleaned up. The agent always sees only currently valid tools.\n\n> Some tool and field names contain `subnet` for legacy reasons — Telegraph began by integrating Bittensor subnets. Today a **miner** is any provider integrated via YAML, subnet or not.\n\n## How x402 Payments Work\n\nWhen an agent calls a paid tool (e.g., `tg_engine_ask`):\n\n1. MCP server sends request to Telegraph\n2. Telegraph returns HTTP 402 with payment requirements in response header\n3. `@x402/fetch` intercepts the 402, signs an EIP-3009 `TransferWithAuthorization` using your private key, attaches the signature as a `PAYMENT` header, and retries\n4. Telegraph verifies the payment on-chain via the PayAI facilitator and returns the result\n\n**The agent and LLM never see the payment flow, private key, or blockchain transaction.** It's fully transparent — the agent just sees a tool that returns results.\n\n## Integration Guides\n\n### Claude Desktop\n\nEdit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\\Claude\\claude_desktop_config.json` (Windows).\n\nUsing npx (simplest — no clone or build):\n\n```json\n{\n  \"mcpServers\": {\n    \"telegraph\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"telegraph-protocol-mcp\"],\n      \"env\": {\n        \"TELEGRAPH_NODE_URL\": \"http://13.237.89.59:7044\",\n        \"TELEGRAPH_ENGINE_URL\": \"http://13.237.89.59:8080\",\n        \"TELEGRAPH_DAEMON_URL\": \"http://13.237.89.59:8081\",\n        \"TELEGRAPH_EVM_PRIVATE_KEY\": \"0xyour_key_here\"\n      }\n    }\n  }\n}\n```\n\nOr pointing at a local build:\n\n```json\n{\n  \"mcpServers\": {\n    \"telegraph\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/telegraph-mcp/dist/index.js\"],\n      \"env\": {\n        \"TELEGRAPH_NODE_URL\": \"http://13.237.89.59:7044\",\n        \"TELEGRAPH_ENGINE_URL\": \"http://13.237.89.59:8080\",\n        \"TELEGRAPH_DAEMON_URL\": \"http://13.237.89.59:8081\",\n        \"TELEGRAPH_EVM_PRIVATE_KEY\": \"0xyour_key_here\"\n      }\n    }\n  }\n}\n```\n\nRestart Claude Desktop. The Telegraph tools will appear in the tool list. Try asking *\"What's the weather in Lahore?\"* or *\"Use the Telegraph engine to explain what Bitcoin is.\"*\n\n### Cursor\n\nAdd to Cursor Settings → MCP → Add new MCP server:\n\n```json\n{\n  \"mcpServers\": {\n    \"telegraph\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/telegraph-mcp/dist/index.js\"],\n      \"env\": {\n        \"TELEGRAPH_NODE_URL\": \"http://13.237.89.59:7044\",\n        \"TELEGRAPH_ENGINE_URL\": \"http://13.237.89.59:8080\",\n        \"TELEGRAPH_DAEMON_URL\": \"http://13.237.89.59:8081\",\n        \"TELEGRAPH_EVM_PRIVATE_KEY\": \"0xyour_key_here\"\n      }\n    }\n  }\n}\n```\n\n### ElizaOS\n\nIn your Eliza character file or MCP plugin config:\n\n```json\n{\n  \"mcp\": {\n    \"telegraph\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/telegraph-mcp/dist/index.js\"],\n      \"env\": {\n        \"TELEGRAPH_NODE_URL\": \"http://13.237.89.59:7044\",\n        \"TELEGRAPH_ENGINE_URL\": \"http://13.237.89.59:8080\",\n        \"TELEGRAPH_DAEMON_URL\": \"http://13.237.89.59:8081\",\n        \"TELEGRAPH_EVM_PRIVATE_KEY\": \"0xyour_key_here\"\n      }\n    }\n  }\n}\n```\n\nElizaOS v0.25+ supports MCP via the `@elizaos/plugin-mcp` package. Enable it in your character's plugin list:\n\n```json\n{\n  \"plugins\": [\"@elizaos/plugin-mcp\"]\n}\n```\n\n### LangChain / LangGraph\n\nLangChain supports MCP through `langchain-mcp-adapters`:\n\n```bash\npip install langchain-mcp-adapters\n```\n\n```python\nfrom langchain_mcp_adapters.client import MultiServerMCPClient\n\nclient = MultiServerMCPClient({\n    \"telegraph\": {\n        \"command\": \"node\",\n        \"args\": [\"/path/to/telegraph-mcp/dist/index.js\"],\n        \"env\": {\n            \"TELEGRAPH_NODE_URL\": \"http://13.237.89.59:7044\",\n            \"TELEGRAPH_ENGINE_URL\": \"http://13.237.89.59:8080\",\n            \"TELEGRAPH_DAEMON_URL\": \"http://13.237.89.59:8081\",\n            \"TELEGRAPH_EVM_PRIVATE_KEY\": \"0xyour_key_here\",\n        },\n        \"transport\": \"stdio\",\n    }\n})\n\ntools = client.get_tools()\n# Use tools with your LangChain agent\n```\n\nTypeScript/Node.js:\n\n```bash\nnpm install @langchain/mcp-adapters\n```\n\n```typescript\nimport { MultiServerMCPClient } from \"@langchain/mcp-adapters\";\n\nconst client = new MultiServerMCPClient({\n  telegraph: {\n    command: \"node\",\n    args: [\"/path/to/telegraph-mcp/dist/index.js\"],\n    env: {\n      TELEGRAPH_NODE_URL: \"http://13.237.89.59:7044\",\n      TELEGRAPH_ENGINE_URL: \"http://13.237.89.59:8080\",\n      TELEGRAPH_DAEMON_URL: \"http://13.237.89.59:8081\",\n      TELEGRAPH_EVM_PRIVATE_KEY: \"0xyour_key_here\",\n    },\n    transport: \"stdio\",\n  },\n});\n\nconst tools = await client.getTools();\n```\n\n### OpenClaw\n\nOpenClaw natively supports MCP via configuration. Add to `openclaw.config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"telegraph\": {\n      \"type\": \"stdio\",\n      \"command\": \"node\",\n      \"args\": [\"/path/to/telegraph-mcp/dist/index.js\"],\n      \"env\": {\n        \"TELEGRAPH_NODE_URL\": \"http://13.237.89.59:7044\",\n        \"TELEGRAPH_ENGINE_URL\": \"http://13.237.89.59:8080\",\n        \"TELEGRAPH_DAEMON_URL\": \"http://13.237.89.59:8081\",\n        \"TELEGRAPH_EVM_PRIVATE_KEY\": \"0xyour_key_here\"\n      }\n    }\n  }\n}\n```\n\n### Goose\n\nGoose supports MCP servers through its extensions system. Configuration in `~/.config/goose/config.yaml`:\n\n```yaml\nextensions:\n  telegraph:\n    type: mcp\n    command: node\n    args:\n      - /path/to/telegraph-mcp/dist/index.js\n    env:\n      TELEGRAPH_NODE_URL: http://13.237.89.59:7044\n      TELEGRAPH_ENGINE_URL: http://13.237.89.59:8080\n      TELEGRAPH_DAEMON_URL: http://13.237.89.59:8081\n      TELEGRAPH_EVM_PRIVATE_KEY: 0xyour_key_here\n```\n\n### VS Code / Continue\n\nIn Continue's `config.json`:\n\n```json\n{\n  \"experimental\": {\n    \"modelContextProtocolServers\": [\n      {\n        \"transport\": {\n          \"type\": \"stdio\",\n          \"command\": \"node\",\n          \"args\": [\"/path/to/telegraph-mcp/dist/index.js\"],\n          \"env\": {\n            \"TELEGRAPH_NODE_URL\": \"http://13.237.89.59:7044\",\n            \"TELEGRAPH_ENGINE_URL\": \"http://13.237.89.59:8080\",\n            \"TELEGRAPH_DAEMON_URL\": \"http://13.237.89.59:8081\",\n            \"TELEGRAPH_EVM_PRIVATE_KEY\": \"0xyour_key_here\"\n          }\n        }\n      }\n    ]\n  }\n}\n```\n\n### Generic / Any MCP Client\n\nThe server uses **MCP stdio transport** — the standard for local MCP servers. Any client that supports the MCP protocol over stdio can use it:\n\n```json\n{\n  \"mcpServers\": {\n    \"telegraph\": {\n      \"command\": \"node\",\n      \"args\": [\"/path/to/telegraph-mcp/dist/index.js\"],\n      \"env\": {\n        \"TELEGRAPH_NODE_URL\": \"http://13.237.89.59:7044\",\n        \"TELEGRAPH_ENGINE_URL\": \"http://13.237.89.59:8080\",\n        \"TELEGRAPH_DAEMON_URL\": \"http://13.237.89.59:8081\",\n        \"TELEGRAPH_EVM_PRIVATE_KEY\": \"0xyour_key_here\"\n      }\n    }\n  }\n}\n```\n\n## Dynamic Tool Discovery\n\nSubnet tools are **not hardcoded**. On startup and every 5 minutes:\n\n1. Fetches live integrations from `GET /miner-dispatcher/integrations` on the Telegraph node\n2. Diffs against currently registered tools\n3. Adds new subnets → auto-registers tools\n4. Removes stale subnets → deletes tools\n5. Sends `notifications/tools/list_changed` to connected clients\n\nThis means:\n- **New subnets** appear automatically within 5 minutes of on-chain registration — no MCP restart needed\n- **Removed subnets** are cleaned up — agents won't call non-existent tools\n- **Agents always have an accurate view** of what's available on the network\n\n## Security\n\n- **Use a burner wallet.** Never use your main wallet. Fund with only the USDC needed for inference.\n- **The private key stays in the MCP process.** Never exposed to the agent or LLM.\n- **The MCP server runs locally** over stdio — no network exposure.\n- Payments are per-call: typically $0.01 per inference request.\n\n## Development\n\n```bash\nnpm install          # Install deps\nnpm run build        # Compile TypeScript\nnpm run dev          # Dev mode with tsx (hot reload)\nnpx @modelcontextprotocol/inspector dist/index.js  # Inspect tools\n```\n",
  "bytes": 13406,
  "sha": "640fccc6d2180787c53b5ea02ba77de0349d42944caeec6057d316b51384c1b1",
  "repo_slug": "telegraphprotocol/telegraph-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_telegraphprotocol_telegraph_3c563c11/readme"
}