springboot
SpringBoot RestFul接口改造为MCP智能服务基础框架-服务端
claude mcp add --transport stdio hywzy-springboot-mcp-server java -jar springboot-mcp-server.jar \ --env DEEPSEEK_API_KEY="your-deepseek-api-key"
How to use
This MCP server is a Spring Boot application that runs with Java 17+. It exposes an MCP-compliant service implemented in a Spring Boot project. Before starting, ensure you have a valid DeepSeek API key, as the server relies on DeepSeek for model/context capabilities. Start the server using the configured command, and then connect your MCP client tooling to the exposed endpoint to send and receive model-context protocol messages. The server is designed to work with DeepSeek-backed features; you’ll use your API key via the DEEPSEEK_API_KEY environment variable to authenticate and access those capabilities. After starting, the server should listen on its configured port (default Spring Boot port 8080 unless overridden) and handle requests defined by the MCP protocol supported by this Spring Boot implementation.
How to install
Prerequisites:
- JDK 17 or newer installed on your system
- Basic Git and Maven/Gradle workflow (if you intend to build from source)
Installation steps:
-
Clone the repository: git clone <repository-url> cd <repository-directory>
-
If you plan to build from source (recommended during development):
- For Maven: mvn clean package
- For Gradle: ./gradlew build This will produce a springboot-mcp-server.jar in the target/build directory.
-
Prepare environment:
- Ensure a valid DeepSeek API key is available and set it as an environment variable (see the mcp_config section for the exact var).
-
Run the server:
- If you built the jar: java -jar target/springboot-mcp-server.jar or if the jar is in the build output: java -jar build/libs/springboot-mcp-server.jar
-
Optional: Run via Docker (if a Docker image is provided by the project): docker run -e DEEPSEEK_API_KEY=your-key -p 8080:8080 <image-name>
Prerequisites recap:
- Java 17+ (JDK)
- DeepSeek API key
- Build tools (Maven/Gradle) if building from source
Note: If the project ships a prebuilt jar or a Docker image, you can skip the build steps and run directly using the provided artifacts.
Additional notes
Tips and notes:
- The server requires a DeepSeek API key; set DEEPSEEK_API_KEY in your environment before starting.
- By default the Spring Boot app runs on port 8080; configure server.port in application.properties or via environment variable if you need a different port.
- If you modify the source, re-build and replace the jar before running.
- Ensure you are using JDK 17+ as required by the README note.
- If you encounter connectivity or authentication issues, verify that the API key is valid and that your network allows access to DeepSeek services.