influxdb3_mcp_server

influxdata/influxdb3_mcp_server

3.3

If you are the rightful owner of influxdb3_mcp_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The InfluxDB MCP Server facilitates integration with InfluxDB 3, providing tools and resources for seamless interaction via MCP clients.

InfluxDB MCP Server

Model Context Protocol (MCP) server for InfluxDB 3 integration. Provides tools, resources, and prompts for interacting with InfluxDB v3 (Core/Enterprise/Cloud Dedicated) via MCP clients.


Prerequisites

  • InfluxDB 3 Instance: URL and token (Core/Enterprise) or Cluster ID and tokens (Cloud Dedicated)
  • Node.js: v18 or newer (for npm/npx usage)
  • npm: v9 or newer (for npm/npx usage)
  • Docker: (for Docker-based setup)

Available Tools

Tool NameDescriptionAvailability
get_helpGet help and troubleshooting guidance for InfluxDB operationsAll versions
write_line_protocolWrite data using InfluxDB line protocolAll versions
create_databaseCreate a new database (with Cloud Dedicated config options)All versions
update_databaseUpdate database configuration (maxTables, retention, etc.)Cloud Dedicated only
delete_databaseDelete a database by name (irreversible)All versions
execute_queryRun a SQL query against a database (supports multiple formats)All versions
get_measurementsList all measurements (tables) in a databaseAll versions
get_measurement_schemaGet schema (columns/types) for a measurement/tableAll versions
create_admin_tokenCreate a new admin token (full permissions)Core/Enterprise only
list_admin_tokensList all admin tokens (with optional filtering)Core/Enterprise only
create_resource_tokenCreate a resource token for specific DBs and permissionsCore/Enterprise only
list_resource_tokensList all resource tokens (with filtering and ordering)Core/Enterprise only
delete_tokenDelete a token by nameCore/Enterprise only
regenerate_operator_tokenRegenerate the operator token (dangerous/irreversible)Core/Enterprise only
cloud_list_database_tokensList all database tokens for Cloud-Dedicated clusterCloud Dedicated only
cloud_get_database_tokenGet details of a specific database token by IDCloud Dedicated only
cloud_create_database_tokenCreate a new database token for Cloud-Dedicated clusterCloud Dedicated only
cloud_update_database_tokenUpdate an existing database tokenCloud Dedicated only
cloud_delete_database_tokenDelete a database token from Cloud-Dedicated clusterCloud Dedicated only
list_databasesList all available databases in the instanceAll versions
health_checkCheck InfluxDB connection and health statusAll versions

Available Resources

Resource NameDescription
influx-configRead-only access to InfluxDB configuration
influx-statusReal-time connection and health status
influx-databasesList of all databases in the instance

Setup & Integration Guide

1. Environment Variables

For Core/Enterprise InfluxDB:

