Skip to main content
Glama
szepeviktor

spx-mcp-server

by szepeviktor

SPX MCP 服务器

专为 php-spx 报告设计的纯 Web MCP 服务器。它调用嵌入的 SPX Web 端点,解析完整报告,并返回适合 LLM 的 JSON 摘要,而非原始事件流。

前提条件

  • Node.js 20 或更新版本

  • 一个启用了 spx PHP 扩展以进行 HTTP 性能分析的应用程序

  • 已配置 SPX HTTP 访问,例如:

spx.http_enabled=1
spx.http_key="dev"
spx.http_ip_whitelist="127.0.0.1"

Related MCP server: otel-mcp

构建

npm install
npm run build

构建后的 stdio 入口点为:

/path/to/spx-mcp-server/dist/index.js

在您的代理配置中设置这些环境变量,或在每次工具调用时传递它们:

SPX_BASE_URL=http://localhost
SPX_KEY=dev

在 Codex CLI 中安装

编辑 ~/.codex/config.toml 并添加:

[mcp_servers.spx]
command = "node"
args = ["/path/to/spx-mcp-server/dist/index.js"]
env = { SPX_BASE_URL = "http://localhost", SPX_KEY = "dev" }

编辑文件后重启 Codex CLI。

在 Claude Code 中安装

本地项目配置:

claude mcp add --transport stdio --scope project \
  --env SPX_BASE_URL=http://localhost \
  --env SPX_KEY=dev \
  spx -- node /path/to/spx-mcp-server/dist/index.js

用户级配置:

claude mcp add --transport stdio --scope user \
  --env SPX_BASE_URL=http://localhost \
  --env SPX_KEY=dev \
  spx -- node /path/to/spx-mcp-server/dist/index.js

验证:

claude mcp list
claude mcp get spx

等效的 .mcp.json 项目配置:

{
  "mcpServers": {
    "spx": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/spx-mcp-server/dist/index.js"],
      "env": {
        "SPX_BASE_URL": "http://localhost",
        "SPX_KEY": "dev"
      }
    }
  }
}

在 Cline 中安装

Cline 是一个流行的开源 VS Code 代理,支持 MCP。

对于 Cline CLI,运行:

cline mcp

然后添加一个本地 stdio 服务器:

name: spx
command: node
args: /path/to/spx-mcp-server/dist/index.js
env:
  SPX_BASE_URL=http://localhost
  SPX_KEY=dev

对于 VS Code 扩展,打开 Cline MCP 服务器设置并添加此 JSON:

{
  "mcpServers": {
    "spx": {
      "command": "node",
      "args": ["/path/to/spx-mcp-server/dist/index.js"],
      "env": {
        "SPX_BASE_URL": "http://localhost",
        "SPX_KEY": "dev"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

在 OpenClaw 中安装

OpenClaw 是一个开源的个人代理/网关,可以在 mcp.servers 下管理出站 MCP 服务器。

编辑 ~/.openclaw/openclaw.json 或由 OPENCLAW_CONFIG_PATH 指向的文件:

{
  mcp: {
    servers: {
      spx: {
        command: "node",
        args: ["/path/to/spx-mcp-server/dist/index.js"],
        env: {
          SPX_BASE_URL: "http://localhost",
          SPX_KEY: "dev",
        },
      },
    },
  },
}

检查已保存的配置:

openclaw mcp status --verbose
openclaw mcp probe spx

基本工作流程

  1. 为您想要进行性能分析的 Web URL 调用 profile_url

  2. 调用 list_reports

  3. 选择最新的匹配报告。

  4. 调用 analyze_reportget_hot_paths

工具

  • profile_url:发送一个启用了 SPX cookie 的 HTTP 请求。

  • list_reports:读取 ?SPX_UI_URI=/data/reports/metadata

  • get_report_metadata:读取一个报告元数据 JSON。

  • analyze_report:下载并解析 ?SPX_UI_URI=/data/reports/get/<key>

  • get_hot_paths:返回最昂贵的调用路径。

  • get_function_profile:返回一个函数的聚合信息及调用者/被调用者。

  • get_raw_events:返回一个分页的原始事件调试切片。

分析器默认限制输出。大型 SPX 报告可能包含数百万个事件,因此完整的原始报告输出故意不作为常规工具结果暴露。get_raw_events 每次调用最多返回 1000 个事件,旨在用于调试解析器或分析器行为。

参考

Install Server
A
license - permissive license
B
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    B
    maintenance
    An MCP server that converts Windows WPR .etl performance traces into structured JSON summaries and flamegraph-ready data for LLM analysis. It bridges Windows Performance Analyzer automation with LLM reasoning capabilities for performance troubleshooting.
    1
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    MCP server that gives AI agents access to your application's OpenTelemetry traces for querying, analysis, and debugging.
    5
    26
    2
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    Remote MCP server that normalizes OpenTelemetry GenAI spans by mapping fields, provider attributes, and missing attributes, and exports dashboard schemas.
    MIT

View all related MCP servers

Related MCP Connectors

  • Remote MCP for GenAI span mapping, provider normalization, dashboard schemas, and receipts.

  • MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.

  • AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/szepeviktor/spx-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server