Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mcp Profiler Bundle Laravel Package

killerwolf/mcp-profiler-bundle

A Symfony bundle that adds MCP (Model Context Protocol) profiling to the Web Profiler, providing a dedicated panel to inspect MCP requests, tool calls, responses, and timing for easier debugging and performance tuning.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Read the deprecation notice first — 0.2.1 is the final release. The maintainer has explicitly stopped work: no upstream fixes, no new tool coverage, no PHP 8.5+ support. The only code change in 0.2.1 is an explicit nullable type in MCPDataCollector::collect() for PHP 8.4 (#13), plus CI/cs-fixer housekeeping. There are no behavioural changes, so 0.2.0 and 0.2.1 behave identically for you.

  • Decide your horizon before installing. For a greenfield project in 2025+, go straight to Symfony AI Mate and skip this bundle entirely. Install this bundle only if you want the capability today with a migration already scheduled, or you're pinned to an existing project. Either way, open the migration ticket on day one.

  • Install as a dev-only dependency and pin it:

    composer require --dev killerwolf/mcp-profiler-bundle:0.2.1
    

    Confirm the bundle is registered in config/bundles.php (Flex usually does this; if not, add it manually). Never enable it in prod — the whole point is exposing profiler dumps, which contain SQL, cookies and headers.

  • Make sure the Symfony profiler is actually collecting in dev (framework.profiler.collect: true, web_profiler enabled for the toolbar/token links).

  • Find the server entry point before touching any AI client config:

    php bin/console list | grep -i mcp
    

    The bundle registers a console command — mcp:server:run — that starts the MCP server. Run it manually once to see whether it speaks stdio or HTTP; that determines how you register it with your client.

  • Register it with your agent. For Claude Code that's .mcp.json in the project root; for Cursor it's .mcp.json / .cursor/mcp.json. Typical shape:

    {
      "mcpServers": {
        "symfony-profiler": {
          "command": "php",
          "args": ["/abs/path/to/bin/console", "mcp:server:run", "--env=dev"]
        }
      }
    }
    

    Use an absolute path to bin/console — MCP clients launch the process from an unpredictable working directory.

  • First use case: stop copy-pasting profiler URLs. Ask the agent "list the last few requests", pick the one for /checkout, then "for that token, show the slowest queries and the time spent in the Doctrine collector." That single loop — reproduce in a browser, inspect via the agent — is where the bundle pays for itself.

  • Know the exit path before you start. The README's migration is four commands and a cleanup:

    composer require --dev symfony/ai-mate
    vendor/bin/mate init
    composer require --dev symfony/ai-symfony-mate-extension symfony/ai-monolog-mate-extension
    vendor/bin/mate discover
    

    Then composer remove killerwolf/mcp-profiler-bundle, drop its line from config/bundles.php, and delete the mcp:server:run entry from your MCP client config. Mate installs Agent Skills for your coding agent (listed in the README) rather than exposing raw MCP tools, so your prompting style will shift slightly.

  • Where to look when something is off: the bundle's README for the exact tool names it exposes, then vendor/killerwolf/mcp-profiler-bundle/src/ for the tool/resource classes. The data itself comes from Symfony's standard profiler storage, so anything you know about the profiler applies.

Implementation Patterns

  • Agent-generates-its-own-traffic. The highest-leverage workflow: instruct the agent to curl -s -D - http://localhost:8000/some/page (or run a functional test), capture the X-Debug-Token response header, and then query that token through the MCP tools. The agent closes the loop without you in the middle — reproduce, profile, diagnose, patch.
  • Collector-scoped questions. Vague prompts ("why is this slow?") burn tokens on giant dumps. Ask for one collector at a time: Doctrine queries over N ms, timeline events, cache calls, HTTP client calls. Narrow questions get narrow, useful answers.
  • Add a rule to CLAUDE.md / .cursor/rules. Something like: "When asked about performance or a 500 in dev, use the profiler MCP tools to inspect the actual request instead of guessing from code." Without this, agents default to reading source files and speculating.
  • Pair it with a seed/scenario script. Have a bin/repro script that hits the routes you care about, so profiling is repeatable and the agent can regenerate a profile on demand instead of hunting through the last 50 requests.
  • Keep a stable tool vocabulary in your prompts. Since the migration to Mate is now certain, never bake tool names into docs, scripts or CLAUDE.md. Refer to capabilities ("the profiler server's request/query tools") and let the agent resolve names. This is the single cheapest thing you can do to make the swap painless.
  • Wrap the integration in one place. Put the MCP server definition in a template/script (bin/mcp-config.sh or a stubbed .mcp.json) rather than hand-editing per developer. When you migrate, you regenerate instead of chasing four teammates' stale configs.
  • Do the migration as a branch, not a big-bang. Because both tools read the same profiler storage, you can run Mate alongside this bundle for a day: install Mate, keep mcp:server:run registered, verify the skills surface the same answers for your top three questions, then delete the old entry.
  • Docker/DDEV: the server must run inside the container. Register ddev exec php bin/console mcp:server:run (or docker compose exec php ...) as the MCP command; a host-side php won't see the app.
  • Scope the server per project. One MCP entry per app root, with --env=dev explicit. Sharing a single entry across repos leads to tokens from the wrong app.

Gotchas and Tips

  • Deprecation is the real pitfall, and it's now terminal. 0.2.1 is the last version. There will be no fix if a future Symfony release breaks the collector or the MCP SDK moves. Pin 0.2.1 in composer.json, treat a Symfony major upgrade as the trigger for migration, and keep the integration surface thin so the swap is an afternoon, not a rewrite.
  • No behavioural delta in 0.2.1. Don't ship the bump expecting changes. The only functional commit is the PHP 8.4 nullable-type fix — relevant only if you're on 8.4 and saw deprecations from MCPDataCollector::collect(). Everything else is README and CI.
  • The migration is not 1:1 tooling. Mate ships Agent Skills (plus extension packages for Symfony and Monolog collectors) rather than a generic JSON-RPC tool list. If you built prompt templates or scripts around specific tool names from this bundle, they will not carry over verbatim — plan for prompt rewrites, not just a config swap.
  • No token, no profile. Only profiled requests exist. CLI commands, streamed responses, and anything with the profiler disabled (collect: false, when@dev guards, web_profiler off) simply won't be there. Check for the X-Debug-Token header before blaming the MCP server.
  • Storage purges. The default file profiler storage indexes and prunes. Profiles from an hour ago may be gone; re-run the request rather than debugging "missing" tokens.
  • stdio framing breaks on stray output. A dump(), a var_dump, or a chatty bundle writing to stdout corrupts JSON-RPC. If the client says "server exited" or "invalid JSON", run the command manually and inspect stdout vs stderr.
  • Restart the server after changing config or bundle code. MCP clients spawn the process once; container/config changes and cache warmups won't be picked up until you restart it.
  • Data exposure. Profiler dumps include SQL with parameters, session data, cookies, and auth headers. That content goes into your model provider's context. Keep this strictly dev, don't point it at staging with real data, and be deliberate about client-side auto-approve settings for tool calls. Note this cuts both ways at migration time: your Mate replacement will have the same exposure profile, so the rules you write now stay useful.
  • Token budget. Full collector dumps are enormous. Cap list results, ask for counts and top-N, and avoid "dump the whole profile" prompts.
  • Extension point worth knowing: register your own DataCollector for app-specific metrics. If the bundle reads collectors generically (check src/ — it likely does), custom data surfaces through the same tools for free. If it hardcodes a list, that's your fork point. Either way, custom collectors carry over to Mate unchanged, since both read Symfony's collector API.
  • Debugging the server itself: pipe a minimal JSON-RPC initialize followed by tools/list into php bin/console mcp:server:run --env=dev and read the response. That tells you immediately whether the problem is the transport, the client config, or the tools.
  • Removal checklist, verbatim from the release: composer remove killerwolf/mcp-profiler-bundle → delete the line in config/bundles.php → delete the mcp:server:run entry from your MCP client config. Miss the third step and your agent keeps trying to spawn a binary that no longer exists, which surfaces as a confusing "server failed to start" rather than a missing-package error.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
cgv/localized-resource