mcp-server-axiom-js

mcp-server-axiom-js

@Axiom 的 mcp-server-axiom 的一个兼容 npx 的移植版本

远程shell执行
数据库交互
AI集成系统
访问服务器

Tools

queryApl

# Instructions 1. Query Axiom datasets using Axiom Processing Language (APL). The query must be a valid APL query string. 2. ALWAYS get the schema of the dataset before running queries rather than guessing. You can do this by getting a single event and projecting all fields. 3. Keep in mind that there's a maximum row limit of 65000 rows per query. 4. Prefer aggregations over non aggregating queries when possible to reduce the amount of data returned. 5. Be selective in what you project in each query (unless otherwise needed, like for discovering the schema). It's expensive to project all fields. 6. ALWAYS restrict the time range of the query to the smallest possible range that meets your needs. This will reduce the amount of data scanned and improve query performance. 7. NEVER guess the schema of the dataset. If you don't where something is, use search first to find in which fields it appears. # Examples Basic: - Filter: ['logs'] | where ['severity'] == "error" or ['duration'] > 500ms - Time range: ['logs'] | where ['_time'] > ago(2h) and ['_time'] < now() - Project rename: ['logs'] | project-rename responseTime=['duration'], path=['url'] Aggregations: - Count by: ['logs'] | summarize count() by bin(['_time'], 5m), ['status'] - Multiple aggs: ['logs'] | summarize count(), avg(['duration']), max(['duration']), p95=percentile(['duration'], 95) by ['endpoint'] - Dimensional: ['logs'] | summarize dimensional_analysis(['isError'], pack_array(['endpoint'], ['status'])) - Histograms: ['logs'] | summarize histogram(['responseTime'], 100) by ['endpoint'] - Distinct: ['logs'] | summarize dcount(['userId']) by bin_auto(['_time']) Search & Parse: - Search all: search "error" or "exception" - Parse logs: ['logs'] | parse-kv ['message'] as (duration:long, error:string) with (pair_delimiter=",") - Regex extract: ['logs'] | extend errorCode = extract("error code ([0-9]+)", 1, ['message']) - Contains ops: ['logs'] | where ['message'] contains_cs "ERROR" or ['message'] startswith "FATAL" Data Shaping: - Extend & Calculate: ['logs'] | extend duration_s = ['duration']/1000, success = ['status'] < 400 - Dynamic: ['logs'] | extend props = parse_json(['properties']) | where ['props.level'] == "error" - Pack/Unpack: ['logs'] | extend fields = pack("status", ['status'], "duration", ['duration']) - Arrays: ['logs'] | where ['url'] in ("login", "logout", "home") | where array_length(['tags']) > 0 Advanced: - Make series: ['metrics'] | make-series avg(['cpu']) default=0 on ['_time'] step 1m by ['host'] - Join: ['errors'] | join kind=inner (['users'] | project ['userId'], ['email']) on ['userId'] - Union: union ['logs-app*'] | where ['severity'] == "error" - Fork: ['logs'] | fork (where ['status'] >= 500 | as errors) (where ['status'] < 300 | as success) - Case: ['logs'] | extend level = case(['status'] >= 500, "error", ['status'] >= 400, "warn", "info") Time Operations: - Bin & Range: ['logs'] | where ['_time'] between(datetime(2024-01-01)..now()) - Multiple time bins: ['logs'] | summarize count() by bin(['_time'], 1h), bin(['_time'], 1d) - Time shifts: ['logs'] | extend prev_hour = ['_time'] - 1h String Operations: - String funcs: ['logs'] | extend domain = tolower(extract("://([^/]+)", 1, ['url'])) - Concat: ['logs'] | extend full_msg = strcat(['level'], ": ", ['message']) - Replace: ['logs'] | extend clean_msg = replace_regex("(password=)[^&]*", "\1***", ['message']) Common Patterns: - Error analysis: ['logs'] | where ['severity'] == "error" | summarize error_count=count() by ['error_code'], ['service'] - Status codes: ['logs'] | summarize requests=count() by ['status'], bin_auto(['_time']) | where ['status'] >= 500 - Latency tracking: ['logs'] | summarize p50=percentile(['duration'], 50), p90=percentile(['duration'], 90) by ['endpoint'] - User activity: ['logs'] | summarize user_actions=count() by ['userId'], ['action'], bin(['_time'], 1h)

listDatasets

List all available Axiom datasets

getDatasetInfoAndSchema

Get dataset info and schema

README

