Time-series database
## InfluxDB MCP Server: Time Series Database The **InfluxDB MCP Server** integrates InfluxDB into Google Antigravity, enabling time series data operations with high-performance writes, Flux queries, and real-time analytics directly from your development environment. ### Why InfluxDB MCP? - **Time Series Optimized**: Purpose-built for time-stamped data - **High Write Performance**: Millions of points per second - **Flux Language**: Powerful functional query language - **Downsampling**: Automatic data retention and aggregation - **Visualization**: Built-in dashboards and alerts ### Key Features #### 1. Flux Queries ```python # Query time series data result = await mcp.query(""" from(bucket: "metrics") |> range(start: -1h) |> filter(fn: (r) => r._measurement == "cpu") |> filter(fn: (r) => r.host == "server-01") |> aggregateWindow(every: 5m, fn: mean) |> yield(name: "cpu_usage") """) for table in result: for record in table.records: print(f"{record.get_time()}: {record.get_value()}%") ``` #### 2. Write Operations ```python # Write single point await mcp.write( bucket="metrics", record={ "measurement": "cpu", "tags": {"host": "server-01", "region": "us-east"}, "fields": {"usage": 45.2, "temperature": 65.0}, "time": datetime.utcnow() } ) # Batch write await mcp.write_batch( bucket="metrics", records=[ {"measurement": "cpu", "tags": {...}, "fields": {...}}, {"measurement": "memory", "tags": {...}, "fields": {...}}, {"measurement": "disk", "tags": {...}, "fields": {...}} ] ) ``` #### 3. Bucket Management ```python # Create bucket bucket = await mcp.create_bucket( name="app-metrics", retention_rules=[ {"every_seconds": 86400 * 30} # 30 days ] ) # List buckets buckets = await mcp.list_buckets() for b in buckets: print(f"Bucket: {b['name']} - Retention: {b['retentionRules']}") ``` #### 4. Task Automation ```python # Create downsampling task await mcp.create_task( name="downsample_cpu", flux=""" option task = {name: "downsample_cpu", every: 1h} from(bucket: "metrics") |> range(start: -1h) |> filter(fn: (r) => r._measurement == "cpu") |> aggregateWindow(every: 5m, fn: mean) |> to(bucket: "metrics_downsampled") """ ) ``` ### Configuration ```json { "mcpServers": { "influxdb": { "command": "npx", "args": ["-y", "@anthropic/mcp-influxdb"], "env": { "INFLUXDB_URL": "http://localhost:8086", "INFLUXDB_TOKEN": "your-api-token", "INFLUXDB_ORG": "your-org", "INFLUXDB_BUCKET": "default" } } } } ``` ### Use Cases **Infrastructure Monitoring**: Track server and container metrics. **IoT Analytics**: Store and analyze sensor data. **Application Metrics**: Monitor application performance. **Financial Data**: Track stock prices and trading data. The InfluxDB MCP enables time series operations within your development environment.
{
"mcpServers": {
"influxdb": {
"mcpServers": {
"influxdb": {
"env": {
"INFLUX_ORG": "your-org",
"INFLUX_URL": "http://localhost:8086",
"INFLUX_TOKEN": "your-token"
},
"args": [
"-y",
"influxdb-mcp-server"
],
"command": "npx"
}
}
}
}
}