Cover image
Try Now
2025-04-13

MCP Server for Netbird

3 years

Works with Finder

1

Github Watches

0

Github Forks

26

Github Stars

Netbird MCP Server

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.

Installing

Installing from source

Clone the repository

git clone https://github.com/aantti/mcp-netbird

Build and install

cd mcp-netbird && \
make install

Installing from GitHub

go install github.com/aantti/mcp-netbird/cmd/mcp-netbird@latest

Installing via Smithery

smithery badge

To install Netbird MCP Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @aantti/mcp-netbird --client claude

Configuration

The server requires the following environment variables:

  • NETBIRD_API_TOKEN: Your Netbird API token
  • NETBIRD_HOST (optional): The Netbird API host (default is api.netbird.io)

Features

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.

  • Uses Netbird API to access configuration and status
  • Configurable API endpoint
  • Secure token-based authentication for Netbird API

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

Adding tools

To add new tools:

  1. Create a new file in tools (e.g., tools/users.go), possibly use existing code as a template
  2. Add API route and response specifics to the new file
  3. Add the tool to func newServer() in cmd/main.go

Usage

  1. Get your Netbird API token from the Netbird management console.

  2. Install the mcp-netbird binary using one of the installation methods above. Make sure the binary is in your PATH.

  3. 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 to mcp-netbird. On macOS Claude Logs are in ~/Library/Logs/Claude.

  1. Try asking questions along the lines of "Can you explain my Netbird peers, groups and policies to me?"

claude-desktop-mcp-netbird

Docker

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

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:

  1. Install thv as described in ToolHive README.

  2. Add Netbird API token to thv secrets:

thv secret set netbird
  1. Build an SSE image as described in the Docker section above

  2. 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
  1. When you want to stop the server, use:
thv stop thv-mcp-netbird

Development

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

Debugging

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.

Testing

TODO: add tests

Linting

To lint the code, run:

make lint

License

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).

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://reddgr.com
  • Delivers concise Python code and interprets non-English comments

  • 林乔安妮
  • A fashion stylist GPT offering outfit suggestions for various scenarios.

  • huahuayu
  • A unified API gateway for integrating multiple etherscan-like blockchain explorer APIs with Model Context Protocol (MCP) support for AI assistants.

  • deemkeen
  • control your mbot2 with a power combo: mqtt+mcp+llm

  • zhaoyunxing92
  • 本项目是一个钉钉MCP(Message Connector Protocol)服务,提供了与钉钉企业应用交互的API接口。项目基于Go语言开发,支持员工信息查询和消息发送等功能。

  • ariofarmani
  • Test repository for GitHub MCP server functionality

    Reviews

    2 (1)
    Avatar
    user_2OPA9gEB
    2025-04-16

    As a dedicated user of mcp-netbird, I am thoroughly impressed by its seamless functionality and user-friendly interface. Created by the talented aantti, this tool has greatly enhanced my productivity and efficiency. The product’s intuitive design and robust features make it a must-have for any professional seeking to optimize their workflow. Highly recommended! Check it out here: https://github.com/aantti/mcp-netbird