Skip to content

Commit 8c5182e

Browse files
authored
Update README_zh-CN.md
1 parent 1923b5a commit 8c5182e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README_zh-CN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
uv add fastapi-mcp
3232
```
3333

34-
或者,您可以使用pip安装
34+
或者,您可以使用 pip 安装
3535

3636
```bash
3737
pip install fastapi-mcp
@@ -62,7 +62,7 @@ mcp.mount()
6262

6363
就是这样!您的自动生成的 MCP 服务器现在可以在 `https://app.base.url/mcp` 访问。
6464

65-
> **关于`base_url`的注意事项**:虽然`base_url`是可选的,但强烈建议您明确提供它。`base_url` 告诉 MCP 服务器在调用工具时向何处发送 API 请求。如果不提供,库将尝试自动确定URL,这在部署环境中内部和外部 URL 不同时可能无法正确工作。
65+
> **关于`base_url`的注意事项**:虽然`base_url`是可选的,但强烈建议您明确提供它。`base_url` 告诉 MCP 服务器在调用工具时向何处发送 API 请求。如果不提供,库将尝试自动确定 URL,这在部署环境中内部和外部 URL 不同时可能无法正确工作。
6666
6767
## 工具命名
6868

@@ -76,15 +76,15 @@ FastAPI-MCP 使用 FastAPI 路由中的`operation_id`作为 MCP 工具的名称
7676
async def read_user(user_id: int):
7777
return {"user_id": user_id}
7878

79-
# 显式operation_id(工具将被命名为 "get_user_info")
79+
# 显式 operation_id(工具将被命名为 "get_user_info")
8080
@app.get("/users/{user_id}", operation_id="get_user_info")
8181
async def read_user(user_id: int):
8282
return {"user_id": user_id}
8383
```
8484

8585
为了获得更清晰、更直观的工具名称,我们建议在 FastAPI 路由定义中添加显式的`operation_id`参数。
8686

87-
要了解更多信息,请阅读 FastAPI 官方文档中关于 [路径操作的高级配置](https://fastapi.tiangolo.com/advanced/path-operation-advanced-configuration/)的部分。
87+
要了解更多信息,请阅读 FastAPI 官方文档中关于 [路径操作的高级配置](https://fastapi.tiangolo.com/advanced/path-operation-advanced-configuration/) 的部分。
8888

8989
## 高级用法
9090

@@ -179,7 +179,7 @@ mcp_app = FastAPI()
179179
# 从 API 应用创建 MCP 服务器
180180
mcp = FastApiMCP(
181181
api_app,
182-
base_url="http://api-host:8001", # API应用将运行的URL
182+
base_url="http://api-host:8001", # API 应用将运行的 URL
183183
)
184184

185185
# 将 MCP 服务器挂载到单独的应用

0 commit comments

Comments
 (0)