spring-documentation
MCP server from Kdmeenaa/spring-documentation-mcp-server
claude mcp add --transport stdio kdmeenaa-spring-documentation-mcp-server docker run -i kdmeenaa/spring-documentation-mcp-server:latest \ --env API_BASE_URL="http://localhost:8080" \ --env MCP_SSE_ENDPOINT="/mcp/spring/sse" \ --env SPRING_DATASOURCE_URL="jdbc:postgresql://localhost:5432/spring_docs" \ --env SPRING_PROFILES_ACTIVE="production" \ --env SPRING_DATASOURCE_PASSWORD="password" \ --env SPRING_DATASOURCE_USERNAME="postgres"
How to use
This MCP server provides AI-assisted access to Spring Framework documentation via a Server-Sent Events (SSE) endpoint. It indexes and serves full-text searchable Spring docs, code examples, and API references, enabling AI assistants to query, browse, and retrieve relevant information efficiently. The server exposes a web management UI for configuring projects, versions, and documentation sources, as well as an SSE feed for real-time documentation queries. To use it, run the server (e.g., via the provided Docker setup), then connect to the SSE endpoint to stream results, or use the web UI to manage documentation sources and migrations. Authentication is API-key based, so ensure you provide a valid API key when querying the MCP SSE endpoint.
How to install
Prerequisites:
- Docker and Docker Compose (optional for local dev)
- Java 25 is recommended for building the project if you choose a non-Docker path (not required when using the Docker image below)
- PostgreSQL database (or a compatible JDBC source) for full-text search indexing
Option A: Run via Docker (recommended)
- Install Docker
- Pull and run the MCP server image (example): docker run -d --name spring-doc-mcp -p 8080:8080 -e SPRING_PROFILES_ACTIVE=production kdmeenaa/spring-documentation-mcp-server:latest
- Wait for the container to initialize (logs will indicate when ready)
Option B: Build and run locally (if you clone the repo and build)
- Install Java 25 (LTS) and a JDK toolchain
- Clone the repository
- Build the project (Gradle): ./gradlew clean build
- Run the jar (example): java -jar build/libs/spring-boot-documentation-mcp-server-1.x.y.jar
- Ensure PostgreSQL is running and accessible via the configured datasource
Prerequisites recap:
- Java 25 or a compatible JDK if building locally
- PostgreSQL database for indexing
- Docker (recommended) or a Java runtime to run the built jar
Additional notes
Tips and caveats:
- API Keys: Secure the API keys used in the X-API-Key or Authorization headers; rotate keys regularly.
- SSE endpoint: Use the MCP SSE endpoint to stream results; ensure your client handles long-lived connections.
- Database migrations: The server relies on PostgreSQL; verify the schema migrations are applied on first start.
- Documentation sources: The server syncs Spring documentation from spring.io and related GitHub repos; ensure network access and credentials if private sources are used.
- Environment variables: Adjust SPRING_DATASOURCE_* values to point to your database; review API_BASE_URL and MCP_SSE_ENDPOINT to match your deployment.
- Logs: If the UI or SSE endpoint is not reachable, check container logs or application logs for configuration or binding issues (e.g., port 8080).