4‐Components - makbn/mcp_mediator GitHub Wiki

Supported Components & Implementations

The MCP Mediator provides rich out-of-the-box integrations for common architectural patterns, APIs, and services.

1. Spring Framework & Spring Boot Integration

The MCP Mediator natively integrates into Spring environments, providing extreme velocity for exposing existing @RestControllers and standard @Controllers as autonomous MCP Server tools.

mcp-mediator-spring-boot-starter

Simply including the starter in your pom.xml enables robust auto-configuration.

The library includes the McpSpringControllerFactory which uses ByteBuddy to dynamically inspect your Spring application context at runtime. It scans for any @Controller and @RestController mappings (such as @GetMapping, @PostMapping, etc.) and automatically proxies them into MCP Tools—with zero manual configuration!

Example: Any existing Spring Controller you have:

@RestController
@RequestMapping("/api/users")
public class UserController {
    
    @GetMapping("/{id}")
    public User getUser(@PathVariable("id") String id) {
        // Automatically wrapped into an MCP tool named "getUser"
        return userService.findById(id);
    }
}

The auto-proxy system generates the appropriate JSON schemas, handles serialization, and registers it. When a client (like Claude Desktop) calls the getUser tool, the mediator dynamically invokes the Spring controller endpoint.


2. OpenAPI Specification Adapter

Convert any standard OpenAPI/Swagger specification into a fully functioning MCP Server dynamically!

Available via the mcp-mediator-openapi module, the mediator uses swagger-parser to parse remote or local openapi.yaml/openapi.json specs. It automatically interprets endpoints, HTTP methods, paths, and query parameters.

Usage:

OpenApiMcpRequestHandler openApiHandler = new OpenApiMcpRequestHandler("https://api.example.com/v3/api-docs");

// The mediator parses the API definitions and translates them into an active MCP Tool Set
mediator.registerHandler(openApiHandler);

When an LLM invokes one of these auto-generated tools, the OpenApiMcpRequestHandler constructs the appropriate HTTP payload and forwards the request natively via Java HttpClient, responding to the LLM with the API response!


3. Docker Service Implementation

A ready-to-use Docker management integration via mcp-mediator-implementation-docker.

By utilizing docker-java, this module provides a @McpService annotated DockerMcpService that translates standard Docker tasks into LLM-accessible tools.

Features Available as Tools:

  • List all running and stopped containers
  • Start a specific container
  • Stop a specific container
  • Remove a container

Usage:

DockerClient dockerClient = DockerClientBuilder.getInstance().build();
DockerMcpService dockerService = new DockerMcpService(dockerClient);

mediator.registerHandler(McpServiceFactory.create(dockerService).build());

4. Dropbox Service Implementation

The mcp-mediator-implementation-dropbox module leverages the official Dropbox Java SDK (8.0.2+) to expose file system exploration tools natively to MCP.

Features Available as Tools:

  • get_account_info: Retrieve account metadata and storage quotas.
  • list_folder: Iterate over files and subdirectories given a directory path.

Usage:

DbxRequestConfig config = DbxRequestConfig.newBuilder("mcp-mediator").build();
DbxClientV2 client = new DbxClientV2(config, "YOUR_ACCESS_TOKEN");

DropboxMcpService dropboxService = new DropboxMcpService(client);
mediator.registerHandler(McpServiceFactory.create(dropboxService).build());