简单 MCP Server 示例 (Java + Spring Boot + Spring AI)
@oneinstepGO
About 简单 MCP Server 示例 (Java + Spring Boot + Spring AI)
简单的 MCP Server 示例项目
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp-serve-demo": {
"type": "http",
"url": "http://localhost:8080/sse"
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is 简单 MCP Server 示例 (Java + Spring Boot + Spring AI)?
这是一个基于 Java 21、Spring Boot 3.3.12 和 Spring AI 构建的 MCP(模型上下文协议)服务器示例,使用 SSE 协议通信,旨在为开发者展示如何在 Java/Spring Boot 环境下搭建 MCP 服务器。它提供了天气查询、简单实用工具和 JSON 转换等可调用的工具。
How to use 简单 MCP Server 示例 (Java + Spring Boot + Spring AI)?
使用 Maven 命令 mvn clean package spring-boot:run 编译并启动服务器。服务器端点位于 http://localhost:8080/sse,支持 MCP 协议的客户端(如 Cursor 编辑器)可通过配置 .cursor/mcp.json 文件连接并使用其提供的工具。
Key features of 简单 MCP Server 示例 (Java + Spring Boot + Spring AI)?
- 基于 Spring Boot + Spring AI 快速构建 MCP 服务器
- 使用 SSE 协议进行通信
- 提供天气预报、回声、数学运算、时间戳工具
- 支持将 JSON 转换为 Java 类代码及示例输出
- 工具定义自动通过 Java 类型注解生成
- 可与 Cursor 等 MCP 客户端直接集成
Use cases of 简单 MCP Server 示例 (Java + Spring Boot + Spring AI)?
- 在支持 MCP 的 IDE(如 Cursor)中通过自然语言查询指定位置的天气预报
- 通过简单回声或数学工具快速验证 MCP 客户端与服务器的连接
- 利用 JsonTool 将 JSON 数据结构转换为 Java 类定义或生成示例 JSON
- 作为学习示例,帮助开发者理解 MCP 服务器在 Java 环境下的实现方式
FAQ from 简单 MCP Server 示例 (Java + Spring Boot + Spring AI)
如何启动这个 MCP 服务器?
在项目根目录执行 mvn clean package spring-boot:run 即可编译并运行,
More Other MCP servers
Codelf
unbugA search tool helps dev to solve the naming things problem.
Mcp
browsermcpBrowser MCP is a Model Context Provider (MCP) server that allows AI applications to control your browser
MCP Toolbox for Databases
googleapisMCP Toolbox for Databases is an open source MCP server for databases.
Awesome Mlops
visengerA curated list of references for MLOps
XcodeBuildMCP
cameroncookeA Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Comments