Use the InfluxDB 3 MCP server
The InfluxDB Model Context Protocol (MCP) server lets you interact with InfluxDB 3 Enterprise 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 3 Enterprise server.
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 3 Enterprise server.
A valid InfluxDB 3 Enterprise admin or resource token with appropriate resource-specific permissions
(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 3 Enterprise server. Set the following environment variables when you start the MCP server:
Required InfluxDB connection variables
INFLUX_DB_PRODUCT_TYPE:
enterprise
INFLUX_DB_INSTANCE_URL: Your InfluxDB 3 Enterprise URL–for example:
http://localhost:8181
If using Docker to run the InfluxDB MCP server and you want to manage an InfluxDB instance running on
localhost
, use the internal Docker network to connect to your local InfluxDB 3 Enterprise server–for example:http://host.docker.internal:8181/
INFLUX_DB_TOKEN: Your InfluxDB 3 Enterprise admin token or resource token.
If using a resource token, your LLM agent can only perform the operations allowed by the token permissions.
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.
Clone the influxdata/influxdb3_mcp_server repository from GitHub.
Navigate to the
influxdb3_mcp_server
project directory:cd influxdb3_mcp_server/
Install dependencies:
npm install
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": "enterprise",
"INFLUX_DB_INSTANCE_URL": "http://localhost:8181",
"INFLUX_DB_TOKEN": "AUTH_TOKEN"
}
}
}
}
Replace the following:
path/to
: The absolute path to yourinfluxdb3_mcp_server
project directory.AUTH_TOKEN
: Your InfluxDB 3 Enterprise token. The permissions granted by the token determine what operations your LLM agents can perform.
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:
In the examples below, replace the following:
path/to
: The absolute path to yourinfluxdb3_mcp_server
project directory.AUTH_TOKEN
: Your InfluxDB 3 Enterprise token. The permissions granted by the token determine what operations your LLM agents can perform.
Connect to a remote InfluxDB server
{
"mcpServers": {
"influxdb": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"--env",
"INFLUX_DB_PRODUCT_TYPE",
"--env",
"INFLUX_DB_INSTANCE_URL",
"--env",
"INFLUX_DB_TOKEN",
"influxdata/influxdb3-mcp-server"
],
"env": {
"INFLUX_DB_PRODUCT_TYPE": "enterprise",
"INFLUX_DB_INSTANCE_URL": "http://localhost:8181",
"INFLUX_DB_TOKEN": "AUTH_TOKEN"
}
}
}
}
Connect to a local InfluxDB server
{
"mcpServers": {
"influxdb": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"--add-host=host.docker.internal:host-gateway"
"--env",
"INFLUX_DB_PRODUCT_TYPE",
"--env",
"INFLUX_DB_INSTANCE_URL",
"--env",
"INFLUX_DB_TOKEN",
"influxdata/influxdb3-mcp-server"
],
"env": {
"INFLUX_DB_PRODUCT_TYPE": "enterprise",
"INFLUX_DB_INSTANCE_URL": "http://host.docker.internal:8181",
"INFLUX_DB_TOKEN": "AUTH_TOKEN"
}
}
}
}
Supported Features
Once connected, you can use your LLM agent to perform tasks on your InfluxDB 3 Enterprise server, 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!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB 3 Enterprise and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support. Customers using a trial license can email trial@influxdata.com for assistance.