INTEGRATION · SPRING-BOOT

Spring Boot MCP Integration

Java enterprises have thousands of REST endpoints. Turn your Spring Boot controllers into Model Context Protocol (MCP) tools dynamically via OpenAPI and wmcp.sh, without adding heavyweight custom MCP servers.

Bridging Java backends to AI

Rewriting a complex, secure, mature Spring Boot backend into an MCP-native server is a massive undertaking. Java developers often struggle with integrating modern agent frameworks seamlessly. But you don't have to rewrite your app.

Using springdoc-openapi, you can extract the exact parameters, validation rules, and security contexts of your endpoints. wmcp.sh parses this spec and serves it as native MCP tools.

From @RestController to MCP tool

// Java - Spring Boot Controller
import org.springframework.web.bind.annotation.*;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

@RestController
@RequestMapping("/api/customers")
@Tag(name = "agent")
public class CustomerController {

    @PostMapping
    @Operation(summary = "Create a customer", description = "Registers a new enterprise customer.")
    public Customer createCustomer(@RequestBody CustomerDto dto) {
        return customerService.create(dto);
    }
}

# Pass the generated spec to wmcp.sh
curl -X GET "https://wmcp.sh/api/v1/tools?url=https://your-java-app.com/v3/api-docs&tag=agent"

Hand-rolled vs OpenAPI translation

CapabilityCustom Java MCP ServerWith wmcp.sh
Architecture⚠️ Runs alongside or inside your app✅ External proxy via OpenAPI
Spring Security❌ Must adapt to MCP transport✅ HTTP Authorization headers work normally
Validation⚠️ Duplicate @Valid rules to JSON schema✅ JSR-303 validations map to OpenAPI automatically
Integration cost⚠️ High (custom dependencies)✅ Zero (relies entirely on REST)

Common questions.

How do I generate an OpenAPI spec in Spring Boot?

Use the springdoc-openapi-starter-webmvc-ui dependency. It automatically scans your @RestController classes and generates a Swagger UI and a machine-readable JSON/YAML spec.

How does this compare to spring-ai-mcp?

spring-ai-mcp is a dedicated framework for building AI functionality in Java. wmcp.sh is a language-agnostic edge gateway: you keep your existing standard REST endpoints, and wmcp.sh translates them into MCP tools for any client.

How are Spring Security configurations handled?

Add @SecurityRequirement to your OpenAPI endpoints. wmcp.sh will forward the provided credentials (like a JWT) in the Authorization header, allowing your standard Spring Security filters to validate them.

Can I filter which endpoints become tools?

Yes. Group them by OpenAPI tags using the @Tag annotation in Spring, then pass ?tag=agent to wmcp.sh when configuring your MCP tools.

Need this done for you?

Skip the wiring — we build, deploy, and monitor.

Custom adapter + hosted MCP at mcp.yourbrand.com + verified badge. From $499 one-time setup.

See /managed → Submit (free)