spx-mcp-server

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.

Category
Visit Server

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 spx PHP 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

  1. Call profile_url for the web URL you want to profile.
  2. Call list_reports.
  3. Pick the newest matching report.
  4. Call analyze_report or get_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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured