InfluxDB MCP server

Connects to InfluxDB time-series databases for querying measurements, writing data, and managing buckets through a bridge that exposes database functionality via tools and resources.
Back to servers
Setup instructions
Provider
Sam Coward
Release date
Mar 11, 2025
Language
TypeScript
Package
Stats
846 downloads
17 stars

The InfluxDB MCP Server provides a Model Context Protocol server that connects to an InfluxDB instance using the InfluxDB OSS API v2. It allows you to access your time series database resources, execute queries, and manage database objects through a standardized interface that works with Claude and other AI assistants.

Installation Options

Installing via Smithery

To install InfluxDB MCP Server automatically via Smithery:

npx -y @smithery/cli install @idoru/influxdb-mcp-server --client claude

Running with npx (Recommended)

# Run directly with npx
INFLUXDB_TOKEN=your_token npx influxdb-mcp-server

Installing Globally

# Install globally
npm install -g influxdb-mcp-server

# Run the server
INFLUXDB_TOKEN=your_token influxdb-mcp-server

Installing from Source

# Clone the repository
git clone https://github.com/idoru/influxdb-mcp-server.git
cd influxdb-mcp-server

# Install dependencies
npm install

# Run the server
INFLUXDB_TOKEN=your_token npm start

Configuration

The server requires the following environment variables:

  • INFLUXDB_TOKEN (required): Authentication token for the InfluxDB API
  • INFLUXDB_URL (optional): URL of the InfluxDB instance (defaults to http://localhost:8086)
  • INFLUXDB_ORG (optional): Default organization name for certain operations

Integration with Claude for Desktop

Add the server to your claude_desktop_config.json:

Using npx (Recommended)

{
  "mcpServers": {
    "influxdb": {
      "command": "npx",
      "args": ["influxdb-mcp-server"],
      "env": {
        "INFLUXDB_TOKEN": "your_token",
        "INFLUXDB_URL": "http://localhost:8086",
        "INFLUXDB_ORG": "your_org"
      }
    }
  }
}

If Installed Locally

{
  "mcpServers": {
    "influxdb": {
      "command": "node",
      "args": ["/path/to/influxdb-mcp-server/src/index.js"],
      "env": {
        "INFLUXDB_TOKEN": "your_token",
        "INFLUXDB_URL": "http://localhost:8086",
        "INFLUXDB_ORG": "your_org"
      }
    }
  }
}

Available Resources

The server exposes these resources:

  • Organizations List: influxdb://orgs

    • Lists all organizations in the InfluxDB instance
  • Buckets List: influxdb://buckets

    • Shows all buckets with their metadata
  • Bucket Measurements: influxdb://bucket/{bucketName}/measurements

    • Lists all measurements within a specified bucket
  • Query Data: influxdb://query/{orgName}/{fluxQuery}

    • Executes a Flux query and returns results as a resource

Available Tools

Write Data

Write time-series data in line protocol format:

  • Parameters:
    • org: Organization name
    • bucket: Bucket name
    • data: Data in line protocol format
    • precision: Time precision (optional)

Query Data

Execute Flux queries:

  • Parameters:
    • org: Organization name
    • query: Flux query string

Create Bucket

Create a new bucket:

  • Parameters:
    • name: Bucket name
    • orgID: Organization ID
    • retentionPeriodSeconds: Retention period in seconds (optional)

Create Organization

Create a new organization:

  • Parameters:
    • name: Organization name
    • description: Organization description (optional)

Prompt Templates

The server provides helpful prompt templates:

  • flux-query-examples: Common Flux query examples
  • line-protocol-guide: Guide to InfluxDB line protocol format

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "influxdb" '{"command":"npx","args":["influxdb-mcp-server"],"env":{"INFLUXDB_TOKEN":"your_token","INFLUXDB_URL":"http://localhost:8086","INFLUXDB_ORG":"your_org"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "influxdb": {
            "command": "npx",
            "args": [
                "influxdb-mcp-server"
            ],
            "env": {
                "INFLUXDB_TOKEN": "your_token",
                "INFLUXDB_URL": "http://localhost:8086",
                "INFLUXDB_ORG": "your_org"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "influxdb": {
            "command": "npx",
            "args": [
                "influxdb-mcp-server"
            ],
            "env": {
                "INFLUXDB_TOKEN": "your_token",
                "INFLUXDB_URL": "http://localhost:8086",
                "INFLUXDB_ORG": "your_org"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later