You must provide:

  • INFLUX_DB_INSTANCE_URL (e.g. http://localhost:8181/)
  • INFLUX_DB_TOKEN
  • INFLUX_DB_PRODUCT_TYPE (core or enterprise)

Example .env:

INFLUX_DB_INSTANCE_URL=http://localhost:8181/
INFLUX_DB_TOKEN=your_influxdb_token_here
INFLUX_DB_PRODUCT_TYPE=core
For Cloud Dedicated InfluxDB:

You must provide INFLUX_DB_PRODUCT_TYPE=cloud-dedicated and INFLUX_DB_CLUSTER_ID, plus one of these token combinations:

Option 1: Database Token Only (Query/Write operations only):

INFLUX_DB_PRODUCT_TYPE=cloud-dedicated
INFLUX_DB_CLUSTER_ID=your_cluster_id_here
INFLUX_DB_TOKEN=your_database_token_here

Option 2: Management Token Only (Database management only):

INFLUX_DB_PRODUCT_TYPE=cloud-dedicated
INFLUX_DB_CLUSTER_ID=your_cluster_id_here
INFLUX_DB_ACCOUNT_ID=your_account_id_here
INFLUX_DB_MANAGEMENT_TOKEN=your_management_token_here

Option 3: Both Tokens (Full functionality):

INFLUX_DB_PRODUCT_TYPE=cloud-dedicated
INFLUX_DB_CLUSTER_ID=your_cluster_id_here
INFLUX_DB_ACCOUNT_ID=your_account_id_here
INFLUX_DB_TOKEN=your_database_token_here
INFLUX_DB_MANAGEMENT_TOKEN=your_management_token_here

See env.cloud-dedicated.example for detailed configuration options and comments.


2. Integration with MCP Clients

A. Local (npm install & run)
  1. Install dependencies:
    npm install
    
  2. Build the server:
    npm run build
    
  3. Configure your MCP client to use the built server. Example (see example-local.mcp.json):
    {
      "mcpServers": {
        "influxdb": {
          "command": "node",
          "args": ["/path/to/influx-mcp-standalone/build/index.js"],
          "env": {
            "INFLUX_DB_INSTANCE_URL": "http://localhost:8181/",
            "INFLUX_DB_TOKEN": "<YOUR_INFLUXDB_TOKEN>",
            "INFLUX_DB_PRODUCT_TYPE": "core"
          }
        }
      }
    }
    
B. Local (npx, no install/build required)
  1. Run directly with npx (after publishing to npm, won't work yet):
    {
      "mcpServers": {
        "influxdb": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-influxdb"],
          "env": {
            "INFLUX_DB_INSTANCE_URL": "http://localhost:8181/",
            "INFLUX_DB_TOKEN": "<YOUR_INFLUXDB_TOKEN>",
            "INFLUX_DB_PRODUCT_TYPE": "core"
          }
        }
      }
    }
    
C. Docker

Before running the Docker integration, you must build the Docker image:

# Option 1: Use docker compose (recommended)
docker compose build
# Option 2: Use npm script
npm run docker:build

a) Docker with remote InfluxDB instance (see example-docker.mcp.json):

{
  "mcpServers": {
    "influxdb": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "INFLUX_DB_INSTANCE_URL",
        "-e",
        "INFLUX_DB_TOKEN",
        "-e",
        "INFLUX_DB_PRODUCT_TYPE",
        "mcp/influxdb"
      ],
      "env": {
        "INFLUX_DB_INSTANCE_URL": "http://remote-influxdb-host:8181/",
        "INFLUX_DB_TOKEN": "<YOUR_INFLUXDB_TOKEN>",
        "INFLUX_DB_PRODUCT_TYPE": "core"
      }
    }
  }
}

b) Docker with InfluxDB running in Docker on the same machine (see example-docker.mcp.json):

Use host.docker.internal as the InfluxDB URL so the MCP server container can reach the InfluxDB container:

{
  "mcpServers": {
    "influxdb": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "--add-host=host.docker.internal:host-gateway",
        "-e",
        "INFLUX_DB_INSTANCE_URL",
        "-e",
        "INFLUX_DB_TOKEN",
        "-e",
        "INFLUX_DB_PRODUCT_TYPE",
        "influxdb-mcp-server"
      ],
      "env": {
        "INFLUX_DB_INSTANCE_URL": "http://host.docker.internal:8181/",
        "INFLUX_DB_TOKEN": "<YOUR_INFLUXDB_TOKEN>",
        "INFLUX_DB_PRODUCT_TYPE": "enterprise"
      }
    }
  }
}

Example Usage

  • Use your MCP client to call tools, resources, or prompts as described above.
  • See the example-*.mcp.json files for ready-to-use configuration templates:
    • example-local.mcp.json - Local development setup
    • example-npx.mcp.json - NPX-based setup
    • example-docker.mcp.json - Docker-based setup
    • example-cloud-dedicated.mcp.json - Cloud Dedicated with all variables
  • See the env.example and env.cloud-dedicated.example files for environment variable templates.

Support & Troubleshooting

  • Use the get_help tool for built-in help and troubleshooting.
  • For connection issues, check your environment variables and InfluxDB instance status.
  • For advanced configuration, see the comments in the example .env and MCP config files.

License