Skip to content

Commit 8ac54e6

Browse files
committed
docs: add MCP server documentation for v1.3.0
- New user-guide/mcp-server.rst: full setup guide with Claude Desktop config, tool reference table, and example conversations - index.rst: added MCP card to quick-start grid and features grid, added mcp-server to User Guide toctree - installation.rst: added MCP optional dependency section, bump version - changelog.rst: added v1.3.0 and v1.2.1 entries
1 parent 9216b57 commit 8ac54e6

4 files changed

Lines changed: 316 additions & 1 deletion

File tree

docs/changelog.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ All notable changes to this project will be documented in this file.
66
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
77
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
88

9+
[1.3.0] - 2026-03-31
10+
---------------------
11+
12+
Added
13+
~~~~~
14+
15+
- **MCP Server** (``netbird.mcp.server``) — 25 NetBird management tools exposed via `Model Context Protocol <https://modelcontextprotocol.io>`_
16+
17+
- AI assistants (Claude Desktop, etc.) can now manage NetBird resources through natural language
18+
- Tools cover: account, users, peers, groups, policies, networks, setup keys, DNS, posture checks, audit events, network diagrams
19+
- See :doc:`user-guide/mcp-server` for setup instructions
20+
21+
- **``mcp`` optional dependency** — ``mcp[cli]>=1.0.0`` via ``pip install "netbird[mcp]"``
22+
- **``netbird-mcp`` CLI entry point** — Start the MCP server from the command line
23+
24+
[1.2.1] - 2026-03-28
25+
---------------------
26+
27+
Fixed
28+
~~~~~
29+
30+
- **PolicyRule** ``sources`` / ``destinations`` — Changed type from ``List[Dict]`` to ``List[Union[str, Dict]]``. The NetBird API expects plain string group IDs on writes (POST/PUT) but returns full objects on reads (GET).
31+
932
[1.2.0] - 2026-03-27
1033
---------------------
1134

docs/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ NetBird Python Client
3232

3333
Installation guide and requirements
3434

35+
.. grid-item-card:: MCP Server
36+
:link: user-guide/mcp-server
37+
:link-type: doc
38+
39+
Use NetBird with AI assistants via Model Context Protocol
40+
3541
Features
3642
--------
3743

@@ -61,6 +67,10 @@ Features
6167

6268
Python 3.9+ (supports 3.9-3.14)
6369

70+
.. grid-item-card:: MCP Server
71+
72+
25 tools for AI assistants via Model Context Protocol
73+
6474
Architecture
6575
------------
6676

@@ -227,6 +237,7 @@ Cloud Resources
227237
:caption: User Guide
228238

229239
user-guide/authentication
240+
user-guide/mcp-server
230241
user-guide/network-visualization
231242
user-guide/error-handling
232243

docs/installation.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ For generating network topology diagrams:
7474
7575
# Mermaid requires no additional Python dependencies
7676
77+
MCP Server (AI Assistants)
78+
~~~~~~~~~~~~~~~~~~~~~~~~~~
79+
80+
To use NetBird with AI assistants via the Model Context Protocol:
81+
82+
.. code-block:: bash
83+
84+
pip install "netbird[mcp]"
85+
86+
This installs `mcp[cli] <https://pypi.org/project/mcp/>`_ and the ``netbird-mcp`` CLI entry point.
87+
See :doc:`user-guide/mcp-server` for setup instructions.
88+
7789
Development Tools
7890
~~~~~~~~~~~~~~~~~
7991

@@ -98,7 +110,7 @@ Verification
98110
.. code-block:: python
99111
100112
import netbird
101-
print(netbird.__version__) # Should print "1.2.0"
113+
print(netbird.__version__) # Should print "1.3.0"
102114
103115
Virtual Environments
104116
--------------------

