NetBox MCP Server
A small Model Context Protocol (MCP) server built with FastMCP that provides an interface to a NetBox instance.
This repository exposes NetBox resources (sites, site-groups, devices, etc.) as MCP tools and runs a streaming HTTP transport so clients can connect and receive streamed responses from the MCP server.
Architecture (FastMCP + streaming HTTP)
- FastMCP: The MCP tool registry and runtime. Tools are defined in
app.pyand decorated with@mcp.tool. - NetBoxClient: a tiny async helper in
app.pythat wrapshttpx.AsyncClientto call the NetBox API. - Streaming HTTP transport: the MCP server is started with
mcp.run(transport="http", ...)which runs an HTTP server that supports a streaming/chunked response transport. This is useful for clients that want to consume events or long-running responses incrementally rather than waiting for the entire result.
Conceptually the flow is:
- Client connects to the FastMCP streaming HTTP endpoint.
- Client requests a tool (for example,
search_sitesorget_site_group_details). - FastMCP calls the associated Python function in
app.py, which may in turn call NetBox viaNetBoxClient. - The result is streamed back over the HTTP transport as it becomes available.