用于 Axiom 的 MCP 服务器

这是一个 官方 Axiom MCP 服务器 的 JavaScript 端口,它使 AI 代理能够使用 Axiom Processing Language (APL) 查询数据。

<a href="https://glama.ai/mcp/servers/8hxxw8uenu"> <img width="380" height="200" src="https://glama.ai/mcp/servers/8hxxw8uenu/badge" /> </a>

此实现提供与原始 Go 版本相同的功能,但打包为 npm 模块,以便更轻松地与 Node.js 环境集成。

安装与使用

MCP 配置

您可以使用 npx 直接运行此 MCP 服务器。将以下配置添加到您的 MCP 配置文件:

{
  "axiom": {
    "command": "npx",
    "args": ["-y", "mcp-server-axiom"],
    "env": {
      "AXIOM_TOKEN": "<在此处填写 AXIOM_TOKEN>",
      "AXIOM_URL": "https://api.axiom.co",
      "AXIOM_ORG_ID": "<在此处填写 AXIOM_ORG_ID>"
    }
  }
}

本地开发与测试

安装

npm install -g mcp-server-axiom

环境变量

可以使用环境变量配置服务器:

  • AXIOM_TOKEN (必需): 您的 Axiom API 令牌
  • AXIOM_ORG_ID (必需): 您的 Axiom 组织 ID
  • AXIOM_URL (可选): 自定义 Axiom API URL (默认为 https://api.axiom.co)
  • AXIOM_QUERY_RATE (可选): 每秒查询次数限制 (默认: 1)
  • AXIOM_QUERY_BURST (可选): 查询突发容量 (默认: 1)
  • AXIOM_DATASETS_RATE (可选): 每秒数据集列表操作次数 (默认: 1)
  • AXIOM_DATASETS_BURST (可选): 数据集列表突发容量 (默认: 1)
  • PORT (可选): 服务器端口 (默认: 3000)

在本地运行服务器

  1. 使用环境变量:
export AXIOM_TOKEN=your_token
mcp-server-axiom
  1. 使用配置文件:
mcp-server-axiom config.json

示例 config.json:

{
  "token": "your_token",
  "url": "https://custom.axiom.co",
  "orgId": "your_org_id",
  "queryRate": 2,
  "queryBurst": 5,
  "datasetsRate": 1,
  "datasetsBurst": 2
}

API 接口

  • GET /: 获取服务器实现信息
  • GET /tools: 列出可用工具
  • POST /tools/:name/call: 调用特定工具
    • 可用工具:
      • queryApl: 执行 APL 查询
      • listDatasets: 列出可用数据集

示例工具调用

  1. 查询 APL:
curl -X POST http://localhost:3000/tools/queryApl/call \
  -H "Content-Type: application/json" \
  -d '{
    "arguments": {
      "query": "['logs'] | where ['severity'] == \"error\" | limit 10"
    }
  }'
  1. 列出数据集:
curl -X POST http://localhost:3000/tools/listDatasets/call \
  -H "Content-Type: application/json" \
  -d '{
    "arguments": {}
  }'

许可证

MIT

推荐服务器

Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
AIO-MCP Server

AIO-MCP Server

🚀 集成了 AI 搜索、RAG 和多服务(GitLab/Jira/Confluence/YouTube)的一体化 MCP 服务器,旨在增强 AI 驱动的开发工作流程。来自 Folk。

精选
本地
Knowledge Graph Memory Server

Knowledge Graph Memory Server

为 Claude 实现持久性记忆,使用本地知识图谱,允许 AI 记住用户的信息,并可在自定义位置存储,跨对话保持记忆。

精选
本地
Hyperbrowser

Hyperbrowser

欢迎来到 Hyperbrowser,人工智能的互联网。Hyperbrowser 是下一代平台,旨在增强人工智能代理的能力,并实现轻松、可扩展的浏览器自动化。它专为人工智能开发者打造,消除了本地基础设施和性能瓶颈带来的麻烦,让您能够:

精选
本地
https://github.com/Streen9/react-mcp

https://github.com/Streen9/react-mcp

react-mcp 与 Claude Desktop 集成,能够根据用户提示创建和修改 React 应用程序。

精选
本地
MCP Atlassian

MCP Atlassian

适用于 Atlassian Cloud 产品(Confluence 和 Jira)的 Model Context Protocol (MCP) 服务器。此集成专为 Atlassian Cloud 实例设计,不支持 Atlassian Server 或 Data Center 部署。

精选