mcp_mediator
Automatically generate an MCP Server from existing source code, service classes, helper methods, and external MCP tools. The MCP Mediator aggregates various sources and tools into a unified system, enabling seamless automatic generation of a complete MCP Server.
claude mcp add --transport stdio makbn-mcp_mediator java -jar mcp-mediator.jar \ --env M2_REPO="Optional: Maven local repository path" \ --env JAVA_HOME="Path to your Java 17+ JDK installation"
How to use
The MCP Mediator is a Java-based framework that automatically generates MCP servers from existing code, services, and helpers. It aggregates multiple components into a single MCP Server, enabling MCP clients to interact with a unified interface without manually wiring separate servers. The mediator supports stdio-based transport and can proxy or extend capabilities through its modular components, including Spring and Spring Boot integration in newer iterations. After building the mediator, you run it to expose an MCP server that dispatches requests to the appropriate generated tools and handlers.
To use, start the mediator so it launches the configured MCP server (for example via a jar you built or a prebuilt distribution). The mediator can auto-generate MCP Server Tools for existing methods and services, allowing MCP clients to invoke operations exposed by your codebase as MCP Tools. Use the provided examples or your own code annotated with @McpService to generate and register tools that expose existing functionality to MCP clients. If you intend to run a stdio-based server, you can follow the README’s pattern of invoking a Java-based mediator jar and passing the appropriate class or main entry for the stdio example.
How to install
Prerequisites:
- Java 17 or later
- Maven 3.6+ (for building from source)
- Git
-
Clone the repository: git clone https://github.com/makbn/mcp_mediator.git cd mcp_mediator
-
Build the project (using Maven): mvn clean package -DskipTests
-
Run the mediator (generated jar will be available in the target directory): java -jar target/mcp-mediator-<version>.jar
-
Optional: customize run parameters by creating a configuration file or environment overrides as described in the README (e.g., server name, version, and transport options).
Notes:
- If you are integrating with Docker or other deployment methods, ensure the built jar is accessible and the environment is provisioned with Java 17+.
- See the README for examples of configuring a stdio-based MCP server and how to convert existing code into MCP servers.
Additional notes
Tips and notes:
- The mediator emphasizes auto-generation of MCP Server Tools for existing methods and services, reducing manual wiring.
- Transport options include stdio and SSE; Docker and Spring integrations are listed as work-in-progress, so plan deployment accordingly.
- When configuring servers, you can point to an executable script (e.g., run.sh) or directly to a jar, depending on your environment and how you package the mediator.
- If you plan to proxy multiple MCP servers, the mediator supports adding remote servers as part of a proxy configuration.
- Ensure Java 17+ is consistently used across build and runtime environments to avoid compatibility issues.
Related MCP Servers
reverse-engineering-assistant
MCP server for reverse engineering tasks in Ghidra 👩💻
GhidrAssistMCP
An MCP extension for Ghidra
quarkus-workshop-langchain4j
Quarkus Langchain4J Workshop
mcp-zap
A Spring Boot application exposing OWASP ZAP as an MCP (Model Context Protocol) server. It lets any MCP‑compatible AI agent (e.g., Claude Desktop, Cursor) orchestrate ZAP actions—spider, active scan, import OpenAPI specs, and generate reports.
glyph
🔮 glyph – mcp server to map your codebase with symbol outlines
solon-ai-embedded-examples
solon ai(&mcp) embedded examples。支持 MCP_2025_06_18(mcp streamable)。示例项目包括各种框架嵌入:(Solon、SpringBoot、jFinal、Vert.X、Quarkus、Micronaut)