MCP服务示例项目
基于Spring Boot的MCP协议服务示例,集成AI工具链实现智能服务功能。
快速入门
环境要求
- JDK 17
- Maven 3.8+
- 推荐使用IntelliJ IDEA
运行步骤
- 克隆仓库: git clone https://github.com/liqingdong/mcp-server-demo.git
- 构建项目: mvn clean install
- 启动服务(STDIO模式): java -jar -Dspring.ai.mcp.server.stdio=true target/mcp-server-demo-0.0.1-SNAPSHOT.jar
- 或启动服务(SSE模式,默认地址 http://localhost:8081/sse): java -jar target/mcp-server-demo-0.0.1-SNAPSHOT.jar
测试说明
- McpApplicationTest:验证应用上下文加载。
- SSEMcpTest/StdioMcpTest:测试不同协议下的MCP服务。