@@ -14,9 +14,9 @@ description: 快速开始 - 服务器开发者
1414![ ImaImageZoomge] ( /server-developers-01.png )
1515![ ImaImageZoomge] ( /server-developers-02.png )
1616
17- ```
17+
1818服务可以连接任何客户端。为了简单起见,我们在这里选择了Claude作为桌面,但我们也有关于[ 建立自己的client] ( https://mcp.thinkinai.xyz/docs/quick-start/client-developers ) 建立自己的client的指南,以及[ 这里的其他客户列表] ( https://mcp.thinkinai.xyz/docs/example-clients ) 。
19- ```
19+
2020
2121```
2222为什么选择Claude for DeskTop而不是Claude.ai?
@@ -28,4 +28,84 @@ MCP服务器可以提供三种主要功能:
2828 1. ** Resources** :客户端可以读取的类文件数据(如API响应或文件内容)
2929 2. ** Tools** :LLM可以调用的函数(经用户批准)
3030 3. ** Prompts** :帮助用户完成特定任务的预先编写的模板
31- 本教程将主要关注工具。
31+ 本教程将主要关注工具。
32+
33+ ### 基于Java
34+ 这是一个基于Spring AI MCP自动配置和引导启动器的快速入门演示。要了解如何手动创建同步和异步MCP服务器,请参阅[ Java SDK服务器] ( https://modelcontextprotocol.io/sdk/java/mcp-server ) 文档。
35+ 让我们开始构建一个天气服务!
36+ ● [ 你可以在这里找到我们将要构建的完整代码] ( https://github.com/spring-projects/spring-ai-examples/tree/main/model-context-protocol/weather/starter-stdio-server ) 【MCP官方代码,支持查询美国天气情况】。
37+ ● [ 这里的代码也可以] ( https://github.com/weishuai8888/spring-ai-examples ) 【fork官方代码后调整了逻辑,支持查询全世界的天气情况】
38+ 有关更多信息,请参阅[ MCP Server Boot Starter] ( https://docs.spring.io/spring-ai/reference/api/mcp/mcp-server-boot-starter-docs.html ) 参考文档。有关手动MCP服务器实现,请参阅[ MCP Server Java SDK文档] ( https://modelcontextprotocol.io/sdk/java/mcp-server ) 。
39+
40+ #### 系统要求
41+ ~
42+ ● 已安装Java 17或更高版本
43+ ● [ Spring Boot 3.3.x] ( https://docs.spring.io/spring-boot/installing.html ) 或更高版本
44+
45+ #### 设置你的环境变量
46+ 使用 [ Spring Initizer] ( https://start.spring.io ) 启动项目。
47+ 你需要添加以下的依赖项:
48+ <Tabs items = { [' Maven' , ' Gradle' ]} >
49+ <Tab value = " Maven" >
50+ ``` xml
51+ <dependencies >
52+ <dependency >
53+ <groupId >org.springframework.ai</groupId >
54+ <artifactId >spring-ai-starter-mcp-server</artifactId >
55+ </dependency >
56+
57+ <dependency >
58+ <groupId >org.springframework</groupId >
59+ <artifactId >spring-web</artifactId >
60+ </dependency >
61+ </dependencies >
62+ ```
63+ </Tab >
64+ <Tab value = ' Gradle' >
65+ ``` xml
66+ dependencies {
67+ implementation platform("org.springframework.ai:spring-ai-starter-mcp-server")
68+ implementation platform("org.springframework:spring-web")
69+ }
70+ ```
71+ </Tab >
72+ </Tabs >
73+
74+ 然后通过设置应用程序属性来配置应用程序
75+ <Tabs items = { [' application.yml' , ' application.properties' ]} >
76+ <Tab value = " application.yml" >
77+ ``` yaml
78+ logging :
79+ pattern :
80+ console :
81+ spring :
82+ main :
83+ banner-mode : off
84+ ` ` `
85+ </Tab>
86+ <Tab value="application.properties">
87+ ` ` ` properties
88+ logging.pattern.console=
89+ spring.main.banner-mode=off
90+ ```
91+ </Tab >
92+ </Tabs >
93+
94+ [ 服务器配置属性] ( https://docs.spring.io/spring-ai/reference/api/mcp/mcp-server-boot-starter-docs.html#_configuration_properties ) 记录了所有可用的属性。现在,让我们开始构建您的服务器。
95+
96+ # 构建你的服务器
97+ ## 天气服务
98+
99+
100+
101+
102+
103+
104+
105+
106+
107+
108+
109+
110+
111+
0 commit comments