# Mcp Spring Ai Mcp Server

> 使用java 编写mcp server并说明接口的使用方式

- **Type:** MCP server
- **Install:** `agentstack add mcp-chaozai0304-mcp-spring-ai-mcp-server`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [chaozai0304](https://agentstack.voostack.com/s/chaozai0304)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [chaozai0304](https://github.com/chaozai0304)
- **Source:** https://github.com/chaozai0304/mcp-spring-ai-mcp-server

## Install

```sh
agentstack add mcp-chaozai0304-mcp-spring-ai-mcp-server
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# mcp server demo
## 如何通信
```
1.http://localhost:8090/sse
输出：
event:endpoint
data:/mcp/message?sessionId=8a57c258-068f-4c52-b08d-d69ac85c583e
此时内页会进入等待通道已经建立
2.获取tools列表【路径是上面返回data】
curl --location --request POST 'http://localhost:8090/mcp/message?sessionId=8a57c258-068f-4c52-b08d-d69ac85c583e' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "notifications/initialized"
}'
或
curl --location --request POST 'http://localhost:8090/mcp/message?sessionId=8a57c258-068f-4c52-b08d-d69ac85c583e' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "tools/list",
    "id": "e60983d1-1",
    "params": {}
}'
3.sse页面返回内容
event:endpoint
data:/mcp/message?sessionId=8a57c258-068f-4c52-b08d-d69ac85c583e

event:message
data:{"jsonrpc":"2.0","id":"e60983d1-1","result":{"tools":[{"name":"add","description":"加法","inputSchema":{"type":"object","properties":{"a":{"type":"integer","format":"int32","description":"第一个参数"},"b":{"type":"integer","format":"int32","description":"第二个参数"}},"required":["a","b"],"additionalProperties":false}},{"name":"owner_getByUserName","description":"根据名称返回年龄","inputSchema":{"type":"object","properties":{"name":{"type":"string","description":"名称"}},"required":["name"],"additionalProperties":false}}]}}
```
## 重点pom
`````

	4.0.0
	
		org.springframework.boot
		spring-boot-starter-parent
		3.4.4
		
	
	com.aitools
	mcp
	0.0.1-SNAPSHOT
	mcp
	Demo project for Spring Boot
	
		17
		17
		17
		1.0.0-M7
	

	
		
			org.springframework.ai
			spring-ai-starter-mcp-server-webflux
		
		
			org.projectlombok
			lombok
		

	
	
		
			
				org.springframework.ai
				spring-ai-bom
				${spring-ai.version}
				pom
				import
			
		
	

	
		
			
				org.springframework.boot
				spring-boot-maven-plugin
			
		
	
	
		
			Central Portal Snapshots
			central-portal-snapshots
			https://central.sonatype.com/repository/maven-snapshots/
			
				false
			
			
				true
			
		
		
			spring-milestones
			Spring Milestones
			https://repo.spring.io/libs-milestone-local
			
				false
			
		
		
			spring-snapshots
			Spring Snapshots
			https://repo.spring.io/snapshot
			
				false
			
		
	

`````
## yml参数说明
## 配置属性

所有属性都以 为前缀`spring.ai.mcp.server`：

| 参数                           | 描述                                                         | 默认           |
| :----------------------------- | :----------------------------------------------------------- | :------------- |
| `enabled`                      | 启用/禁用 MCP 服务器                                         | `true`         |
| `stdio`                        | 启用/禁用 stdio 传输                                         | `false`        |
| `name`                         | 用于识别的服务器名称                                         | `mcp-server`   |
| `version`                      | 服务器版本                                                   | `1.0.0`        |
| `type`                         | 服务器类型（同步/异步）                                      | `SYNC`         |
| `resource-change-notification` | 启用资源更改通知                                             | `true`         |
| `prompt-change-notification`   | 启用提示更改通知                                             | `true`         |
| `tool-change-notification`     | 启用工具更改通知                                             | `true`         |
| `tool-response-mime-type`      | （可选）每个工具名称的响应 MIME 类型。例如，将MIME 类型与工具名称`spring.ai.mcp.server.tool-response-mime-type.generateImage=image/png`关联`image/png``generateImage()` | `-`            |
| `sse-message-endpoint`         | 客户端用来发送消息的 Web 传输的自定义 SSE 消息端点路径       | `/mcp/message` |
| `sse-endpoint`                 | 用于 Web 传输的自定义 SSE 端点路径                           | `/sse`         |
| `base-url`                     | 可选 URL 前缀。例如，表示客户端应访问位于+ 的`base-url=/api/v1`SSE 端点，而消息端点位于+`/api/v1``sse-endpoint``/api/v1``sse-message-endpoint` | -              |
## 官方地址
```
https://docs.spring.io/spring-ai/reference/api/mcp/mcp-server-boot-starter-docs.html#_webflux_server_transport

```

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [chaozai0304](https://github.com/chaozai0304)
- **Source:** [chaozai0304/mcp-spring-ai-mcp-server](https://github.com/chaozai0304/mcp-spring-ai-mcp-server)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-chaozai0304-mcp-spring-ai-mcp-server
- Seller: https://agentstack.voostack.com/s/chaozai0304
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
