# influxdb-mcp-server

> MCP Server

This repository provides an MCP server for accessing InfluxDB using the OSS API v2, offering resources, tools, and prompts for managing and querying data within an InfluxDB instance.

## Overview

- **Category:** Database
- **Language:** JavaScript
- **Stars:** 44
- **Forks:** 0
- **Owner:** idoru
- **GitHub:** https://github.com/idoru/influxdb-mcp-server
- **Created:** 2025-03-11T05:24:06+00:00
- **Updated:** 2025-03-27T08:33:18+00:00
- **Source:** https://model-context-protocol.com/servers/influxdb-mcp-server-query-data-access

## Setup

## Setup

**Option 1: Run with npx (recommended)**

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

**Option 2: Install globally**

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

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

**Option 3: From source**

```bash
# 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
```

**Integration with Claude for Desktop**

Add the server to your `claude_desktop_config.json`:

**Using npx (recommended)**

```json
{
  "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**

```json
{
  "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"
      }
    }
  }
}
```

## Tools

## Available Tools

1.  Resources: Access to organization, bucket, and measurement data.
2.  Tools: Write data, execute queries, and manage database objects.
3.  Prompts: Templates for common Flux queries and Line Protocol format.
4.  `write-data`: Write time-series data in line protocol format.
5.  `query-data`: Execute Flux queries.
6.  `create-bucket`: Create a new bucket.
7.  `create-org`: Create a new organization.
8.  `flux-query-examples`: Common Flux query examples.
9.  `line-protocol-guide`: Guide to InfluxDB line protocol format.
