spx-mcp-server
SPX MCP 服务器
专为 php-spx 报告设计的纯 Web MCP 服务器。它调用嵌入的 SPX Web 端点,解析完整报告,并返回适合 LLM 的 JSON 摘要,而非原始事件流。
前提条件
Node.js 20 或更新版本
一个启用了
spxPHP 扩展以进行 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基本工作流程
为您想要进行性能分析的 Web URL 调用
profile_url。调用
list_reports。选择最新的匹配报告。
调用
analyze_report或get_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 个事件,旨在用于调试解析器或分析器行为。
参考
Claude Code MCP 配置:https://code.claude.com/docs/en/mcp
Cline MCP 配置:https://github.com/cline/cline/blob/main/docs/mcp/mcp-overview.mdx
OpenClaw MCP 配置:https://docs.openclaw.ai/gateway/configuration-reference
Maintenance
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
- Alicense-qualityBmaintenanceAn 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.1MIT
- AlicenseAqualityDmaintenanceMCP server that gives AI agents access to your application's OpenTelemetry traces for querying, analysis, and debugging.5262MIT
- Alicense-qualityBmaintenanceMCP server that exposes Symfony profiler runtime data (requests, queries, logs) to AI agents like Claude Code for debugging and optimization.MIT
- Alicense-qualityDmaintenanceRemote MCP server that normalizes OpenTelemetry GenAI spans by mapping fields, provider attributes, and missing attributes, and exports dashboard schemas.MIT
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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