by aantti
mcp-netbird is a Model Context Protocol (MCP) server for Netbird, enabling Large Language Models (LLMs) to interact with and retrieve information about Netbird network configurations and status.
mcp-netbird is an MCP (Model Context Protocol) server designed to integrate Netbird network data with Large Language Models (LLMs). It acts as a bridge, allowing LLMs to query and understand various aspects of a Netbird network, such as peers, groups, policies, and more, by leveraging the Netbird API.
Installation:
make install
.go install github.com/aantti/mcp-netbird/cmd/mcp-netbird@latest
.npx -y @smithery/cli install @aantti/mcp-netbird --client claude
for automatic installation with Claude Desktop.Configuration:
Set the NETBIRD_API_TOKEN
environment variable with your Netbird API token. Optionally, set NETBIRD_HOST
if your Netbird API host is not api.netbird.io
.
Integration with LLM Clients (e.g., Claude Desktop):
mcp-netbird
binary.~/.codeium/windsurf/mcp_config.json
for Codeium Windsurf) to include mcp-netbird
as an MCP server, providing the command and environment variables (especially NETBIRD_API_TOKEN
).Docker:
Build and run a Docker image using the provided Dockerfile.sse
.
ToolHive:
Deploy and manage mcp-netbird
using ToolHive (thv
) for simplified deployment and secret management.
tools
directory and updating func newServer()
.Q: Is mcp-netbird
still in development?
A: Yes, the project is still under active development.
Q: What environment variables are required?
A: NETBIRD_API_TOKEN
is required. NETBIRD_HOST
is optional.
Q: How can I debug mcp-netbird
?
A: You can use the MCP Inspector, an interactive developer tool, by running npx @modelcontextprotocol/inspector
and configuring it to connect to your mcp-netbird
instance.
Q: How can I contribute to mcp-netbird
?
A: Contributions are welcome! You can open an issue or submit a pull request. The project is written in Go.
A Model Context Protocol (MCP) server for Netbird.
This project is derived from the MCP Server for Grafana by Grafana Labs and is licensed under the same Apache License 2.0.
It also uses MCP Go by Mark III Labs.
Note: this project is still in development.
git clone https://github.com/aantti/mcp-netbird
cd mcp-netbird && \
make install
go install github.com/aantti/mcp-netbird/cmd/mcp-netbird@latest
To install Netbird MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @aantti/mcp-netbird --client claude
The server requires the following environment variables:
NETBIRD_API_TOKEN
: Your Netbird API tokenNETBIRD_HOST
(optional): The Netbird API host (default is api.netbird.io
)This server uses the Netbird API to provide LLMs information about Netbird network. Currently it's a 1:1 mapping of select read-only Netbird API resources to tools.
Tool | Description | Netbird API |
---|---|---|
list_netbird_peers |
All peers | List all Peers |
list_netbird_port_allocations |
All ingress ports for peerId |
List all Port Allocations |
list_netbird_groups |
All groups | List all Groups |
list_netbird_policies |
All policies | List all Policies |
list_netbird_posture_checks |
All posture checks | List all Posture Checks |
list_netbird_networks |
All networks | List all Networks |
list_netbird_nameservers |
All nameserver groups | List all Nameserver Groups |
To add new tools:
tools
(e.g., tools/users.go
), possibly use existing code as a templatefunc newServer()
in cmd/main.go
Get your Netbird API token from the Netbird management console.
Install the mcp-netbird
binary using one of the installation methods above. Make sure the binary is in your PATH.
Add the server configuration to your client configuration file. E.g., for Codeium Windsurf add the following to ~/.codeium/windsurf/mcp_config.json
:
{
"mcpServers": {
"netbird": {
"command": "mcp-netbird",
"args": [],
"env": {
"NETBIRD_API_TOKEN": "<your-api-token>"
}
}
}
}
For more information on how to add a similar configuration to Claude Desktop, see here.
Note: if you see something along the lines of
[netbird] [error] spawn mcp-netbird ENOENT
in Claude Desktop logs, you need to specify the full path tomcp-netbird
. On macOS Claude Logs are in~/Library/Logs/Claude
.
Build an image and tag it:
docker build -t mcp-netbird-sse:v1 -f Dockerfile.sse .
Run the image:
docker run --name mcp-netbird -p 8001:8001 -e NETBIRD_API_TOKEN=<your-api-token> mcp-netbird-sse:v1
ToolHive (thv) is a lightweight utility designed to simplify the deployment and management of MCP servers.
You can use ToolHive to deploy and run Netbird MCP as follows:
Install thv
as described in ToolHive README.
Add Netbird API token to thv
secrets:
thv secret set netbird
Build an SSE image as described in the Docker section above
Start Netbird MCP with thv run
on port 8080:
thv run --secret netbird,target=NETBIRD_API_TOKEN --transport sse --name thv-mcp-netbird --port 8080 --target-port 8001 mcp-netbird-sse:v1
thv stop thv-mcp-netbird
Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.
This project is written in Go. Install Go following the instructions for your platform.
To run the server manually, use:
export NETBIRD_API_TOKEN=your-token && \
go run cmd/mcp-netbird/main.go
Or in SSE mode:
export NETBIRD_API_TOKEN=your-token && \
go run cmd/mcp-netbird/main.go --transport sse --sse-address :8001
The MCP Inspector is an interactive developer tool for testing and debugging MCP servers. Read more about it here.
Here's how to start the MCP Inspector:
export NETBIRD_API_TOKEN=your-token && \
npx @modelcontextprotocol/inspector
Netbird MCP Server can then be tested with either stdio
or SSE
transport type. For stdio
specify the full path to mcp-netbird
in the UI.
TODO: add more tests
To lint the code, run:
make lint
This project is licensed under the Apache License, Version 2.0.
This project includes software developed at Grafana Labs (https://grafana.com/).
This project includes software developed at Mark III Labs (https://github.com/mark3labs/mcp-go).
Please log in to share your review and rating for this MCP.