spx-mcp-server
Provides tools for profiling PHP applications using the SPX extension, enabling AI agents to profile URLs, list and analyze SPX reports, and retrieve hot paths and function profiles.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@spx-mcp-server profile the homepage of my Laravel app"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 profilingSPX HTTP access configured, for example:
spx.http_enabled=1
spx.http_key="dev"
spx.http_ip_whitelist="127.0.0.1"Related MCP server: otel-mcp
Build
npm install
npm run buildThe built stdio entry point is:
/path/to/spx-mcp-server/dist/index.jsSet these environment variables in your agent config, or pass them per tool call:
SPX_BASE_URL=http://localhost
SPX_KEY=devInstall 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.jsUser-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.jsVerify:
claude mcp list
claude mcp get spxEquivalent .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 mcpThen 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=devFor 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 spxBasic 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
Available Tools
7 toolsanalyze_reportC
Download, decompress if needed, parse, and aggregate one SPX full report.
Inputs: key (required), limit, metric, spxKey, +3 more.
get_function_profileC
Return aggregate, callers, callees, and hot paths for a function name substring.
Inputs: key (required), functionQuery (required), limit, metric, +4 more.
get_hot_pathsD
Return only the hottest call paths for one SPX report.
Inputs: key (required), limit, metric, spxKey, +3 more.
get_raw_eventsA
Return a paginated debug slice of raw SPX events. This never returns the full report.
Inputs: key (required), limit, offset, spxKey, +3 more.
get_report_metadataC
Get metadata JSON for one SPX report key.
Inputs: key (required), spxKey, baseUrl, timeoutMs.
list_reportsB
List SPX report metadata from the embedded web UI data endpoint.
Inputs: spxKey, baseUrl, timeoutMs.
profile_urlB
Profile one web request by sending SPX cookies to the target URL.
Inputs: url (required), depth, method, spxKey, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: profile_url initiates profiling, list_reports lists metadata, get_report_metadata retrieves specific metadata, analyze_report aggregates full data, get_hot_paths extracts hot paths, get_function_profile provides function-level analysis, and get_raw_events returns raw events. There is no ambiguity between them.
All tool names follow a consistent verb_noun pattern in lowercase snake_case (e.g., profile_url, list_reports, get_hot_paths). The verbs are clear and the naming is predictable throughout.
With 7 tools, the server is well-scoped for a profiling/analysis domain. Each tool covers a necessary operation without bloat, and the count is ideal for an agent to manage.
The tool set covers the core workflow: starting a profile, listing reports, retrieving metadata, performing full analysis, and extracting specific insights. Minor gaps exist (e.g., no explicit tool to stop a profile or delete reports), but these are likely outside the server's intended scope, and the remaining tools form a cohesive surface.
Maintenance
Related MCP Connectors
Unified 15-tool SEO, SERP, clean Markdown & GEO (LLM citation Share-of-Voice) MCP server.
MCP server for web extraction and rendering via AceDataCloud WebExtrator
Hosted MCP server: render any URL to print-stable PDF, PNG, WebP or Markdown
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceAn 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.511 npm2MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that exposes Symfony profiler runtime data (requests, queries, logs) to AI agents like Claude Code for debugging and optimization.MIT
- AlicenseNot gradedqualityDmaintenanceRemote MCP server that normalizes OpenTelemetry GenAI spans by mapping fields, provider attributes, and missing attributes, and exports dashboard schemas.MIT