Spring Boot starter that automatically exposes SpringDoc OpenAPI operations as MCP tools. - Auto-discovery of OpenAPI operations from your running Spring app - Auto-registration of MCP tools for discovered API operations - Smart-context tools: metadiscoverapitools, metainvokeapibyintent - Response optimization with projection/summarization controls - Risk controls for dangerous operations (confirm
Add this skill
npx mdskills install Neo1228/spring-boot-starter-swagger-mcpWell-documented Spring Boot starter that auto-exposes OpenAPI operations as MCP tools with smart discovery and security controls
Spring Boot starter that automatically exposes SpringDoc OpenAPI operations as MCP tools.
meta_discover_api_tools, meta_invoke_api_by_intent_confirm, blocked paths, role checks, audit logs)graph TD
User([User / LLM Client]) MCP[MCP Client / Claude Desktop]
MCP Bridge[Swagger MCP Bridge /starter/]
Bridge Docs[SpringDoc OpenAPI /v3/api-docs]
Bridge API[Your Spring Controller /hello]
Use:
Gradle (build.gradle.kts):
plugins {
id("org.springframework.boot") version "3.5.9"
id("io.spring.dependency-management") version "1.1.7"
java
}
java {
sourceCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-api:2.8.3")
implementation("io.github.neo1228:spring-boot-starter-swagger-mcp:")
}
Maven (pom.xml):
0.1.0-SNAPSHOT
org.springframework.boot
spring-boot-starter-web
org.springdoc
springdoc-openapi-starter-webmvc-api
2.8.3
io.github.neo1228
spring-boot-starter-swagger-mcp
${swagger-mcp.version}
Use a release version (for example 0.1.0) when consuming from a remote artifact repository.
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController
public class HelloController {
@Operation(operationId = "getHello", summary = "Get greeting message")
@GetMapping("/hello")
public Map hello(@RequestParam(defaultValue = "world") String name) {
return Map.of("message", "Hello " + name);
}
}
application.yml)spring:
ai:
mcp:
server:
protocol: STREAMABLE_HTTP
streamable-http:
mcp-endpoint: /mcp
swagger:
mcp:
enabled: true
api-docs-path: /v3/api-docs
tool-name-prefix: api_
./gradlew bootRun or ./mvnw spring-boot:runhttp://localhost:8080/v3/api-docshttp://localhost:8080/mcpGenerated tool names follow `` (example: api_gethello).
If the artifact is not published to a remote registry yet:
./gradlew publishToMavenLocalmavenLocal() repository0.1.0-SNAPSHOT (or your chosen local version)swagger.mcp.enabled: enable/disable bridge (default true)swagger.mcp.api-docs-path: OpenAPI docs path (default /v3/api-docs)swagger.mcp.tool-name-prefix: tool name prefix (default api_)swagger.mcp.smart-context.gateway-only: expose only meta toolsswagger.mcp.security.require-confirmation-for-risky-operations: require _confirm token for risky methodsFor risky HTTP methods (POST, PUT, PATCH, DELETE), default policy requires _confirm=CONFIRM.
| Starter | Java | Spring Boot | springdoc-openapi | Spring AI BOM |
|---|---|---|---|---|
| 0.1.x | 17+ | 3.5.x | 2.8.3 | 1.1.2 |
Spring Boot 4.x is not supported in this repository.
See examples/minimal-webmvc-gradle for a minimal app using this starter.
RELEASING.mdVERSIONING.mdCHANGELOG.md./gradlew testCONTRIBUTING.mdSECURITY.mdApache License 2.0 (LICENSE)
Install via CLI
npx mdskills install Neo1228/spring-boot-starter-swagger-mcpSpring Boot Starter Swagger MCP is a free, open-source AI agent skill. Spring Boot starter that automatically exposes SpringDoc OpenAPI operations as MCP tools. - Auto-discovery of OpenAPI operations from your running Spring app - Auto-registration of MCP tools for discovered API operations - Smart-context tools: metadiscoverapitools, metainvokeapibyintent - Response optimization with projection/summarization controls - Risk controls for dangerous operations (confirm
Install Spring Boot Starter Swagger MCP with a single command:
npx mdskills install Neo1228/spring-boot-starter-swagger-mcpThis downloads the skill files into your project and your AI agent picks them up automatically.
Spring Boot Starter Swagger MCP works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.