Skip to content

Commit 0ca2d89

Browse files
committed
add mcp-substrate initial draft
1 parent 1922178 commit 0ca2d89

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed

applications/mcp-substrate.md

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Substrate MCP Server
2+
3+
> [!NOTE]
4+
> This document will be part of the terms and conditions of your agreement and, therefore, needs to contain all the required information about the project. Don't remove any of the mandatory parts presented in bold letters or as headlines (except for the title)! Lines starting with a `>` (such as this one) should be removed. Please use markdown instead of HTML (e.g., `![](image.png)` instead of `<img>`).
5+
>
6+
> See the [Grants Program Process](https://grants.web3.foundation/docs/process) on how to submit a proposal.
7+
8+
- **Team Name:**
9+
- **Payment Details:**
10+
- **[Level](https://grants.web3.foundation/docs/Introduction/levels):** 2
11+
12+
> [!IMPORTANT]
13+
> *The combination of your GitHub account submitting the application and the payment address above will be your unique identifier during the program. Please keep them safe.*
14+
15+
## Project Overview :page_facing_up:
16+
17+
`mcp-substrate` is a proposal for a server that exposes on-chain state to AI agents via MCP. This is done by parsing Substrate's runtime metadata, generating MCP "Resources" from it, and providing an HTTP server running MCP, allowing AI agents to query on-chain data via Polkadot.js. This can serve any Substrate instance's state over MCP via a small, CLI-based webserver.
18+
19+
### Overview
20+
21+
[Model-Context Protocol (MCP)](https://www.anthropic.com/news/model-context-protocol) is an open protocol developed by [Anthropic](https://www.anthropic.com/) that defines standardized interactions between AI agents and external systems. It is used in many modern agents and tools, including Claude Desktop, OpenAI's SDK, Windsurf, and Cursor. This proposal aims to build a server that exposes on-chain state and runtime metadata for Substrate-based chains (like Kusama, BitTensor, Akash, etc) via Substrate's runtime metadata and MCP, allowing AI agents to interact with blockchain data more effectively.
22+
23+
A larger list of MCP-compatible servers and clients can be found at [awesome-mcp](https://github.com/appcypher/awesome-mcp-servers?tab=readme-ov-file).
24+
25+
### Project Details
26+
27+
`mcp-substrate` will:
28+
29+
- Connect to a Substrate-based chain via Polkadot.js.
30+
- Fetch the runtime metadata and decompose it into "Resources" available to MCP clients.
31+
- Expose chain state and data through MCP's standardized "Resource" interface
32+
- Implement MCP endpoints that return blockchain data in AI-consumable formats
33+
- Provide TypeScript SDK for easy integration
34+
35+
Technical stack:
36+
37+
- TypeScript/Node.js for the server implementation
38+
- [modelcontextprotocol/typescript-sdk](https://github.com/modelcontextprotocol/typescript-sdk) for MCP compliance
39+
- Polkadot.js libraries for Substrate interaction
40+
- CLI for easy deployment
41+
- Docker for more testnet/production deployment
42+
43+
The scope of this grant will NOT:
44+
45+
- Work with parachains.
46+
- Send extrinsics.
47+
- Modify or extend the MCP protocol specification itself
48+
- Build end-user applications beyond demonstration purposes
49+
50+
### Ecosystem Fit
51+
52+
This project fits into the Polkadot/Substrate ecosystem by enhancing the accessibility of blockchain data for AI systems. It addresses the following needs:
53+
54+
- Target audience: AI developers, Substrate/Polkadot developers, and teams building AI-enhanced blockchain applications
55+
- Needs: Standardized AI-friendly access to Substrate blockchain data; easier integration between AI assistants and Substrate chains
56+
- Identification: The growth of AI assistants and their ability to interact with structured data systems creates an opportunity to make blockchain data more accessible through standardized protocols like MCP
57+
58+
There are currently no similar projects in the Substrate/Polkadot ecosystem that specifically focus on Model-Context Protocol integration. This project aims to bridge Substrate projects with the latest technology in the AI and agent space.
59+
60+
## Team :busts_in_silhouette:
61+
62+
> [!IMPORTANT]
63+
> Please note that the data provided in this section is for administrative and informational purposes only. All beneficiaries of a grant must also be listed in the KYC/KYB process during the application phase. See our [FAQ](https://grants.web3.foundation/docs/faq#what-is-kyckyb-and-why-do-i-have-to-provide-this-data) for more info.
64+
65+
### Team members
66+
67+
Jake Hemmerle is a software engineer with several years of experience with blockchain architecture and development. His background includes Substrate runtime development, cryptography engineering, and he has contributions to multiple open source projects, including Substrate and Matrix, as well as several Substrate-based projects, including Entropy and Astar Network.
68+
69+
- **Email:** <[email protected]>
70+
- **GitHub:** <https://github.com/jakehemmerle>
71+
- **LinkedIn:** <https://www.linkedin.com/in/jakehemmerle/>
72+
73+
## Development Status :open_book:
74+
75+
This project is in the initial planning phase. The concept builds upon:
76+
77+
- The [Model-Context Protocol specification](https://github.com/anthropics/anthropic-cookbook/tree/main/mcp), which defines standardized interactions between AI assistants and external systems
78+
- The Polkadot.js libraries for Substrate chain interaction
79+
- Existing knowledge and documentation about Substrate runtime metadata structure and chain state access
80+
81+
## Development Roadmap :nut_and_bolt:
82+
83+
### Overview
84+
85+
- **Total Estimated Duration:** 2 months
86+
- **Full-Time Equivalent (FTE):** 1 FTE
87+
- **Total Costs:** 20,000 USDC
88+
- **DOT %:** 0%
89+
90+
### Milestone 1 — MVP
91+
92+
- **Estimated duration:** 2 month
93+
- **FTE:** 1
94+
- **Costs:** 20,000 USDC
95+
96+
| Number | Deliverable | Specification |
97+
| -----: | ----------- | ------------- |
98+
| **0a.** | License | Apache 2.0 |
99+
| **0b.** | Documentation | We will provide comprehensive documentation including: inline code documentation, setup and usage guides, and example usage scenarios of our tool with a simple standalone Substrate chain.|
100+
| **0c.** | Testing and Testing Guide | Core functions will be fully covered by unit tests and integration tests. We will provide a testing guide that explains how to run these tests and validate the MCP server functionality with the Substrate chain. |
101+
| **0d.** | Docker | We will provide a Dockerfile, Docker Compose, and a CLI tool to easily spin up the MCP server connected to various Substrate chains. |
102+
| 0e. | Article | We can publish an article (where?) explaining how to use `mcp-substrate`, its basic architecture, and examples of AI assistants interacting with Substrate blockchains. |
103+
| 1. | MCP Server Core | Implement the core MCP server that complies with the Model-Context Protocol specification, including the necessary endpoints, request/response handling, and server infrastructure. |
104+
| 2. | Polkadot.js Integration | Integrate Polkadot.js libraries to connect to Substrate-based nodes, fetch their runtime metadata, and query their state. |
105+
| 3. | Chain State Resource Implementation | Dynamically generate MCP "Resources" that expose Substrate chain state (storage items, constants, runtime information) via standardized MCP interfaces. |
106+
| 4. | Example AI Assistant Integration | Develop example scripts and documentation showing how AI assistants can use the MCP server to query and interpret Substrate chain data. |
107+
108+
## Future Plans
109+
110+
The Substrate MCP Server aims to become a standard component in the AI-enhanced blockchain development ecosystem. Our future plans can include:
111+
112+
- supporting cross-parachain queries.
113+
- supporting queries into smart contract state (eg. ink!, EVM)
114+
- supporting multiple Substrate-chains through the same binary
115+
- the construction and submission of extrinsics
116+
- working with the community to identify and implement additional features and use cases
117+
- promoting the project to AI developers to increase adoption and blockchain accessibility
118+
- exploring commercial support options for teams building production applications

0 commit comments

Comments
 (0)