NetBox MCP Server

NetBox MCP Server

MCP server for interacting with NetBox API, enabling users to query and manage NetBox resources such as devices through natural language.

Category
Visit Server

README

NetBox MCP Server


Table of Contents


��️ Running in Cursor

You can run this MCP server directly inside the Cursor IDE. Here's how:

  1. Open the Project

    • Launch Cursor and open this project folder.
  2. Install Dependencies

    • Open the built-in terminal in Cursor (View → Terminal or `Ctrl+``).
    • Run:
      npm install
      
  3. Set Environment Variables

  4. Run the MCP Server

    • In the Cursor terminal, start the server:
      node mcpServer.js
      
    • For Server-Sent Events (SSE) support, use:
      node mcpServer.js --sse
      
  5. Test the Server

    • You can use the Cursor terminal to run test commands, or connect to the server from compatible MCP clients (such as Claude Desktop) as described below.
  6. View Output

    • All logs and output will appear in the Cursor terminal pane.

Tip: You can edit code, manage files, and run all commands without leaving Cursor.


🚦 Getting Started

⚙️ Prerequisites

Before starting, please ensure you have:

Warning: if you run with a lower version of Node, fetch won't be present. Tools use fetch to make HTTP calls. To work around this, you can modify the tools to use node-fetch instead. Make sure that node-fetch is installed as a dependency and then import it as fetch into each tool file.

📥 Installation & Setup

1. Install dependencies

Run from your project's root directory:

npm install

🔐 Set tool environment variables

In the .env file, you'll see environment variable placeholders, one for each workspace that the selected tools are from. For example, if you selected requests from 2 workspaces, e.g. Acme and Widgets, you'll see two placeholders:

ACME_API_KEY=
WIDGETS_API_KEY=

Update the values with actual API keys for each API. These environment variables are used inside of the generated tools to set the API key for each request. You can inspect a file in the tools directory to see how it works.

// environment variables are used inside of each tool file
const apiKey = process.env.ACME_API_KEY;

Caveat: This may not be correct for every API. The generation logic is relatively simple - for each workspace, we create an environment variable with the same name as the workspace slug, and then use that environment variable in each tool file that belongs to that workspace. If this isn't the right behavior for your chosen API, no problem! You can manually update anything in the .env file or tool files to accurately reflect the API's method of authentication.

👩‍💻 Connect the MCP Server to Claude (or other MCP clients)

You can connect your MCP server to any MCP client. Here we provide instructions for connecting it to Claude Desktop.

Step 1: Note the full path to node and the mcpServer.js from the previous step.

Step 2. Open Claude Desktop → SettingsDevelopersEdit Config and add a new MCP server:

{
  "mcpServers": {
    "<server_name>": {
      "command": "<absolute/path/to/node>",
      "args": ["<absolute/path/to/mcpServer.js>"]
    }
  }
}

Restart Claude Desktop to activate this change. Make sure the new MCP is turned on and has a green circle next to it. If so, you're ready to begin a chat session that can use the tools you've connected.

Warning: If you don't supply an absolute path to a node version that is v18+, Claude (and other MCP clients) may fall back to another node version on the system of a previous version. In this case, the fetch API won't be present and tool calls will not work. If that happens, you can a) install a newer version of node and point to it in the command, or b) import node-fetch into each tool as fetch, making sure to also add the node-fetch dependency to your package.json.

Additional Options

🐳 Docker Deployment (Production or Development)

For Docker-based deployments, you can use the provided Dockerfile:

1. Build Docker image

docker build -t netbox-mcp-server .

2. Run the Docker container

docker run -it --rm --env-file=.env -p 3000:3000 netbox-mcp-server
  • The server will start inside the container. Adjust the port mapping as needed.
  • You can connect to this server from Cursor or any compatible MCP client as described above.

3. (Optional) Integrate with Claude Desktop

Add Docker server configuration to Claude Desktop (Settings → Developers → Edit Config):

{
  "mcpServers": {
    "netbox-mcp-server": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "--env-file=.env", "-p", "3000:3000", "netbox-mcp-server"]
    }
  }
}

Add your environment variables (API keys, etc.) inside the .env file.

🌐 Server-Sent Events (SSE)

To run the server with Server-Sent Events (SSE) support, use the --sse flag:

node mcpServer.js --sse

or, with Docker:

docker run -it --rm --env-file=.env -p 3000:3000 netbox-mcp-server node mcpServer.js --sse

🛠️ Additional CLI commands

List tools

List descriptions and parameters from all generated tools with:

node index.js tools

Example:

Available Tools:

Workspace: acme-workspace
  Collection: useful-api
    list_all_customers
      Description: Retrieve a list of useful things.
      Parameters:
        - magic: The required magic power
        - limit: Number of results returned
        [...additional parameters...]

➕ Adding New Tools

Extend your MCP server with more tools easily:

  1. Add new JS files to tools/netbox-workspace/ for each NetBox API endpoint you want to expose.
  2. Register each new tool in tools/paths.js.

💬 Questions & Support

For questions or support, please refer to the documentation in this repository or reach out to the project maintainer.


🆕 NetBox MCP Server Setup

1. Environment Variables

Add the following to your .env file in the project root:

# NetBox API Environment Variables
NETBOX_API_KEY=your_netbox_api_key_here
NETBOX_API_BASE_URL=https://your-netbox-instance/api/

2. Tool Registration

The NetBox tool list-all-devices.js is registered in tools/paths.js as:

'netbox-workspace/list-all-devices.js'

3. Usage in Cursor

  • Start the MCP server via Cursor as described above.
  • Use Cursor's MCP tool invocation to run the tool:
    • Tool name: list_all_netbox_devices
    • Parameter: { "limit": 10 } (optional)

4. Testing

  • You can also create a test script or use the MCP UI to invoke the tool and see results.
  • Ensure your .env is set and your NetBox instance is reachable.

5. Adding More Tools

  • Add new JS files to tools/netbox-workspace/ for each NetBox API endpoint you want to expose.
  • Register each new tool in tools/paths.js.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured