feat: MCP server#5542
Draft
SteKoe wants to merge 22 commits into
Draft
Conversation
SteKoe
force-pushed
the
feat/mcp-server
branch
2 times, most recently
from
July 17, 2026 20:57
1adf97c to
0032750
Compare
Adds spring-boot-admin-server-mcp, an optional module that exposes registered instances and health status via the Model Context Protocol using Spring AI 2.0.0-M6 with stateless Streamable HTTP transport. Three MCP tools are provided: - list-applications: lists all registered Spring Boot applications - get-health: fetches live health details from /actuator/health - get-status: returns the cached status from the registry Also adds spring-boot-admin-sample-mcp demonstrating Web UI and MCP server running together on the same port. # Conflicts: # pom.xml
Completes MVP tool coverage with five additional tools: - list-metrics: lists all available metric names from /actuator/metrics - get-metrics: fetches a specific metric value with unit - get-logs: returns last N lines from /actuator/logfile (default 50, max 500) - restart-application: POSTs to /actuator/restart - refresh-configuration: POSTs to /actuator/refresh, reports changed keys
Covers setup, all 8 tools, configuration reference, security, and connection examples for OpenCode, Claude Desktop, Claude Code, and Cursor.
Add get-env to resolve a single configuration property or environment variable and list-env to retrieve all environment properties grouped by property source, with an optional case-insensitive name filter. Document both tools and their actuator endpoint requirements.
Drop the Spring Security and devtools dependencies and the permit-all security bean in favour of spring-cloud-starter, and enable the restart and refresh actuator endpoints so the operations MCP tools work against the sample out of the box. Remove the obsolete application context test.
Contribute spring.ai.mcp.server.name and spring.ai.mcp.server.version as low-precedence defaults via an EnvironmentPostProcessor. The name defaults to "Spring Boot Admin MCP Server" and the version is read from the JAR manifest. User configuration still overrides both. Remove the now-redundant hardcoded values from the sample application.
Introduces a dedicated MCP server starter that bundles the Spring Boot Admin server with the MCP server module (without the Web UI). Register it in the root reactor and BOM, and switch the MCP sample to use the new starter.
Recommend the spring-boot-admin-starter-server-mcp starter and clarify it runs standalone without the Web UI. Note that server name and version have sensible defaults and need not be set explicitly.
… caches, and beans tools New tool classes (one per actuator, following existing pattern): - LoggersTools: list-loggers, get-logger, set-logger-level - ThreadDumpTools: get-thread-dump - HttpExchangesTools: get-http-exchanges (limit param) - ScheduledTasksTools: get-scheduled-tasks - CachesTools: list-caches - BeansTools: list-beans (filter param) Each tool class is independently togglable via spring.boot.admin.mcp.tools.<name>=false. McpProperties and McpAutoConfiguration extended accordingly. docs/07-mcp/index.md updated: Available Tools, Requirements, and Configuration Reference tables.
Extract shared WebClient call patterns into ActuatorClient (composition): - withInstance(): findByName / switchIfEmpty lookup with standard not-found message - fetch(): GET -> Map<String,Object> with configurable or default timeout - fetchText(): GET -> raw String (logfile) - post() / postBodiless(): POST with JSON body - query(appName, urlSuffix, formatter): collapses the withInstance -> fetch -> map -> onErrorResume block into one call for 10 read-only GET tool methods; label derived from urlSuffix Tool classes now hold a single ActuatorClient field. 6 tool classes (Caches, Beans, Env, Metrics, HttpExchanges, ScheduledTasks) drop their Logger field entirely; doOnError warnings route through ActuatorClient's own logger. McpAutoConfiguration wires one shared ActuatorClient bean into all tool beans. 65 tests remain green.
Two new properties in spring.boot.admin.mcp: - timeout (default 450ms): applied to all standard actuator calls - thread-dump-timeout (default 10s): applied to /actuator/threaddump Docs: two new rows added to the Configuration Reference table.
…PostProcessor Spring AI's sync default would block Netty's event loop; the async server matches the reactive WebFlux/Netty stack and tool methods that return Mono<String>. Although McpServerProperties.protocol defaults to STREAMABLE in Java, transport selection uses @ConditionalOnProperty evaluated against the Environment before property binding. McpServerSseWebFluxAutoConfiguration carries matchIfMissing=true on its SSE condition, so when the property is absent the legacy SSE transport wins and /mcp returns 404. Both defaults are contributed at lowest precedence (addLast) so users can override them. Users now only need spring.boot.admin.mcp.enabled=true.
type=async and protocol=streamable are now contributed automatically by McpServerDefaultsEnvironmentPostProcessor. Users only need spring.boot.admin.mcp.enabled=true.
- Update list-applications tool description to mention instance ID - Update fleet status example conversation to show id field in output - Add MCP sample to 09-samples index (list, directory tree, feature table)
Add instance ID to list-applications output. Allow all tools to resolve an instance by ID when no name match is found in the registry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for the Model Context Protocol (MCP) to Spring Boot Admin, allowing integration with AI assistants. The main changes include adding new MCP server and starter modules, updating dependencies to support MCP, and providing a new sample application and documentation for MCP integration.
MCP Server and Starter Modules:
spring-boot-admin-server-mcpandspring-boot-admin-starter-server-mcpto provide MCP server functionality and easy integration as a starter. (pom.xml,spring-boot-admin-server-mcp/pom.xml) [1] [2]spring-boot-admin-dependencies/pom.xml) [1] [2]Sample Application and Documentation:
spring-boot-admin-sample-mcpdemonstrating how to run the MCP server alongside the Web UI. Includes application code and configuration. (spring-boot-admin-samples/pom.xml,spring-boot-admin-samples/spring-boot-admin-sample-mcp/) [1] [2] [3] [4]spring-boot-admin-docs/src/site/docs/07-mcp/_category_.json,spring-boot-admin-docs/src/site/docs/09-samples/index.md) [1] [2] [3] [4]Dependency Updates:
spring-ai.versionproperty and ensured the MCP modules use the correct version of Spring AI dependencies. (pom.xml)These changes collectively enable Spring Boot Admin to expose registered instances and health status via MCP, facilitating AI assistant integration.