MCP.so
Sign In
Servers

Spring AI MCP Server 示例项目

@CrxusDonts

Overview

What is Spring AI MCP Server 示例项目?

Spring AI MCP Server 示例项目 is a Spring Boot–based Model Context Protocol (MCP) server demo that provides calculator, weather query, and data‑model/API‑interface tools. It is built on Java 17, Spring WebFlux, and uses Server‑Sent Events (SSE) for communication. This server is intended for developers exploring MCP integrations and Spring AI tool orchestration.

How to use Spring AI MCP Server 示例项目?

Clone the repository, configure a Hefeng Weather API key in src/main/resources/application.yml, build with mvn clean package, then run java -jar target/donts-ai-0.0.1-SNAPSHOT.jar. Connect to the SSE endpoint at /sse and send messages via POST /mcp/messages.

Key features of Spring AI MCP Server 示例项目

  • Calculator tool for evaluating math expressions.
  • Weather query tool for real‑time city weather.
  • Data‑model lookup tool by user description.
  • API‑interface lookup tool by data model.
  • API execution tool that constructs parameters and calls interfaces.
  • Uses Server‑Sent Events for event streaming.

Use cases of Spring AI MCP Server 示例项目

  • Prototyping MCP‑based AI assistants with arithmetic capability.
  • Demonstrating weather information retrieval in conversational AI.
  • Simulating enterprise data‑model and API discovery workflows.
  • Testing tool chaining (model → API → execution) in an MCP environment.
  • Teaching Spring Boot MCP server development with WebFlux.

FAQ from Spring AI MCP Server 示例项目

What runtime dependencies are required?

JDK 17 or higher and Maven 3.6 or higher. For weather queries, a Hefeng Weather API key must be configured.

How does the server communicate with clients?

It uses Server‑Sent Events (SSE) over HTTP. The SSE connection endpoint is /sse (GET), and messages are sent via POST /mcp/messages.

What simulated data is included?

The server pre‑loads three business‑scenario datasets: user model, order model, and product model, each with associated APIs.

Are the API calls real or simulated?

API execution tools are simulated—they validate parameters, generate mock responses, and do not call external services.

What transports are supported?

Only SSE transport is supported; no WebSocket or other MCP transports are mentioned. Authentication is not covered in the README.

More from Other