spx-mcp-server
Web-only MCP server for php-spx reports that calls embedded SPX web endpoints, parses full reports, and returns LLM-sized JSON summaries instead of raw event streams.
README
SPX MCP Server
Web-only MCP server for php-spx reports. It calls the embedded SPX web endpoints, parses the full report, and returns LLM-sized JSON summaries instead of raw event streams.
Prerequisites
- Node.js 20 or newer
- An application with the
spxPHP extension enabled for HTTP profiling - SPX HTTP access configured, for example:
spx.http_enabled=1
spx.http_key="dev"
spx.http_ip_whitelist="127.0.0.1"
Build
npm install
npm run build
The built stdio entry point is:
/path/to/spx-mcp-server/dist/index.js
Set these environment variables in your agent config, or pass them per tool call:
SPX_BASE_URL=http://localhost
SPX_KEY=dev
Install In Codex CLI
Edit ~/.codex/config.toml and add:
[mcp_servers.spx]
command = "node"
args = ["/path/to/spx-mcp-server/dist/index.js"]
env = { SPX_BASE_URL = "http://localhost", SPX_KEY = "dev" }
Restart Codex CLI after editing the file.
Install In Claude Code
Local project config:
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
User-wide config:
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
Verify:
claude mcp list
claude mcp get spx
Equivalent .mcp.json project config:
{
"mcpServers": {
"spx": {
"type": "stdio",
"command": "node",
"args": ["/path/to/spx-mcp-server/dist/index.js"],
"env": {
"SPX_BASE_URL": "http://localhost",
"SPX_KEY": "dev"
}
}
}
}
Install In Cline
Cline is a popular open-source VS Code agent with MCP support.
For Cline CLI, run:
cline mcp
Then add a local stdio server with:
name: spx
command: node
args: /path/to/spx-mcp-server/dist/index.js
env:
SPX_BASE_URL=http://localhost
SPX_KEY=dev
For the VS Code extension, open the Cline MCP Servers settings and add this 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": []
}
}
}
Install In OpenClaw
OpenClaw is an open-source personal agent/gateway that can manage outbound MCP servers under mcp.servers.
Edit ~/.openclaw/openclaw.json or the file pointed to by 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",
},
},
},
},
}
Check the saved config:
openclaw mcp status --verbose
openclaw mcp probe spx
Basic Workflow
- Call
profile_urlfor the web URL you want to profile. - Call
list_reports. - Pick the newest matching report.
- Call
analyze_reportorget_hot_paths.
Tools
profile_url: sends one HTTP request with SPX cookies enabled.list_reports: reads?SPX_UI_URI=/data/reports/metadata.get_report_metadata: reads one report metadata JSON.analyze_report: downloads and parses?SPX_UI_URI=/data/reports/get/<key>.get_hot_paths: returns the most expensive call paths.get_function_profile: returns one function's aggregate and callers/callees.get_raw_events: returns a paginated debug slice of raw events.
The analyzer limits output by default. Large SPX reports can contain millions of events, so full raw report output is intentionally not exposed as a normal tool result. get_raw_events is capped at 1000 events per call and is intended for debugging parser or analyzer behavior.
References
- Claude Code MCP configuration: https://code.claude.com/docs/en/mcp
- Cline MCP configuration: https://github.com/cline/cline/blob/main/docs/mcp/mcp-overview.mdx
- OpenClaw MCP configuration: https://docs.openclaw.ai/gateway/configuration-reference
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。