网络助手——面向网络工程师的MCP服务器
该项目设立了一个 模型上下文协议(MCP) 专为 网络工程师.\
它允许Claude for Desktop(或其他LLM客户端)通过 tools 原始。
🧠 预备知识
本快速入门假定您熟悉:
- python
- 像克劳德这样的法学硕士
💻 系统要求
- python 3.10或更高
- MCP Python SDK v1.2.0或更新版本
⚙️ 设置您的环境
1.安装 uv
MacOS/Linux:```
brew install uv
> 🔁 重新启动终端以确保 `uv` 命令可用。
### 2.设置您的项目```
uv init
uv venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
uv add "mcp[cli]"
▶️ 运行您的服务器```
python network-assistant.py
这将通过以下方式启动您的MCP服务器 `stdio`,准备连接到克劳德。
## 🧪 使用Claude进行桌面测试
> Claude for Desktop目前仅在macOS和Windows上可用。
1. 下载克劳德桌面版 这里.
1. 打开您的Claude Desktop应用程序。
1. 在以下位置配置MCP服务器:
- `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
- `C:\Users\\AppData\Roaming\Claude\claude_desktop_config.json` (Windows)
配置示例:```
{
"mcpServers": {
"network": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/network-assistant",
"run",
"network_assistant.py"
]
}
}
}
> 使用 which uv (macOS/Linux)或 where uv (Windows)获取路径 uv 如果需要的话。
保存配置文件后重新启动Claude Desktop。
🔨 Claude提供的工具
点击🛠 克劳德的锤子图标。您应该看到:
get_network_standards()get_device_status(device_name)
现在问克劳德:- What routing protocols do we use in our network?
- What is the current status of my network devices?
- What is the status of all devices in the network?
🔍 幕后发生了什么?
- Claude解析您的提示并找到相关工具。
- 它召唤
get_network_standards()或get_device_status()通过MCP。 - 您的服务器执行工具逻辑并返回结构化数据。
- Claude使用您的实际上下文进行回应
