InfluxDB MCP Server
InfluxDB MCP サーバー
JWT 認証を介して InfluxDB 1.8 への安全な読み取り専用アクセスを提供するモデル コンテキスト プロトコル (MCP) サーバー。
概要
InfluxDB MCPサーバーは、AIアシスタントが標準化されたインターフェースを介してInfluxDBに保存された時系列データにクエリを実行できるようにします。JWTトークンによる認証により、InfluxDBインスタンスへの読み取り専用アクセスを提供します。
Related MCP server: MCP Auth Server
前提条件
ドッカー
InfluxDB 1.8 インスタンス (すでに実行中)
InfluxDBインスタンスの認証情報
インストール
リポジトリをクローンします:
git clone https://github.com/m4tyn0/influx_mcp cd influxdb-mcp-server設定を含む**
.envファイルを作成します**。cp env.example .envINFLUXDB_HOST= INFLUXDB_PORT=8086 INFLUXDB_USERNAME= INFLUXDB_PASSWORD= INFLUXDB_SSL=false INFLUXDB_VERIFY_SSL=true INFLUXDB_TIMEOUT=10 JWT_SECRET= JWT_ALGORITHM=HS256Docker コンテナをビルドして実行します。
docker build -t influxdb-mcp-server . docker run -d --env-file .env -p 8000:8000 influxdb-mcp-server
JWT認証
サーバーは認証にJWTトークンを使用します。MCPサーバーで認証するにはトークンを生成する必要があります。そのための簡単なスクリプトを以下に示します。
import jwt
import datetime
# Create a token
payload = {
"sub": "username", # Replace with the username you want to identify with
"iat": datetime.datetime.utcnow(),
"exp": datetime.datetime.utcnow() + datetime.timedelta(hours=1)
}
token = jwt.encode(payload, "your-jwt-secret", algorithm="HS256")
print(token)このトークンを MCP クライアントで使用するために保存します。
MCPクライアントでの使用
JWT トークンを使用して MCP サーバーで認証します。
Tool: auth Arguments: {"token": "your.jwt.token.here"}InfluxDB データのクエリ:
Tool: list_databases Arguments: {}Tool: list_measurements Arguments: {"database": "your_database_name"}Tool: query Arguments: { "database": "your_database_name", "query": "SELECT * FROM measurement_name LIMIT 10" }
トラブルシューティング
問題が発生した場合:
InfluxDBへの接続エラー:
INFLUXDB_HOST が正しく、Docker コンテナからアクセスできることを確認します。
InfluxDBの認証情報が正しいことを確認してください
InfluxDBインスタンスが外部ホストからの接続を受け入れるように設定されていることを確認します。
認証の問題:
JWT_SECRETが正しく設定されていることを確認してください
使用しているトークンがJWT_SECRETと一致しており、期限が切れていないことを確認してください。
InfluxDBの認証情報にデータベースへの読み取りアクセス権があることを確認します
ログを確認してください:
docker logs
セキュリティノート
MCPサーバーはInfluxDBインスタンスへの読み取り専用アクセスのみを許可します
すべてのクエリはSELECTで始まることを確認するために検証されます
JWT認証はMCPサーバーへのアクセスを保護します
セキュリティ強化のため、プライベートネットワークでサーバーを実行することを検討してください。
ご協力ありがとうございました。コードに問題がある場合や、もっと何か作ってほしいものがあれば、 m4tyn0@gmail.comまでご連絡ください。
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only MCP server for The Quiet Protocol's engines, benchmarks, proof, and business data.
Model Context Protocol server for Studex tools, notifications, and profile integrations
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
A Model Context Protocol server for Wix AI tools
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that provides Claude with access to InfluxDB time-series database instances, enabling data writing, querying, and management of organizations and buckets through natural language.41,268 npm46MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server with HTTP transport that implements JWT authentication, allowing secure tool execution and prompt handling with role-based access control.62-
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server for Grafana data analysis28 npm46MIT
- AlicenseNot gradedqualityDmaintenanceA selective, aggregation-first MCP server for InfluxDB v2 that bounds output and pushes reduction to the database, avoiding context flooding from raw time-series data.MIT