content/shared/influxdb3-admin/mcp-server.md
InfluxDB provides two Model Context Protocol (MCP) servers for integrating with AI assistants:
The InfluxDB database MCP server lets you interact with {{% product-name %}} 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 section walks you through configuring your LLM agent to run and use the InfluxDB database MCP server to interact with your {{% product-name omit=" Clustered" %}} {{% show-in "core,enterprise" %}}server{{% /show-in %}}{{% show-in "cloud-dedicated,clustered" %}}cluster{{% /show-in %}}.
npx to run the MCP server)Use environment variables to configure the InfluxDB 3 MCP server and connect it to your {{% product-name omit=" Clustered" %}} {{% show-in "core,enterprise" %}}server{{% /show-in %}}{{% show-in "cloud-dedicated,clustered" %}}cluster{{% /show-in %}}. Set the following environment variables when you start the MCP server:
{{% show-in "core,enterprise" %}}
INFLUX_DB_PRODUCT_TYPE: {{% product-key %}}
INFLUX_DB_INSTANCE_URL: Your {{% product-name %}} URL--for example:
http://{{< influxdb/host >}}
[!Note] 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 {{% product-name %}} server--for example:txthttp://host.docker.internal:8181/
{{% /show-in %}}
{{% show-in "core" %}}
INFLUX_DB_TOKEN: Your {{% product-name %}} admin token {{% /show-in %}} {{% show-in "enterprise" %}}
INFLUX_DB_TOKEN: Your {{% product-name %}} admin token or resource token.
[!Note] If using a resource token, your LLM agent can only perform the operations allowed by the token permissions.
{{% /show-in %}}
{{% show-in "cloud-dedicated,clustered" %}}
{{% product-key %}}[!Note]
Optional tokens
You can include one or both of
INFLUX_DB_TOKENandINFLUX_DB_MANAGEMENT_TOKEN, but omitting either limits the type of operations your LLM agents can perform on your {{% product-name omit=" Clustered" %}} cluster.
{{% /show-in %}}
To run the MCP server, use either Node.js and npm or Docker.
Some LLM agents, like Claude Desktop, start, run,
and connect to the MCP server for you.
The following instructions show how to configure Claude Desktop to use the InfluxDB database MCP server.
{{< tabs-wrapper >}} {{% tabs %}} Node.js Docker {{% /tabs %}} {{% tab-content %}}
<!------------------------------- BEGIN NODE.JS ------------------------------->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.
In Claude Desktop, go to Settings > Developer and edit your configuration. Enter the following JSON configuration:
{{% show-in "core,enterprise" %}}
{
"mcpServers": {
"influxdb": {
"command": "node",
"args": ["/path/to/influxdb3_mcp_server/build/index.js"],
"env": {
"INFLUX_DB_PRODUCT_TYPE": "{{% product-key %}}",
"INFLUX_DB_INSTANCE_URL": "http://{{< influxdb/host >}}",
"INFLUX_DB_TOKEN": "AUTH_TOKEN"
}
}
}
}
Replace the following:
path/to{{% /code-placeholder-key %}}:
The absolute path to your influxdb3_mcp_server project directory.AUTH_TOKEN{{% /code-placeholder-key %}}:
Your {{% product-name %}} token. The permissions granted by the token
determine what operations your LLM agents can perform.{{% /show-in %}}
{{% show-in "cloud-dedicated" %}}
{
"mcpServers": {
"influxdb": {
"command": "node",
"args": ["/path/to/influxdb3_mcp_server/build/index.js"],
"env": {
"INFLUX_DB_PRODUCT_TYPE": "{{% product-key %}}",
"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{{% /code-placeholder-key %}}:
The absolute path to your influxdb3_mcp_server project directory.DEDICATED_ACCOUNT_ID{{% /code-placeholder-key %}}:
Your {{% product-name %}} account IDDEDICATED_CLUSTER_ID{{% /code-placeholder-key %}}:
Your {{% product-name omit=" Clustered" %}} cluster IDDEDICATED_DATABASE_TOKEN{{% /code-placeholder-key %}}:
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 fromDEDICATED_MANAGEMENT_TOKEN{{% /code-placeholder-key %}}:
A management token that
lets your LLM agent perform administrative tasks on your {{% product-name %}} cluster{{% /show-in %}}
<!-------------------------------- END NODE.JS -------------------------------->{{% /tab-content %}} {{% tab-content %}}
<!------------------------------- BEGIN DOCKER -------------------------------->In Claude Desktop, go to Settings > Developer and edit your configuration. Enter the following JSON configuration:
{{% show-in "core,enterprise" %}}
In the examples below, replace the following:
path/to{{% /code-placeholder-key %}}:
The absolute path to your influxdb3_mcp_server project directory.AUTH_TOKEN{{% /code-placeholder-key %}}:
Your {{% product-name %}} token. The permissions granted by the token
determine what operations your LLM agents can perform.{
"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": "{{% product-key %}}",
"INFLUX_DB_INSTANCE_URL": "http://{{< influxdb/host >}}",
"INFLUX_DB_TOKEN": "AUTH_TOKEN"
}
}
}
}
{
"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": "{{% product-key %}}",
"INFLUX_DB_INSTANCE_URL": "http://host.docker.internal:8181",
"INFLUX_DB_TOKEN": "AUTH_TOKEN"
}
}
}
}
{{% /show-in %}}
{{% show-in "cloud-dedicated" %}}
{
"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": "{{% product-key %}}",
"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:
DEDICATED_ACCOUNT_ID{{% /code-placeholder-key %}}:
Your {{% product-name %}} account IDDEDICATED_CLUSTER_ID{{% /code-placeholder-key %}}:
Your {{% product-name omit=" Clustered" %}} cluster IDDEDICATED_DATABASE_TOKEN{{% /code-placeholder-key %}}:
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 fromDEDICATED_MANAGEMENT_TOKEN{{% /code-placeholder-key %}}:
A management token that
lets your LLM agent perform administrative tasks on your {{% product-name %}} cluster{{% /show-in %}}
<!------------------------------- END DOCKER -------------------------------->{{% /tab-content %}} {{< /tabs-wrapper >}}
Once connected, you can use your LLM agent to perform tasks on your {{% product-name %}} {{% show-in "core,enterprise" %}}server{{% /show-in %}}{{% show-in "cloud-dedicated,clustered" %}}cluster{{% /show-in %}}, including:
"List all tables in the
productiondatabase.""Create a read-only token for the
metricsdatabase.""Analyze last week's sensor data for anomalies."
"Create a new database called
iot_sensorswith a 30-day retention policy.""Show me the schema for the
sensor_datatable."
The InfluxDB documentation MCP server lets AI tools and agents search InfluxDB {{% product-name %}} documentation directly from your development environment. Use it to find answers, code examples, and configuration details without leaving your IDE.
When you connect the documentation MCP server to your AI coding assistant, the assistant can search InfluxDB and related tool documentation to answer your questions with accurate, up-to-date information. Instead of switching to a browser or guessing at syntax, you can ask questions in your IDE and get responses grounded in official documentation.
Common use cases:
The documentation MCP server is a hosted service—you don't need to install or run anything locally. Add the server URL to your AI assistant's MCP configuration.
[!Note] On first use, you'll be prompted to sign in with Google. This authentication is used only for rate limiting—no personal data is collected.
MCP server URL:
https://influxdb-docs.mcp.kapa.ai
The server uses SSE (Server-Sent Events) transport.
The following instructions show how to configure popular AI assistants to use the InfluxDB documentation MCP server.
{{< tabs-wrapper >}} {{% tabs %}} Claude Desktop ChatGPT Desktop GitHub Copilot (VS Code) Cursor OpenCode {{% /tabs %}} {{% tab-content %}}
<!----------------------------- BEGIN CLAUDE DESKTOP ---------------------------->In Claude Desktop, go to Settings > Developer and edit your configuration. Add the following JSON configuration:
{
"mcpServers": {
"influxdb-docs": {
"url": "https://influxdb-docs.mcp.kapa.ai"
}
}
}
Save the file and restart Claude Desktop for the changes to take effect.
<!----------------------------- END CLAUDE DESKTOP ---------------------------->{{% /tab-content %}} {{% tab-content %}}
<!----------------------------- BEGIN CHATGPT DESKTOP ---------------------------->In ChatGPT Desktop, go to Settings > Integrations > Enable MCP and add a new server. Add the following JSON configuration:
{
"mcpServers": {
"influxdb-docs": {
"url": "https://influxdb-docs.mcp.kapa.ai",
"transport": "sse"
}
}
}
Save the configuration and restart ChatGPT Desktop.
<!----------------------------- END CHATGPT DESKTOP ---------------------------->{{% /tab-content %}} {{% tab-content %}}
<!----------------------------- BEGIN GITHUB COPILOT ---------------------------->In VS Code, configure GitHub Copilot to use the MCP server:
.vscode/mcp.json in your workspace or project directory{
"servers": {
"influxdb-docs": {
"type": "http",
"url": "https://influxdb-docs.mcp.kapa.ai"
}
}
}
Ctrl+Shift+P or Cmd+Shift+P)The InfluxDB documentation MCP server will now be available through GitHub Copilot Chat.
<!----------------------------- END GITHUB COPILOT ---------------------------->{{% /tab-content %}} {{% tab-content %}}
<!----------------------------- BEGIN CURSOR ---------------------------->In Cursor, add the MCP server configuration to your MCP settings file.
.cursor/mcp.json (project-level) or ~/.cursor/mcp.json (global):{
"mcpServers": {
"influxdb-docs": {
"url": "https://influxdb-docs.mcp.kapa.ai",
"transport": "streamableHttp"
}
}
}
Save the file and restart Cursor.
<!----------------------------- END CURSOR ---------------------------->{{% /tab-content %}} {{% tab-content %}}
<!----------------------------- BEGIN OPENCODE ---------------------------->In OpenCode, configure the MCP server in your configuration file:
opencode.json (or opencode.jsonc) in your workspace{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"influxdb-docs": {
"type": "remote",
"url": "https://influxdb-docs.mcp.kapa.ai",
"enabled": true
}
}
}
/init command to verify the MCP server is accessibleThe InfluxDB documentation search tools will be available in your OpenCode sessions.
<!----------------------------- END OPENCODE ---------------------------->{{% /tab-content %}} {{< /tabs-wrapper >}}
When you connect to the documentation MCP server for the first time, a Google sign-in window opens to complete an OAuth/OpenID Connect login.
The hosted MCP server:
openid scope from Googleemail or profile scopes—your name, email address, and other
personal data are not collectedThe anonymous Google ID enforces per-user rate limits to prevent abuse:
[!Tip] On Google's consent screen, this appears as "Associate you with your personal info on Google." This is Google's generic wording for the
openidscope—it means the app can recognize that the same Google account is signing in again. It does not grant access to your email, name, contacts, or other data.
The documentation MCP server exposes a semantic search tool:
search_influxdb_knowledge_sources
This tool lets AI agents perform semantic retrieval over InfluxDB documentation and related knowledge sources.
What the tool does:
Response format:
Each result includes:
source_url: URL of the original documentation pagecontent: The chunk content in Markdown{{< img-hd src="/img/influxdb3/core-mcp-influxdb3-plugin.png" alt="MCP tool search results showing InfluxDB documentation" />}}
After you install the documentation MCP server, your AI assistant can search InfluxDB documentation to help you with tasks. Ask questions naturally—the assistant uses the MCP server to find relevant documentation and provide accurate answers.
"How do I write data to InfluxDB using Python?"
"What's the syntax for a SQL query with a WHERE clause in InfluxDB?"
"Show me how to configure Telegraf to collect CPU metrics."
"What environment variables does the InfluxDB CLI use?"
"How do I create a database token with read-only permissions?"