Skip to content

Commit 516d4de

Browse files
authored
Merge pull request #10 from weishuai8888/main
docs(core-architecture): 更新 MCP服务器示例代码
2 parents cebffb6 + d28bd2a commit 516d4de

File tree

3 files changed

+47
-37
lines changed

3 files changed

+47
-37
lines changed

content/docs/(get-started)/quick-start/client-developers.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: 客户端开发者
33
description: 快速开始 - 客户端开发者
44
---
5+
56
开始构建自己的客户端,可以与所有 MCP 服务器集成。
67

78
在本教程中,您将学习如何构建一个由 LLM 驱动、可连接 MCP 服务器的聊天机器人客户端。

content/docs/(get-started)/quick-start/server-developers.mdx

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
---
2+
title: 针对服务端开发人员
3+
description: 快速开始 - 针对服务端开发人员
4+
---
5+
16
# 针对服务端开发人员
27

38
> 开始构建自己的服务器,以便在Claude中用于Desktop和其他客户端
@@ -245,7 +250,7 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
245250

246251
例如,如果你有[VS Code](https://code.visualstudio.com/) 安装:
247252

248-
<Tabs>
253+
<Tabs items={['MacOS/Linux', 'Windows']}>
249254
<Tab title="MacOS/Linux">
250255
```bash
251256
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
@@ -262,21 +267,21 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
262267
然后,您将在“mcpServers”键中添加服务器。如果至少有一台服务器配置正确,MCP UI元素将仅显示在Claude for Desktop中。
263268
在这种情况下,我们将添加单个天气服务器,如下所示:
264269

265-
<Tabs>
270+
<Tabs items={['MacOS/Linux', 'Windows']}>
266271
<Tab title="MacOS/Linux">
267272
```json Python
268273
{
269274
"mcpServers": {
270-
"weather": {
271-
"command": "uv",
272-
"args": [
273-
"--directory",
274-
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather",
275-
"run",
276-
"weather.py"
277-
]
278-
}
279-
}
275+
"weather": {
276+
"command": "uv",
277+
"args": [
278+
"--directory",
279+
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather",
280+
"run",
281+
"weather.py"
282+
]
283+
}
284+
}
280285
}
281286
```
282287
</Tab>
@@ -285,16 +290,16 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
285290
```json Python
286291
{
287292
"mcpServers": {
288-
"weather": {
289-
"command": "uv",
290-
"args": [
291-
"--directory",
292-
"C:\\ABSOLUTE\\PATH\\TO\\PARENT\\FOLDER\\weather",
293-
"run",
294-
"weather.py"
295-
]
296-
}
297-
}
293+
"weather": {
294+
"command": "uv",
295+
"args": [
296+
"--directory",
297+
"C:\\ABSOLUTE\\PATH\\TO\\PARENT\\FOLDER\\weather",
298+
"run",
299+
"weather.py"
300+
]
301+
}
302+
}
298303
}
299304
```
300305
</Tab>
@@ -689,7 +694,7 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
689694

690695
例如,如果你有安装 [VS Code](https://code.visualstudio.com/) :
691696

692-
<Tabs>
697+
<Tabs items={['MacOS/Linux', 'Windows']}>
693698
<Tab title="MacOS/Linux">
694699
```bash
695700
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
@@ -707,19 +712,19 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
707712

708713
在这种情况下,我们将添加单个天气服务器,如下所示:
709714

710-
<Tabs>
715+
<Tabs items={['MacOS/Linux', 'Windows']}>
711716
<Tab title="MacOS/Linux">
712717
<CodeGroup>
713718
```json Node
714719
{
715720
"mcpServers": {
716-
"weather": {
717-
"command": "node",
718-
"args": [
719-
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather/build/index.js"
720-
]
721-
}
722-
}
721+
"weather": {
722+
"command": "node",
723+
"args": [
724+
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather/build/index.js"
725+
]
726+
}
727+
}
723728
}
724729
```
725730
</CodeGroup>
@@ -774,7 +779,7 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
774779

775780
您需要添加以下依赖项:
776781

777-
<Tabs>
782+
<Tabs items={['Maven', 'Gradle']}>
778783
<Tab title="Maven">
779784
```xml
780785
<dependencies>
@@ -922,7 +927,7 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
922927

923928
例如,如果你已经安装[VS Code](https://code.visualstudio.com/):
924929

925-
<Tabs>
930+
<Tabs items={['MacOS/Linux', 'Windows']}>
926931
<Tab title="MacOS/Linux">
927932
```bash
928933
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
@@ -941,7 +946,7 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
941946
在这种情况下,我们将添加单个天气服务器,如下所示:
942947

943948

944-
<Tabs>
949+
<Tabs items={['MacOS/Linux', 'Windows']}>
945950
<Tab title="MacOS/Linux">
946951
```json java
947952
{
@@ -1593,7 +1598,7 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
15931598
例如,如果你有[VS代码](https://code.visualstudio.com/)已安装:
15941599

15951600

1596-
<Tabs>
1601+
<Tabs items={['MacOS/Linux', 'Windows']}>
15971602
<Tab title="MacOS/Linux">
15981603
```bash
15991604
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
@@ -1610,7 +1615,7 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
16101615
然后,您将在`mcpServers`键中添加服务器。如果至少有一台服务器配置正确,MCP UI元素将仅显示在Claude for Desktop中。
16111616
在这种情况下,我们将添加单个天气服务器,如下所示:
16121617

1613-
<Tabs>
1618+
<Tabs items={['MacOS/Linux', 'Windows']}>
16141619
<Tab title="MacOS/Linux">
16151620
```json
16161621
{

content/docs/concepts/core-architecture.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: 核心架构
3+
---
4+
15
# 核心架构
26

37
> 了解 MCP 如何连接客户端、服务器和 LLM
@@ -189,7 +193,7 @@ SDK 和应用程序可以定义自己的 -32000 以上的错误代码。
189193

190194
以下是实现 MCP 服务器的一个基本示例:
191195

192-
<Tabs>
196+
<Tabs items={['TypeScript', 'Python']}>
193197
<Tab title="TypeScript">
194198
```typescript
195199
import { Server } from "@modelcontextprotocol/sdk/server/index.js";

0 commit comments

Comments
 (0)