Netbird MCP 服务器
该项目源自 Grafana Labs 的Grafana MCP 服务器,并根据相同的 Apache License 2.0 获得许可。
它还使用 Mark III Labs 的MCP Go 。
注意:该项目仍在开发中。
安装
从源代码安装
克隆存储库
构建和安装
从 GitHub 安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 Netbird MCP 服务器:
配置
服务器需要以下环境变量:
NETBIRD_API_TOKEN
:您的 Netbird API 令牌NETBIRD_HOST
(可选):Netbird API 主机(默认为api.netbird.io
)
特征
此服务器使用 Netbird API 向 LLM 提供有关 Netbird 网络的信息。目前,部分只读 Netbird API 资源与工具之间保持 1:1 映射。
- [x] 使用 Netbird API 访问配置和状态
- [x] 可配置的 API 端点
- [x] Netbird API 的安全基于令牌的身份验证
工具
工具 | 描述 | Netbird API |
---|---|---|
list_netbird_peers | 所有同行 | 列出所有同行 |
list_netbird_port_allocations | peerId 的所有入口端口 | 列出所有端口分配 |
list_netbird_groups | 所有群组 | 列出所有组 |
list_netbird_policies | 所有政策 | 列出所有政策 |
list_netbird_posture_checks | 所有姿势检查 | 列出所有姿势检查 |
list_netbird_networks | 所有网络 | 列出所有网络 |
list_netbird_nameservers | 所有名称服务器组 | 列出所有名称服务器组 |
添加工具
要添加新工具:
- 在
tools
中创建一个新文件(例如tools/users.go
),可能使用现有代码作为模板 - 将 API 路由和响应细节添加到新文件
- 将工具添加到
cmd/main.go
中的func newServer()
用法
- 从 Netbird 管理控制台获取您的Netbird API 令牌。
- 使用上述安装方法之一安装
mcp-netbird
二进制文件。确保该二进制文件位于你的 PATH 中。 - 将服务器配置添加到客户端配置文件中。例如,对于 Codeium Windsurf,将以下内容添加到
~/.codeium/windsurf/mcp_config.json
:
有关如何向 Claude Desktop 添加类似配置的更多信息,请参见此处。
注意:如果您在 Claude Desktop 日志中看到类似
[netbird] [error] spawn mcp-netbird ENOENT
的内容,则需要指定mcp-netbird
的完整路径。在 macOS 上,Claude 日志位于~/Library/Logs/Claude
。
- 尝试问类似这样的问题:“您能向我解释一下我的 Netbird 同伴、群组和政策吗?”
Docker
构建图像并标记:
运行图像:
ToolHive
ToolHive (thv) 是一款轻量级实用程序,旨在简化 MCP 服务器的部署和管理。
您可以使用 ToolHive 部署并运行 Netbird MCP,如下所示:
- 按照ToolHive README中的说明安装
thv
。 - 将 Netbird API 令牌添加到
thv
机密中:
- 按照上面Docker 部分所述构建 SSE 镜像
- 启动 Netbird MCP 并在端口 8080 上
thv run
:
- 当你想停止服务器时,使用:
发展
欢迎贡献代码!如果您有任何建议或改进,请提交 issue 或 pull request。
该项目使用 Go 语言编写。请按照您平台的说明安装 Go。
要手动运行服务器,请使用:
或者在 SSE 模式下:
调试
MCP Inspector是一款用于测试和调试 MCP 服务器的交互式开发者工具。点击此处了解更多信息。
启动 MCP 检查器的方法如下:
Netbird MCP 服务器可以使用stdio
或SSE
传输类型进行测试。对于stdio
请在 UI 中指定mcp-netbird
的完整路径。
测试
TODO:添加更多测试
代码检查
要检查代码,请运行:
执照
该项目采用Apache 许可证 2.0 版授权。
该项目包括在 Grafana Labs ( https://grafana.com/ ) 开发的软件。
该项目包括在 Mark III Labs 开发的软件( https://github.com/mark3labs/mcp-go )。
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Netbird 的 MCP 服务器
Related MCP Servers
- -securityAlicense-qualityMarineTraffic MCP ServerLast updated -4TypeScriptMIT License
- TypeScriptMIT License
- PythonApache 2.0
- PythonMIT License