Skip to content

Commit bde17d7

Browse files
vera-qwangCopilot
andauthored
feat: update nacos-gateway-mcp.md with SAA Distributed MCP Client usage (#271)
* feat: update nacos-gateway-mcp.md with SAA Distributed MCP Client usage (spring-ai-alibaba/spring-ai-extensions#132) * fix: markdown lint errors * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: github action eslint not found error * chore(docs): add missed ignored words to codespell config * fix(docs): resolve broken links in versions page --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7e7d4f0 commit bde17d7

10 files changed

Lines changed: 90 additions & 35 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
- name: Lint Checks
2222
run: |
2323
make install-tools
24+
make install
2425
make lint
2526
build:
2627
name: Build

blog/saa-agentscope-announcement.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
Spring AI 的核心目标是连接企业的数据和 API 与 AI 模型,简化 AI 集成。包含模型接入、函数调用、MCP 调用和发现、对话记忆和 RAG、可观测等功能。Spring AI Alibaba 在其基础之上做了非常多的探索,包括:
1616

17-
* Spring AI Extensions:将 Spring AI 的能力和阿里云的模型、工具、RAG、异步消息、网关、可观测等云原生基础设施进行了适配,并提供了最佳实践。
17+
* Spring AI Extensions:将 Spring AI 的能力和阿里云的模型、工具、RAG、异步消息、网关、可观测等云原生基础设施进行了适配,并提供了最佳实践。
1818

19-
* Spring AI Alibaba Graph:提供 Agentic、Multi-Agent 编排能力,包括 SupervisorAgent、SequentialAgent、LoopAgent 等,内置上下文工程、Human In The Loop 等核心能力。
19+
* Spring AI Alibaba Graph:提供 Agentic、Multi-Agent 编排能力,包括 SupervisorAgent、SequentialAgent、LoopAgent 等,内置上下文工程、Human In The Loop 等核心能力。
2020

21-
* Spring AI Alibaba Graph:侧重 Workflow 形态的工作流编排,在很多企业级业务场景实现了规模化落地。
21+
* Spring AI Alibaba Graph:侧重 Workflow 形态的工作流编排,在很多企业级业务场景实现了规模化落地。
2222

23-
* Spring AI Alibaba Admin:是我们在 Agent 开发提效方面的一类探索,包含了提示词维护、可观测、评估,其中,提示词维护是基于 Nacos,可观测能力建设则是基于 LoongSuite。
23+
* Spring AI Alibaba Admin:是我们在 Agent 开发提效方面的一类探索,包含了提示词维护、可观测、评估,其中,提示词维护是基于 Nacos,可观测能力建设则是基于 LoongSuite。
2424

2525
在开源的过程中,我们逐步观察到,开放框架呈现出两种不同的发展趋势。一种是以 Spring AI Alibaba 为代表的,以 Graph 为核心设计理念的应用框架,强调工作流编排在 AI 应用开发过程中的重要性。一种是 AgentScope 为代表的,以 Agentic 为核心设计理念的应用框架,最大化利用基础大模型的能力。
2626

@@ -32,14 +32,13 @@ Spring AI 的核心目标是连接企业的数据和 API 与 AI 模型,
3232

3333
AgentScope 是由阿里巴巴通义实验室在2024年2月开源的多智能体开发框架,旨在为开发者提供一种简单、高效、可扩展的方式来构建基于大语言模型的智能体应用。AgentScope 的架构主要包括三层:核心框架 (Agent 构建与编排)、Runtime (安全运行时)、Studio (可视化监控与评估)。AgentScope 拥有强大的算法和工程团队,面向全球开发者提供开源服务。其中,截止v1.0.7,核心框架仓库已发布21个版本,获得1.5w star。
3434

35-
* GitHub:[https://github.com/agentscope-ai/](https://github.com/agentscope-ai/agentscope)
35+
* GitHub:[https://github.com/agentscope-ai/](https://github.com/agentscope-ai/agentscope)
3636

37-
* 官网:[https://agentscope.io/](https://agentscope.io/)
37+
* 官网:[https://agentscope.io/](https://agentscope.io/)
3838

39-
* Disord:[https://discord.gg/Rnf2JCSKZp](https://discord.gg/Rnf2JCSKZp)
40-
41-
* 钉钉群:105130040570
39+
* Disord:[https://discord.gg/Rnf2JCSKZp](https://discord.gg/Rnf2JCSKZp)
4240

41+
* 钉钉群:105130040570
4342

4443
AgentScope-Java 是我们和 AgentScope 共同推出的面向 Java 开发群体智能体开发框架,同时共享以上社区资源,Java 开发者们若遇到使用问题,可以通过以上方式联系到我们。
4544

@@ -61,11 +60,11 @@ AgentScope 是一个以 Agentic 为核心设计理念的应用框架,提供
6160

6261
是的,会持续投入的。主要体现在以下两个方向:
6362

64-
* 跟进 Spring AI 的演进,持续发版解决企业应用过程中遇到的问题。
63+
* 跟进 Spring AI 的演进,持续发版解决企业应用过程中遇到的问题。
6564

66-
* 对底层进行升级,支持 AgentScope,做好阿里云、AgentScope 与 Spring 生态连接,提供企业级智能体解决方案。
65+
* 对底层进行升级,支持 AgentScope,做好阿里云、AgentScope 与 Spring 生态连接,提供企业级智能体解决方案。
6766

68-
* 全面升级 Admin 平台,打造企业级 Agent 构建与交付平台。
67+
* 全面升级 Admin 平台,打造企业级 Agent 构建与交付平台。
6968

7069
![admin](/img/blog/saa-agentscope/img_4.png)
7170

@@ -77,4 +76,4 @@ AgentScope Java 自 2025 年 9 月开源([https://github.com/agentscope-
7776

7877
在技术演进层面,我们正持续探索更高效、智能的上下文工程与多 Agent 协同范式,致力于支撑更强大的 AI 应用构建。 此外,针对 Agent 流量呈现的“二八定律”特征(头部 20% 的 Agent 承载了 80% 的流量),我们在架构上全力推进 Serverless 化,通过实现毫秒级冷启动与混合部署,帮助开发者在应对高并发的同时,显著降低部署成本并提升效率。
7978

80-
![admin](/img/blog/saa-agentscope/img_5.png)
79+
![admin](/img/blog/saa-agentscope/img_5.png)

docs/versions.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ keywords: [版本, versions, releases, Spring AI Alibaba, Spring AI 版本适配
3636
<type>pom</type>
3737
<scope>import</scope>
3838
</dependency>
39-
<dependency>
40-
<groupId>org.springframework.ai</groupId>
41-
<artifactId>spring-ai-bom</artifactId>
42-
<version>1.1.2</version>
43-
<type>pom</type>
44-
<scope>import</scope>
45-
</dependency>
46-
<dependency>
47-
<groupId>com.alibaba.cloud.ai</groupId>
48-
<artifactId>spring-ai-alibaba-extensions-bom</artifactId>
49-
<version>1.1.2.1</version>
50-
<type>pom</type>
51-
<scope>import</scope>
52-
</dependency>
39+
<dependency>
40+
<groupId>org.springframework.ai</groupId>
41+
<artifactId>spring-ai-bom</artifactId>
42+
<version>1.1.2</version>
43+
<type>pom</type>
44+
<scope>import</scope>
45+
</dependency>
46+
<dependency>
47+
<groupId>com.alibaba.cloud.ai</groupId>
48+
<artifactId>spring-ai-alibaba-extensions-bom</artifactId>
49+
<version>1.1.2.1</version>
50+
<type>pom</type>
51+
<scope>import</scope>
52+
</dependency>
5353
</dependencyManagement>
5454

5555
<dependencies>
@@ -58,11 +58,12 @@ keywords: [版本, versions, releases, Spring AI Alibaba, Spring AI 版本适配
5858
<artifactId>spring-ai-alibaba-agent-framework</artifactId>
5959
</dependency>
6060
<dependency>
61-
<groupId>com.alibaba.cloud.ai</groupId>
62-
<artifactId>spring-ai-alibaba-starter-dashscope</artifactId>
63-
</dependency>
61+
<groupId>com.alibaba.cloud.ai</groupId>
62+
<artifactId>spring-ai-alibaba-starter-dashscope</artifactId>
63+
</dependency>
6464
</dependencies>
6565
```
66+
6667
---
6768

6869
## 组件与生态版本
@@ -115,11 +116,11 @@ keywords: [版本, versions, releases, Spring AI Alibaba, Spring AI 版本适配
115116
|------|-------------|------|
116117
| **入门** | [概览](overview.md) | 项目定位、架构、核心能力与安装方式 |
117118
| | [快速开始](quick-start.md) | 从零搭建 ReactAgent,含环境、依赖、API Key、示例代码 |
118-
| **Agent 框架教程** | [frameworks/agent-framework/tutorials/](frameworks/agent-framework/tutorials/) | Agents、Models、Tools、Hooks、Memory、Messages、Skills、Structured Output 等 |
119-
| **Agent 框架进阶** | [frameworks/agent-framework/advanced/](frameworks/agent-framework/advanced/) | RAG、多智能体、人机协同、上下文工程、A2A、Workflow 等 |
119+
| **Agent 框架教程** | [frameworks/agent-framework/tutorials/](frameworks/agent-framework/tutorials/agents.md) | Agents、Models、Tools、Hooks、Memory、Messages、Skills、Structured Output 等 |
120+
| **Agent 框架进阶** | [frameworks/agent-framework/advanced/](frameworks/agent-framework/advanced/context-engineering.md) | RAG、多智能体、人机协同、上下文工程、A2A、Workflow 等 |
120121
| **Graph 核心** | [frameworks/graph-core/quick-start.md](frameworks/graph-core/quick-start.md) | Graph 快速上手 |
121-
| | [frameworks/graph-core/core/](frameworks/graph-core/core/) | 核心库、持久化、内存、流式等 |
122-
| | [frameworks/graph-core/examples/](frameworks/graph-core/examples/) | 子图、并行、取消、MCP、持久化、人机协同等示例 |
122+
| | [frameworks/graph-core/core/](frameworks/graph-core/core/core-library.md) | 核心库、持久化、内存、流式等 |
123+
| | [frameworks/graph-core/examples/](frameworks/graph-core/examples/llm-streaming-springai.md) | 子图、并行、取消、MCP、持久化、人机协同等示例 |
123124
| **Studio** | [frameworks/studio/quick-start.md](frameworks/studio/quick-start.md) | Studio 嵌入式调试与使用 |
124125

125126
---

integration/mcps/nacos/nacos-gateway-mcp.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,43 @@ _ _streamable-http:
6969
- 根据 restful 接口响应,选择响应模版
7070
![nacos-gateway-1](/img/blog/extensions/mcp/nacos-gateway-1.png)
7171
72+
### 使用SAA Distributed MCP Client连接
73+
74+
使用`spring-ai-alibaba-starter-mcp-distributed`的客户端连接需要依赖nacos中注册的服务信息,由于存量转换类型的MCP在nacos中维护的服务信息是对应的 restful 服务而不是mcp服务,因此无法直接通过在Distributed MCP Client中配置这个存量服务进行连接,而是需要连接到gateway。
75+
76+
需要注意gateway模块默认不会注册为nacos的mcp服务和实例,因此需要将gateway注册为nacos的MCP服务。注册方式为在gateway项目的`pom.xml`中引入`spring-ai-alibaba-starter-mcp-registry`依赖。
77+
```xml
78+
<dependency>
79+
<groupId>com.alibaba.cloud.ai</groupId>
80+
<artifactId>spring-ai-alibaba-starter-mcp-registry</artifactId>
81+
<version>${spring-ai-extensions.version}</version>
82+
</dependency>
83+
```
84+
85+
同时需要修改`application.yml`配置文件,在spring.ai.alibaba.mcp.nacos下新增register配置项
86+
```yaml
87+
spring:
88+
ai:
89+
alibaba:
90+
# MCP Gateway 配置
91+
mcp:
92+
gateway:
93+
...
94+
# Nacos 注册中心配置
95+
nacos:
96+
server-addr: localhost:8848
97+
namespace: public
98+
username: nacos
99+
password: nacos
100+
register:
101+
enabled: true
102+
service-group: mcp-server ## 指定分组名称
103+
service-name: mcp-nacos-gateway-example ## 指定服务名称
104+
```
105+
72106
## 验证
73107

108+
### 使用普通MCP Client
74109
启动 gateway 服务,我们发现 restful 服务的工具已经被添加了
75110

76111
![nacos-gateway-2](/img/blog/extensions/mcp/nacos-gateway-2.png)
@@ -86,3 +121,19 @@ Gateway 被触发调用 restful 服务
86121
restful 接收请求
87122

88123
![nacos-gateway-5](/img/blog/extensions/mcp/nacos-gateway-5.png)
124+
125+
### 使用SAA Distributed MCP Client
126+
127+
启动gateway服务,可以看到gateway已经通过registry模块自动注册为nacos服务,endpoint 信息也已经正确注册
128+
129+
![nacos-gateway-registry-nacos-1](/img/blog/extensions/mcp/nacos-gateway-registry-nacos-1.png)
130+
![nacos-gateway-registry-nacos-2](/img/blog/extensions/mcp/nacos-gateway-registry-nacos-2.png)
131+
132+
启动一个Distributed MCP Client 连接 Gateway 提供的 MCP 服务,触发时间工具
133+
134+
![nacos-gateway-6](/img/blog/extensions/mcp/nacos-gateway-6.png)
135+
136+
Gateway 被触发调用 restful 服务
137+
138+
![nacos-gateway-7](/img/blog/extensions/mcp/nacos-gateway-7.png)
139+
597 KB
Loading
799 KB
Loading
239 KB
Loading
937 KB
Loading

tools/linter/codespell/.codespell.ignorewords

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ exmaple
55
ois
66
dialin
77
NIN
8+
9+
nin
10+
toi

tools/make/Makefile.core.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ checklinks: ## Check for broken links in the docs
101101

102102
.PHONY: lint
103103
lint: ## Run all lint checks
104-
lint: markdown yamllint npm-lint pangu-lint yamllint codespell
104+
lint: markdown yamllint npm-lint pangu-lint codespell
105105
@echo "All lint checks passed!"
106106

107107
.PHONY: npm-lint

0 commit comments

Comments
 (0)