PHPackages                             alya/symfony-inspector-mcp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. alya/symfony-inspector-mcp

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

alya/symfony-inspector-mcp
==========================

MCP Server for Symfony Introspection

v1.0.0(2mo ago)13[1 issues](https://github.com/alya-labs/symfony-inspector-mcp/issues)MITPHPPHP &gt;=8.2

Since Feb 25Pushed 2mo agoCompare

[ Source](https://github.com/alya-labs/symfony-inspector-mcp)[ Packagist](https://packagist.org/packages/alya/symfony-inspector-mcp)[ Docs](https://github.com/TON_USER/symfony-inspector-mcp)[ RSS](/packages/alya-symfony-inspector-mcp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (13)Versions (2)Used By (0)

Symfony Inspector MCP
=====================

[](#symfony-inspector-mcp)

A Symfony Bundle that exposes your application's internals as a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server. Connect LLM agents (Claude Desktop, Cursor, Windsurf) directly to your running Symfony app and ask questions like:

- *"What routes handle POST requests to /api?"*
- *"Show me the last 50 lines of the dev log and explain the exception."*

---

What it does
------------

[](#what-it-does)

Symfony Inspector MCP registers an MCP server inside your Symfony application. Tools and resources let an AI agent introspect your app without leaving the chat:

- List and filter routes, services, and event listeners
- Inspect Doctrine entity mappings
- Read application logs
- Run whitelisted console commands and tests
- Show bundle/extension configuration

---

Installation
------------

[](#installation)

```
composer require --dev alya/symfony-inspector-mcp
```

Register the bundle **only for the `dev` environment** in `config/bundles.php`:

```
return [
    // ...
    Alya\SymfonyInspectorMcp\SymfonyInspectorMcpBundle::class => ['dev' => true],
];
```

> **Security**: the bundle throws a `LogicException` at container build time if it is accidentally enabled outside of `dev`.

---

Configuration
-------------

[](#configuration)

Create `config/packages/mcp_inspector.yaml`:

```
mcp_inspector:
    transport: stdio
    allowed_commands:
        - cache:clear
        - list
        - doctrine:mapping:info
    log_file: '%kernel.logs_dir%/%kernel.environment%.log'
    log_tail_lines: 200
```

Create (or extend) `config/packages/mcp.yaml`:

```
mcp:
    client_transports:
        stdio: true
        http: false
```

---

Usage with Claude Desktop
-------------------------

[](#usage-with-claude-desktop)

Add the following to your `claude_desktop_config.json`:

```
{
  "mcpServers": {
    "my-symfony-app": {
      "command": "/usr/bin/php",
      "args": [
        "/absolute/path/to/your/project/bin/console",
        "mcp:server"
      ]
    }
  }
}
```

Replace `/absolute/path/to/your/project` with the real path. Restart Claude Desktop after saving.

---

Available Tools
---------------

[](#available-tools)

ToolDescription`list_routes`Lists all registered routes (name, path, methods, controller).`list_services`Lists container services. Accepts an optional `filter` string.`show_config`Shows resolved config for a bundle/extension (e.g. `"framework"`, `"doctrine"`). Accepts an optional `path` sub-key.`list_events`Lists event dispatcher listeners. Accepts an optional `event` name filter (e.g. `"kernel.request"`).`inspect_entity`Inspects a Doctrine entity — mapping info + source code. Requires `doctrine/orm`.`read_logs`Reads the last N lines of the application log. Accepts an optional `lines` count.`run_console`Executes a whitelisted Symfony console command (see `allowed_commands`).`run_tests`Runs PHPUnit tests and returns output.---

Available Resources
-------------------

[](#available-resources)

URIDescription`symfony://routes`Full route collection as JSON.`symfony://entities`List of Doctrine entity classes.`symfony://logs/latest`Latest N lines from the application log file.`symfony://config/{name}`Resolved configuration for a bundle or extension (e.g. `symfony://config/framework`).`symfony://migrations/status`Doctrine Migrations status output. Requires `doctrine/migrations`.---

Requirements
------------

[](#requirements)

- PHP 8.2+
- Symfony 6.4, 7.x, or 8.x
- `doctrine/orm` ^3.0 (optional — required only for `inspect_entity` and `symfony://entities`)
- `doctrine/migrations` (optional — required only for `symfony://migrations/status`)

---

Security
--------

[](#security)

- **Dev-only enforcement**: the bundle's DI extension throws at container compilation time if `kernel.environment` is not `dev`. There is no silent fallback.
- **Command whitelist**: `run_console` only executes commands explicitly listed in `mcp_inspector.allowed_commands`. Any unlisted command returns an error message.
- **No network exposure**: the default transport is `stdio`, meaning the MCP server communicates only through standard input/output of your console process — no port is opened.

---

Contributing
------------

[](#contributing)

Pull requests are welcome. Please open an issue first to discuss significant changes.

```
cd symfony-inspector-mcp
composer install
vendor/bin/phpunit
```

---

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance65

Regular maintenance activity

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

76d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/af6f25b7f5c475974b8b668aead4765938bc787a69951a9b2b23d77c13a124f9?d=identicon)[AlyaLabs](/maintainers/AlyaLabs)

---

Tags

symfonybundlemcpinspector

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alya-symfony-inspector-mcp/health.svg)

```
[![Health](https://phpackages.com/badges/alya-symfony-inspector-mcp/health.svg)](https://phpackages.com/packages/alya-symfony-inspector-mcp)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[pentatrion/vite-bundle

Vite integration for your Symfony app

2725.3M13](/packages/pentatrion-vite-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
