InfluxDB MCP Server

Integrations

  • Provides templates and execution capabilities for Flux queries, which is the query language for InfluxDB, allowing for data querying and transformation operations.

  • Exposes access to an InfluxDB instance using the InfluxDB OSS API v2, allowing for organization and bucket management, measurement data access, writing time-series data, and executing Flux queries against the database.

InfluxDB MCP 서버

InfluxDB OSS API v2를 사용하여 InfluxDB 인스턴스에 대한 액세스를 제공하는 모델 컨텍스트 프로토콜(MCP) 서버입니다. 대부분 Claude Code로 구축되었습니다.

특징

이 MCP 서버는 다음을 제공합니다.

  • 리소스 : 조직, 버킷 및 측정 데이터에 대한 액세스
  • 도구 : 데이터 쓰기, 쿼리 실행, 데이터베이스 객체 관리
  • 프롬프트 : 일반적인 Flux 쿼리 및 라인 프로토콜 형식에 대한 템플릿

자원

서버는 다음과 같은 리소스를 제공합니다.

  1. 조직 목록 : influxdb://orgs
    • InfluxDB 인스턴스의 모든 조직을 표시합니다.
  2. 버킷 리스트 : influxdb://buckets
    • 모든 버킷을 메타데이터와 함께 표시합니다.
  3. 버킷 측정 : influxdb://bucket/{bucketName}/measurements
    • 지정된 버킷 내의 모든 측정값을 나열합니다.
  4. 쿼리 데이터 : influxdb://query/{orgName}/{fluxQuery}
    • Flux 쿼리를 실행하고 결과를 리소스로 반환합니다.

도구

서버는 다음과 같은 도구를 제공합니다.

  1. write-data : 라인 프로토콜 형식으로 시계열 데이터를 씁니다.
    • 매개변수: org, bucket, data, precision(선택 사항)
  2. query-data : Flux 쿼리 실행
    • 매개변수: org, 쿼리
  3. create-bucket : 새로운 버킷을 생성합니다
    • 매개변수: name, orgID, retentionPeriodSeconds(선택 사항)
  4. create-org : 새로운 조직을 만듭니다
    • 매개변수: 이름, 설명(선택 사항)

프롬프트

서버는 다음과 같은 프롬프트 템플릿을 제공합니다.

  1. flux-query-examples : 일반적인 Flux 쿼리 예시
  2. line-protocol-guide : InfluxDB 라인 프로토콜 형식 가이드

구성

서버에는 다음과 같은 환경 변수가 필요합니다.

  • INFLUXDB_TOKEN (필수): InfluxDB API에 대한 인증 토큰
  • INFLUXDB_URL (선택 사항): InfluxDB 인스턴스의 URL(기본값은 http://localhost:8086 )
  • INFLUXDB_ORG (선택 사항): 특정 작업에 대한 기본 조직 이름

설치

옵션 1: npx로 실행(권장)

지엑스피1

옵션 2: 글로벌 설치

# Install globally npm install -g influxdb-mcp-server # Run the server INFLUXDB_TOKEN=your_token influxdb-mcp-server

옵션 3: 소스에서

# 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

데스크톱용 Claude와 통합

claude_desktop_config.json 에 서버를 추가합니다.

npx 사용(권장)

{ "mcpServers": { "influxdb": { "command": "npx", "args": ["influxdb-mcp-server"], "env": { "INFLUXDB_TOKEN": "your_token", "INFLUXDB_URL": "http://localhost:8086", "INFLUXDB_ORG": "your_org" } } } }

로컬로 설치된 경우

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

코드 구조

서버 코드는 모듈형 구조로 구성됩니다.

  • src/
    • index.js - 메인 서버 진입점
    • config/ - 구성 관련 파일
      • env.js - 환경 변수 처리
    • utils/ - 유틸리티 함수
      • influxClient.js - InfluxDB API 클라이언트
      • loggerConfig.js - 콘솔 로거 구성
    • handlers/ - 리소스 및 도구 핸들러
      • organizationsHandler.js - 조직 목록
      • bucketsHandler.js - 버킷 목록
      • measurementsHandler.js - 측정 목록
      • queryHandler.js - 쿼리 실행
      • writeDataTool.js - 데이터 쓰기 도구
      • queryDataTool.js - 쿼리 도구
      • createBucketTool.js - 버킷 생성 도구
      • createOrgTool.js - 조직 생성 도구
    • prompts/ - 프롬프트 템플릿
      • fluxQueryExamplesPrompt.js - Flux 쿼리 예제
      • lineProtocolGuidePrompt.js - 라인 프로토콜 가이드

이러한 구조는 더 나은 유지 관리, 더 쉬운 테스트, 그리고 더 명확한 관심사 분리를 가능하게 합니다.

테스트

저장소에는 다음과 같은 포괄적인 통합 테스트가 포함되어 있습니다.

  • InfluxDB로 Docker 컨테이너를 시작하세요
  • 샘플 데이터로 채우세요
  • 모든 MCP 서버 기능 테스트

테스트를 실행하려면:

npm test

특허

MIT

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Claude가 InfluxDB 시계열 데이터베이스 인스턴스에 액세스할 수 있도록 하는 모델 컨텍스트 프로토콜 서버로, 자연어를 통해 조직과 버킷의 데이터 쓰기, 쿼리, 관리를 지원합니다.

  1. Features
    1. Resources
      1. Tools
        1. Prompts
          1. Configuration
            1. Installation
              1. Option 1: Run with npx (recommended)
              2. Option 2: Install globally
              3. Option 3: From source
            2. Integration with Claude for Desktop
              1. Using npx (recommended)
              2. If installed locally
            3. Code Structure
              1. Testing
                1. License
                  ID: 9bo1fbiook