Download the PHP package codemonkey/spx-mcp-server without Composer

On this page you can find all versions of the php package codemonkey/spx-mcp-server. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package spx-mcp-server

Experimental PHP SPX MCP Server 🚀

An MCP (Model Context Protocol) server for Laravel applications that brings the power of PHP SPX profiler to Claude Code. Analyze PHP application performance with AI assistance, getting intelligent insights into bottlenecks, memory usage, database queries, and more.

License PHP Version

🎯 What is This?

The PHP SPX MCP Server is a bridge between the powerful PHP SPX profiler and Claude Code (or any MCP-compatible AI client). It enables you to:

Instead of manually digging through profiler data, simply ask Claude: "What's causing the slowest response times?" or "Are there any N+1 query issues?"

🛠️ Prerequisites

PHP SPX Extension

You must have the PHP SPX extension installed and configured. Please refer to the official installation instructions at:

https://github.com/NoiseByNorthwest/php-spx

Important: Make sure to configure the spx.data_dir setting in your php.ini. This is where SPX will store profile data, and the MCP server needs to read from this location.

Example configuration:

📦 Installation

Install the SPX MCP Server via Composer in your Laravel project:

⚙️ Configuration

Configure with Claude Code

The easiest way to configure the MCP server with Claude Code is using the built-in installation command:

This will automatically add the SPX MCP server to your Claude Code configuration.

Manual Configuration

Alternatively, you can manually add the server to your Claude Code configuration file (~/.config/claude-code/config.json):

Environment Variables

You can customize the SPX MCP server behavior using environment variables in your .env file:

You can also publish the configuration file for more control:

🎮 Usage

1. Generate SPX Profiles

Generate performance profiles by triggering SPX during your application requests. Add the SPX trigger to your request URL:

Or use the SPX web UI to control profiling: http://your-app.test/?SPX_KEY=dev&SPX_UI_URI=/

Profiles will be saved to your configured spx.data_dir.

2. Analyze with Claude Code

Once you have generated profiles, open Claude Code and start asking questions:

Example queries:

Claude will use the MCP tools to parse your SPX profiles and provide intelligent analysis and recommendations.

🧰 Available MCP Tools

The SPX MCP server provides the following analysis tools:

Tool Description
list_profiles List all available SPX profiles
get_slowest_functions Get functions with highest exclusive execution time
get_most_called_functions Get most frequently called functions
get_memory_hogs Get functions using the most memory
get_cpu_intensive_functions Get CPU-intensive functions
get_call_tree Get hierarchical call tree structure
get_timeline_view Get chronological execution timeline
get_recursive_functions Identify recursive function calls
get_wall_time_distribution Analyze I/O vs CPU time distribution
get_autoloading_overhead Analyze autoloading performance impact
get_third_party_package_impact Analyze third-party package performance
get_database_queries Analyze database operations and detect N+1 queries
get_redis_operations Analyze Redis/cache operations
get_io_operations Analyze file, network, and socket I/O
get_middleware_analysis Analyze middleware execution order and timing

📊 Example Analysis

🏗️ How It Works

  1. Profile Generation: PHP SPX profiles your application and stores detailed execution traces
  2. Profile Parsing: The MCP server reads and parses SPX profile files (compressed .txt.gz format)
  3. Data Analysis: Profiles are analyzed to extract metrics like execution time, memory, call counts, etc.
  4. MCP Tools: Analysis results are exposed as MCP tools that Claude can invoke
  5. AI Insights: Claude uses the tools to answer your questions and provide recommendations

🔧 Development

Running Tests

Project Structure

🐛 Troubleshooting

SPX profiles not being created?

MCP server not connecting?

No profiles showing in Claude?

📝 License

This package is open-sourced software licensed under the MIT license.

🙏 Credits

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


Made with ❤️ by developers who hate performance issues


All versions of spx-mcp-server with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
laravel/mcp Version ^0.5.0
ext-zlib Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package codemonkey/spx-mcp-server contains the following files

Loading the files please wait ...