|
| 1 | +# AI integration |
| 2 | + |
| 3 | +## Model Context Protocol (MCP) |
| 4 | + |
| 5 | +The SubQuery SDK supports MCP for supercharging development of SubQuery projects with AI tools. MCP allows you to create, build, and deploy SubQuery projects using AI IDEs like Cursor. |
| 6 | + |
| 7 | +The integration runs locally in the same way the CLI is run, it requires no login, authentication or access to any private keys. |
| 8 | + |
| 9 | +### Features |
| 10 | + |
| 11 | +The SubQuery MCP integration supports all the same functionality as the CLI, including: |
| 12 | +* Creating new SubQuery projects |
| 13 | +* Building SubQuery projects |
| 14 | +* Publishing SubQuery projects to IPFS |
| 15 | +* Importing Contract ABIs into your project to generate datasources |
| 16 | +* Deploying to OnFinality managed services |
| 17 | + |
| 18 | + |
| 19 | +### Installing SubQuery MCP |
| 20 | + |
| 21 | +For easy installation you can click the following buttons to install SubQuery MCP: |
| 22 | + |
| 23 | +[](https://cursor.com/install-mcp?name=SubQuery&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBzdWJxbC9jbGkiLCJtY3AiXX0=) |
| 24 | + |
| 25 | +<!-- {"name":"SubQuery","gallery":true,"command":"npx","args":["-y","@subql/cli","mcp"]} --> |
| 26 | +[](https://vscode.dev/redirect/mcp/install?name=SubQuery&inputs=%7B%22id%22%3A%22workingDirectory%22%2C%22type%22%3A%22promptString%22%2C%22description%22%3A%22Working%20Directory%22%7D&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22cwd%22%3A%22%24%7Binput%3AworkingDirectory%7D%22%2C%22args%22%3A%5B%22-y%22%2C%22%40subql%2Fcli%22%2C%22mcp%22%5D%7D) |
| 27 | + |
| 28 | + |
| 29 | +#### Manual configuration |
| 30 | + |
| 31 | +For adding SubQuery MCP into other tools, the following command needs be run by the client. This will vary depending on the client that |
| 32 | + |
| 33 | +```bash |
| 34 | +npx -y @subql/cli mcp |
| 35 | +``` |
| 36 | + |
| 37 | +An example manual configuration: |
| 38 | + |
| 39 | +```json |
| 40 | +"subquery": { |
| 41 | + "command": "npx", |
| 42 | + "args": ["-y", "@subql/cli", "mcp"] |
| 43 | +} |
| 44 | +``` |
| 45 | + |
| 46 | +### Examples |
| 47 | + |
| 48 | +* `Create a new subquery project called new-subquery for the base network` |
| 49 | +* `Import a contract with the address 0x08e587bc0F634F5a97Cd38F73a9F55bC53B4e054 and it was deployed at block 32364699. It should index the Transfer event.` |
0 commit comments