docs/user-guide/mcp-server.rst

Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
MCP Server
2+
==========
3+
4+
The NetBird Python Client includes a built-in `Model Context Protocol <https://modelcontextprotocol.io>`_ (MCP) server that exposes 25 NetBird management tools to AI assistants like `Claude Desktop <https://claude.ai>`_.
5+
6+
This lets you manage your NetBird network through natural language — no scripting required.
7+
8+
Installation
9+
------------
10+
11+
The MCP server requires the optional ``mcp`` dependency:
12+
13+
.. code-block:: bash
14+
15+
pip install "netbird[mcp]"
16+
17+
Configuration
18+
-------------
19+
20+
The server reads credentials from environment variables:
21+
22+
.. list-table::
23+
:header-rows: 1
24+
:widths: 30 70
25+
26+
* - Variable
27+
- Description
28+
* - ``NETBIRD_HOST``
29+
- NetBird API host (e.g. ``api.netbird.io`` or ``netbird.yourcompany.com``)
30+
* - ``NETBIRD_API_TOKEN``
31+
- Personal Access Token from the NetBird dashboard
32+
33+
Claude Desktop Setup
34+
--------------------
35+
36+
Add the following to your Claude Desktop configuration file:
37+
38+
- **macOS**: ``~/Library/Application Support/Claude/claude_desktop_config.json``
39+
- **Windows**: ``%APPDATA%\Claude\claude_desktop_config.json``
40+
41+
.. code-block:: json
42+
43+
{
44+
"mcpServers": {
45+
"netbird": {
46+
"command": "netbird-mcp",
47+
"env": {
48+
"NETBIRD_HOST": "api.netbird.io",
49+
"NETBIRD_API_TOKEN": "your-api-token"
50+
}
51+
}
52+
}
53+
}
54+
55+
Restart Claude Desktop after saving. You should see NetBird tools available in the conversation.
56+
57+
Self-Hosted NetBird
58+
~~~~~~~~~~~~~~~~~~~
59+
60+
.. code-block:: json
61+
62+
{
63+
"mcpServers": {
64+
"netbird": {
65+
"command": "netbird-mcp",
66+
"env": {
67+
"NETBIRD_HOST": "netbird.yourcompany.com",
68+
"NETBIRD_API_TOKEN": "your-api-token"
69+
}
70+
}
71+
}
72+
}
73+
74+
Running the Server Manually
75+
---------------------------
76+
77+
.. code-block:: bash
78+
79+
NETBIRD_HOST=api.netbird.io NETBIRD_API_TOKEN=your-token netbird-mcp
80+
81+
Or using ``python -m``:
82+
83+
.. code-block:: bash
84+
85+
python -m netbird.mcp.server
86+
87+
Available Tools
88+
---------------
89+
90+
The server exposes 25 tools organized by resource:
91+
92+
Account
93+
~~~~~~~
94+
95+
.. list-table::
96+
:header-rows: 1
97+
:widths: 30 70
98+
99+
* - Tool
100+
- Description
101+
* - ``get_account``
102+
- Get the current NetBird account settings and configuration
103+
104+
Users
105+
~~~~~
106+
107+
.. list-table::
108+
:header-rows: 1
109+
:widths: 30 70
110+
111+
* - Tool
112+
- Description
113+
* - ``get_current_user``
114+
- Get the currently authenticated user's profile and permissions
115+
* - ``list_users``
116+
- List all users in the NetBird account
117+
118+
Peers
119+
~~~~~
120+
121+
.. list-table::
122+
:header-rows: 1
123+
:widths: 30 70
124+
125+
* - Tool
126+
- Description
127+
* - ``list_peers``
128+
- List all peers with connection status and IP addresses
129+
* - ``get_peer``
130+
- Get details of a specific peer by ID
131+
* - ``update_peer``
132+
- Update a peer's name, SSH access, or login expiration
133+
* - ``delete_peer``
134+
- Remove a peer from the network
135+
* - ``get_peer_accessible_peers``
136+
- List all peers a given peer can access based on current policies
137+
138+
Groups
139+
~~~~~~
140+
141+
.. list-table::
142+
:header-rows: 1
143+
:widths: 30 70
144+
145+
* - Tool
146+
- Description
147+
* - ``list_groups``
148+
- List all peer groups with member counts
149+
* - ``get_group``
150+
- Get details of a specific group including its members
151+
* - ``create_group``
152+
- Create a new peer group with optional initial members
153+
* - ``update_group``
154+
- Update a group's name or member list
155+
* - ``delete_group``
156+
- Delete a peer group
157+
158+
Policies
159+
~~~~~~~~
160+
161+
.. list-table::
162+
:header-rows: 1
163+
:widths: 30 70
164+
165+
* - Tool
166+
- Description
167+
* - ``list_policies``
168+
- List all access control policies with their rules
169+
* - ``create_policy``
170+
- Create a new policy with protocol, port, and direction control
171+
* - ``delete_policy``
172+
- Delete an access control policy
173+
174+
Networks
175+
~~~~~~~~
176+
177+
.. list-table::
178+
:header-rows: 1
179+
:widths: 30 70
180+
181+
* - Tool
182+
- Description
183+
* - ``list_networks``
184+
- List all networks with their resources and routers
185+
* - ``get_network``
186+
- Get a network with its resources and routers included
187+
188+
Setup Keys
189+
~~~~~~~~~~
190+
191+
.. list-table::
192+
:header-rows: 1
193+
:widths: 30 70
194+
195+
* - Tool
196+
- Description
197+
* - ``list_setup_keys``
198+
- List all setup keys with validity and usage stats
199+
* - ``create_setup_key``
200+
- Create a setup key for enrolling new peers
201+
202+
DNS
203+
~~~
204+
205+
.. list-table::
206+
:header-rows: 1
207+
:widths: 30 70
208+
209+
* - Tool
210+
- Description
211+
* - ``list_nameservers``
212+
- List all DNS nameserver groups
213+
* - ``get_dns_settings``
214+
- Get the global DNS settings for the account
215+
216+
Posture Checks & Audit
217+
~~~~~~~~~~~~~~~~~~~~~~~
218+
219+
.. list-table::
220+
:header-rows: 1
221+
:widths: 30 70
222+
223+
* - Tool
224+
- Description
225+
* - ``list_posture_checks``
226+
- List all device posture checks (compliance policies)
227+
* - ``get_audit_events``
228+
- Get recent audit log events showing account activity
229+
230+
Diagrams
231+
~~~~~~~~
232+
233+
.. list-table::
234+
:header-rows: 1
235+
:widths: 30 70
236+
237+
* - Tool
238+
- Description
239+
* - ``generate_network_diagram``
240+
- Generate a network topology diagram (Mermaid, Graphviz, or Diagrams)
241+
242+
Example Conversations
243+
---------------------
244+
245+
Once connected to Claude Desktop, you can ask questions like:
246+
247+
.. code-block:: text
248+
249+
"List all peers and show which ones are currently connected"
250+
251+
"Create a policy called 'SSH Access' allowing the DevOps group
252+
to reach port 22 on the Servers group"
253+
254+
"Generate a Mermaid diagram of the current network topology"
255+
256+
"Create a reusable setup key called 'Office-Onboarding' that expires
257+
in 7 days and auto-assigns peers to the Office group"
258+
259+
"Show me all audit events from the last 24 hours"
260+
261+
"Which peers can the peer named 'laptop-01' access?"
262+
263+
API Reference
264+
-------------
265+
266+
.. automodule:: netbird.mcp.server
267+
:members:
268+
:undoc-members:
269+
:show-inheritance:

0 commit comments

Comments
 (0)