Documentation

Use the InfluxDB 3 MCP server

The InfluxDB Model Context Protocol (MCP) server lets you interact with InfluxDB Cloud Dedicated using natural language with large language model (LLM) agents. It enables database management, token handling, and SQL query generation in plain English—no coding required.

This guide walks you through configuring your LLM agent to run and use the InfluxDB MCP server to interact with your InfluxDB Cloud Dedicated cluster.

Prerequisites

  • Node.js v18+ (if using npx to run the MCP server)

  • Docker (if using Docker to run the MCP server)

  • A running and reachable InfluxDB Cloud Dedicated cluster.

  • Valid InfluxDB Cloud Dedicated management and database tokens

  • (Optional) An LLM assistant like Claude Desktop, ChatGPT Desktop, etc.

Configure the MCP server

Use environment variables to configure the InfluxDB 3 MCP server and connect it to your InfluxDB Cloud Dedicated cluster. Set the following environment variables when you start the MCP server:

Required InfluxDB connection variables

  • INFLUX_DB_PRODUCT_TYPE: cloud-dedicated
  • INFLUX_DB_ACCOUNT_ID: Your InfluxDB Cloud Dedicated account ID
  • INFLUX_DB_CLUSTER_ID: Your InfluxDB Cloud Dedicated cluster ID
  • INFLUX_DB_TOKEN: An InfluxDB Cloud Dedicated database token
  • INFLUX_DB_MANAGEMENT_TOKEN: An InfluxDB Cloud Dedicated management token

Optional tokens

You can include one or both of INFLUX_DB_TOKEN and INFLUX_DB_MANAGEMENT_TOKEN, but omitting either limits the type of operations your LLM agents can perform on your InfluxDB Cloud Dedicated cluster.

Configure your LLM agent to run the MCP server

To run the MCP, user either Node.js and npm or Docker to run the server. Some LLM agents, like Claude Desktop, start, run, and connect to the MCP server for you:

The following instructions provide information for how to configure Claude Desktop to use the InfluxDB MCP server.

  1. Clone the influxdata/influxdb3_mcp_server repository from GitHub.

  2. Navigate to the influxdb3_mcp_server project directory:

    cd influxdb3_mcp_server/
  3. Install dependencies:

    npm install
  4. Build the MCP server:

    npm run build

This builds the files necessary to run the MCP server and stores them in ./build. The ./build/index.js file starts the MCP server.

Configure your LLM Agent to use the Node.js-based MCP server

In Claude Desktop, go to Settings > Developers and edit your configuration. Enter the following JSON configuration:

{
  "mcpServers": {
    "influxdb": {
      "command": "node",
      "args": ["/
path/to
/influxdb3_mcp_server/build/index.js"
],
"env": { "INFLUX_DB_PRODUCT_TYPE"="cloud-dedicated", "INFLUX_DB_CLUSTER_ID"="
DEDICATED_CLUSTER_ID
"
,
"INFLUX_DB_ACCOUNT_ID"="
DEDICATED_ACCOUNT_ID
"
,
"INFLUX_DB_TOKEN"="
DEDICATED_DATABASE_TOKEN
"
,
"INFLUX_DB_MANAGEMENT_TOKEN"="
DEDICATED_MANAGEMENT_TOKEN
"
} } } }

Replace the following:

  • path/to: The absolute path to your influxdb3_mcp_server project directory.
  • DEDICATED_CLUSTER_ID: Your InfluxDB Cloud Dedicated cluster ID
  • DEDICATED_ACCOUNT_ID: Your InfluxDB Cloud Dedicated account ID
  • DEDICATED_DATABASE_TOKEN: A database token with permissions that grant access to all databases you would like your LLM agent to be able to write data to and query data from
  • DEDICATED_MANAGEMENT_TOKEN: A management token that lets your LLM agent perform administrative tasks on your InfluxDB Cloud Dedicated cluster

Configure your LLM Agent to use the Docker-based MCP server

In Claude Desktop, go to Settings > Developers and edit your configuration. Enter the following JSON configuration:

{
  "mcpServers": {
    "influxdb": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "--interactive",
        "--env",
        "INFLUX_DB_PRODUCT_TYPE",
        "--env",
        "INFLUX_DB_ACCOUNT_ID",
        "--env",
        "INFLUX_DB_CLUSTER_ID",
        "--env",
        "INFLUX_DB_TOKEN",
        "--env",
        "INFLUX_DB_MANAGEMENT_TOKEN",
        "influxdata/influxdb3-mcp-server"
      ],
      "env": {
        "INFLUX_DB_PRODUCT_TYPE"="cloud-dedicated",
        "INFLUX_DB_ACCOUNT_ID"="
DEDICATED_ACCOUNT_ID
"
,
"INFLUX_DB_CLUSTER_ID"="
DEDICATED_CLUSTER_ID
"
,
"INFLUX_DB_TOKEN"="
DEDICATED_DATABASE_TOKEN
"
,
"INFLUX_DB_MANAGEMENT_TOKEN"="
DEDICATED_MANAGEMENT_TOKEN
"
} } } }

Replace the following:

  • path/to: The absolute path to your influxdb3_mcp_server project directory.
  • DEDICATED_ACCOUNT_ID: Your InfluxDB Cloud Dedicated account ID
  • DEDICATED_CLUSTER_ID: Your InfluxDB Cloud Dedicated cluster ID
  • DEDICATED_DATABASE_TOKEN: A database token with permissions that grant access to all databases you would like your LLM agent to be able to write data to and query data from
  • DEDICATED_MANAGEMENT_TOKEN: A management token that lets your LLM agent perform administrative tasks on your InfluxDB Cloud Dedicated cluster

Supported Features

Once connected, you can use your LLM agent to perform tasks on your InfluxDB Cloud Dedicated cluster, including:

  • Create, update, and delete databases
  • List tables and inspect schemas
  • Create and manage tokens
  • Query data without writing SQL or InfluxQL
  • Check server health and connection status
Examples of supported prompts

“List all tables in the production database.”

“Create a read-only token for the metrics database.”

“Analyze last week’s sensor data for anomalies.”

“Create a new database called iot_sensors with a 30-day retention policy.”

“Show me the schema for the sensor_data table.”


Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more

New in InfluxDB 3.4

Key enhancements in InfluxDB 3.4 and the InfluxDB 3 Explorer 1.2.

See the Blog Post

InfluxDB 3.4 is now available for both Core and Enterprise, which introduces offline token generation for use in automated deployments and configurable license type selection that lets you bypass the interactive license prompt. InfluxDB 3 Explorer 1.2 is also available, which includes InfluxDB cache management and other new features.

For more information, check out: