Skip to content

feat: add MCP server for Claude Code integration#146

Merged
satran004 merged 2 commits intobloxbean:mainfrom
SundaeSwap-finance:feat/mcp-server
Mar 1, 2026
Merged

feat: add MCP server for Claude Code integration#146
satran004 merged 2 commits intobloxbean:mainfrom
SundaeSwap-finance:feat/mcp-server

Conversation

@Quantumplation
Copy link
Copy Markdown
Contributor

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.

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.
@satran004
Copy link
Copy Markdown
Member

@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:
https://github.com/bloxbean/yaci-devkit/tree/main/applications/cli

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.

@Quantumplation
Copy link
Copy Markdown
Contributor Author

Sure, let me take a stab at the migration!

@satran004
Copy link
Copy Markdown
Member

satran004 commented Feb 28, 2026

Perfect. After you add the spring-boot-mcp dependency to the CLI app, we can add MCP tools simply by using the @tool annotation.

Here's an example
https://github.com/bloxbean/yaci-store/blob/92ff8132f6f37f8152d981d585369f3213d4d33d/aggregates/mcp-server/src/main/java/com/bloxbean/cardano/yaci/store/mcp/server/McpAdaPotService.java#L28

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 yaci-cli.jar from applications/cli folder using java -jar.
In non docker mode, you can use cardano-node and other components through download command in yaci-cli and then create devnet through similar commands. https://devkit.yaci.xyz/commands

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
@Quantumplation
Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Member

@satran004 satran004 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Quantumplation We may not need these mcp properties here, as you are already adding those to resources/application.yml in cli app.

@satran004 satran004 merged commit be6f22d into bloxbean:main Mar 1, 2026
2 checks passed
@Quantumplation Quantumplation deleted the feat/mcp-server branch March 1, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants