feat: add MCP server for Claude Code integration#146
feat: add MCP server for Claude Code integration#146satran004 merged 2 commits intobloxbean:mainfrom
Conversation
Add a lightweight MCP (Model Context Protocol) server that exposes yaci-devkit operations as tools for AI coding assistants. Runs as a Docker service alongside the existing devnet containers. Tools provided: - devnet_reset: reset devnet to genesis state - devnet_status: get devnet info and current tip - devnet_topup: fund an address with ADA - devnet_utxos: query UTxOs at an address - devnet_submit_tx: submit a CBOR transaction The server is a single-class Java application using the JDK built-in HttpServer, with Jackson for JSON. It proxies MCP JSON-RPC requests to the yaci-cli admin API over the Docker network. Multi-stage Dockerfile builds the jar without requiring local Java/Gradle. Accessible at http://localhost:9500/mcp when the devnet is running.
79417b3 to
52cfcfa
Compare
|
@Quantumplation Thanks. This is really a cool enhancement. Since we are already running an HTTP server to serve admin endpoints on port 10000, how about exposing an additional endpoint, /mcp, on the same port? That way, we don’t need a new container, and it can be converted to a native binary as part of yaci-cli, so fast startup. I can create a PR to your branch by moving your code into the CLI app: Since the framework we are using (Spring Boot) already supports MCP, I just need to configure the necessary dependencies and we should be good to go. We can then add additional functionalities there. |
|
Sure, let me take a stab at the migration! |
|
Perfect. After you add the Then you can directly call the available services in the CLI app to reset and perform other operations without going through HTTP calls. Here is the controller class where we have defined /reset and other endpoints. ClusterAdminController For testing, as full docker build takes time, you can directly run the built |
Move MCP server from standalone container into the Spring Boot CLI app using Spring AI 1.0.3. MCP tools now call services directly (in-process) instead of proxying via HTTP, and share the same port (10000) as the existing REST API. - Add spring-ai-starter-mcp-server-webmvc with SSE transport - Add DevnetMcpTools with 5 @tool methods: devnet_status, devnet_reset, devnet_topup, devnet_utxos, devnet_submit_tx - Remove standalone applications/mcp module and Docker container - Update docker-compose.yml and config/env
|
Done, let me know what you think! I didn't try to add the other commands we talked about yet, but can do so in a follow up PR |
satran004
left a comment
There was a problem hiding this comment.
@Quantumplation Thanks. Looks good to me.
Let me give it a try tomorrow, and then we’ll merge.
| spring.shell.config.location=/clusters | ||
| server.port=10000 | ||
|
|
||
| # MCP Server |
There was a problem hiding this comment.
@Quantumplation We may not need these mcp properties here, as you are already adding those to resources/application.yml in cli app.
Add a lightweight MCP (Model Context Protocol) server that exposes yaci-devkit operations as tools for AI coding assistants. Runs as a Docker service alongside the existing devnet containers.
Tools provided:
The server is a single-class Java application using the JDK built-in HttpServer, with Jackson for JSON. It proxies MCP JSON-RPC requests to the yaci-cli admin API over the Docker network. Multi-stage Dockerfile builds the jar without requiring local Java/Gradle.
Accessible at http://localhost:9500/mcp when the devnet is running.