npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@flinkhouse/server-influxdb

v0.1.1

Published

MCP server for InfluxDB access

Downloads

23

Readme

@modelcontextprotocol/server-influxdb

这是一个MCP服务器,为LLM提供InfluxDB 1.x访问能力。

特性

  • 执行InfluxQL查询
  • 写入数据点
  • 管理数据库
  • 管理保留策略
  • 检查InfluxDB服务器健康状态
  • 获取数据库架构信息
  • 用户管理

安装

npm install @modelcontextprotocol/server-influxdb

使用方法

启动服务器

mcp-server-influxdb <host:port> <username:password> [database]

参数:

  • <host:port>: InfluxDB服务器地址(例如 localhost:8086)
  • <username:password>: InfluxDB用户名和密码
  • [database]: 可选的默认数据库名称

示例:

mcp-server-influxdb localhost:8086 admin:password my_database

可用工具

mcp_influxdb_queryData

使用InfluxQL查询语言查询InfluxDB 1.x数据。

参数:

  • query (必需): InfluxQL查询语句
  • database (可选): 数据库名称(如果查询中未指定)

mcp_influxdb_writePoint

向InfluxDB 1.x写入单个数据点。

参数:

  • database (必需): 数据库名称
  • measurement (必需): 测量名称
  • fields (必需): 字段键值对
  • tags (可选): 标签键值对
  • timestamp (可选): 时间戳(毫秒)

mcp_influxdb_writePoints

向InfluxDB 1.x批量写入多个数据点。

参数:

  • database (必需): 数据库名称
  • points (必需): 数据点数组,每个点包含:
    • measurement: 测量名称
    • fields: 字段键值对
    • tags (可选): 标签键值对
    • timestamp (可选): 时间戳(毫秒)

mcp_influxdb_listDatabases

列出InfluxDB 1.x中的所有数据库。

参数:

  • name (可选): 根据名称筛选数据库

mcp_influxdb_createDatabase

在InfluxDB 1.x中创建新的数据库。

参数:

  • name (必需): 数据库名称
  • retentionPolicy (可选): 保留策略设置
    • name: 保留策略名称
    • duration: 保留时间(例如 "7d", "4w", "1h30m")
    • replication: 复制因子
    • isDefault: 是否为默认保留策略

mcp_influxdb_deleteDatabase

删除InfluxDB 1.x中的数据库。

参数:

  • name (必需): 要删除的数据库名称

mcp_influxdb_checkHealth

检查InfluxDB 1.x服务器的健康状态。

mcp_influxdb_getDatabaseSchema

获取InfluxDB 1.x数据库的架构信息。

参数:

  • database (必需): 数据库名称

mcp_influxdb_listUsers

列出InfluxDB 1.x中的所有用户。

参数:

  • name (可选): 根据名称筛选用户

mcp_influxdb_listRetentionPolicies

列出InfluxDB 1.x数据库的所有保留策略。

参数:

  • database (必需): 数据库名称

mcp_influxdb_createRetentionPolicy

为InfluxDB 1.x数据库创建新的保留策略。

参数:

  • database (必需): 数据库名称
  • name (必需): 保留策略名称
  • duration (必需): 保留时间(例如 "7d", "4w", "1h30m")
  • replication (可选): 复制因子,默认为1
  • isDefault (可选): 是否为默认保留策略,默认为false

mcp_influxdb_alterRetentionPolicy

修改InfluxDB 1.x数据库的保留策略。

参数:

  • database (必需): 数据库名称
  • name (必需): 保留策略名称
  • duration (可选): 保留时间(例如 "7d", "4w", "1h30m")
  • replication (可选): 复制因子
  • isDefault (可选): 是否为默认保留策略

mcp_influxdb_dropRetentionPolicy

删除InfluxDB 1.x数据库的保留策略。

参数:

  • database (必需): 数据库名称
  • name (必需): 保留策略名称

示例

查询数据

// 从weather数据库的temperature测量中查询最近10个数据点
{
  "query": "SELECT * FROM temperature ORDER BY time DESC LIMIT 10",
  "database": "weather"
}

写入数据点

// 向weather数据库写入一个温度数据点
{
  "database": "weather",
  "measurement": "temperature",
  "tags": {
    "location": "office",
    "sensor": "A001"
  },
  "fields": {
    "value": 22.5,
    "humidity": 45.2
  }
}

创建数据库

// 创建一个带有保留策略的数据库
{
  "name": "weather_data",
  "retentionPolicy": {
    "name": "one_month",
    "duration": "30d",
    "replication": 1,
    "isDefault": true
  }
}

InfluxDB 1.x 和 2.x 的区别

本工具专为InfluxDB 1.x设计,与2.x版本的主要区别包括:

  1. 查询语言:1.x使用InfluxQL,而2.x引入了Flux查询语言
  2. 身份验证:1.x使用用户名/密码认证,2.x使用令牌认证
  3. 数据组织:1.x使用数据库和保留策略,2.x使用桶(bucket)概念
  4. API接口:API端点和交互方式存在显著差异

注意事项

  • 确保你的InfluxDB 1.x服务器允许从执行此MCP服务器的主机进行连接
  • 对于大量数据的查询,请考虑使用LIMIT子句以避免性能问题
  • 时间戳以毫秒为单位(自Unix纪元以来的毫秒数)

许可证

MIT