Guides / Spring Boot
☕ Spring Boot

Connect Spring Boot to Claude Desktop

Paste your @RestController and get a hosted MCP server URL in under 2 minutes. No new code to write.

✓

Prerequisites

Before you start, make sure you have:

1

Copy your controller

Open your Spring Boot project and copy the source of a @RestController. Here's a typical example — yours will look similar:

@RestController
@RequestMapping("/api/orders")
public class OrderController {

    @GetMapping("/{id}")
    public Order getOrder(@PathVariable String id) { ... }

    @GetMapping
    public List<Order> listOrders(
            @RequestParam("status") String status) { ... }

    @PostMapping
    public Order createOrder(@RequestBody CreateOrderRequest req) { ... }

    @PutMapping("/{id}/status")
    public Order updateStatus(@PathVariable String id,
                              @RequestBody StatusUpdate update) { ... }

    @DeleteMapping("/{id}")
    public void cancelOrder(@PathVariable String id) { ... }
}
Tip: You can paste multiple controllers at once — just concatenate the files. MCP Forge scans all endpoints in the pasted code.
2

Paste into the dashboard

Sign in to your dashboard, go to the Deploy tab, and paste your controller code into the editor. The label reads "Spring Boot, Express.js, or FastAPI" — all three are auto-detected.

Click Generate + Deploy MCP Server →. MCP Forge will scan your annotations and generate tool definitions for every endpoint it finds.

3

Review the generated tools

Within a few seconds the dashboard shows the tools extracted from your controller:

Generated tools — OrderController
GET
getOrder
/api/orders/{id}
GET
listOrders
/api/orders?status=
POST
createOrder
/api/orders
PUT
updateStatus
/api/orders/{id}/status
DELETE
cancelOrder
/api/orders/{id}

Your MCP server is now live at a URL like https://api.main-duck.com/mcp/{tenantId}/sse — visible in the dashboard under Your MCP Endpoint.

4

Add to Claude Desktop

Open Claude Desktop → Settings → Developer → Edit Config. Add your MCP server to claude_desktop_config.json:

{
  "mcpServers": {
    "my-orders-api": {
      "url": "https://api.main-duck.com/mcp/YOUR_TENANT_ID/sse"
    }
  }
}

Replace YOUR_TENANT_ID with the value shown in your dashboard. Save the file and restart Claude Desktop.

Done. Claude can now call your Spring Boot endpoints directly. Try: "List all pending orders" or "Create an order for item SKU-123."
⚡

Optional: Auto-sync on push

If you add or rename endpoints, you'd normally re-paste. Instead, connect GitHub auto-sync so MCP Forge re-deploys your tools every time you push:

  1. Go to Dashboard → GitHub Sync
  2. Paste your repo URL and a GitHub Personal Access Token (read scope)
  3. Set the branch you want watched (default: main)
  4. Copy the webhook URL and add it in GitHub → Settings → Webhooks

Every push to the configured branch now triggers an automatic re-deploy with no manual steps.