PHPackages                             nette/mcp-inspector - 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. nette/mcp-inspector

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nette/mcp-inspector
===================

🔭 MCP server for Nette application introspection

52.7k↑20.5%PHPCI failing

Since Jun 19Pushed 2w ago2 watchersCompare

[ Source](https://github.com/nette/mcp-inspector)[ Packagist](https://packagist.org/packages/nette/mcp-inspector)[ RSS](/packages/nette-mcp-inspector/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Nette MCP Inspector
===================

[](#nette-mcp-inspector)

MCP (Model Context Protocol) server for Nette application introspection. Allows AI assistants to inspect your Nette application's DI container, database schema, routing, and more.

[![image](https://private-user-images.githubusercontent.com/194960/531792349-35a314bb-065b-486f-8e58-972bdb45516c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODMwMDE0MTUsIm5iZiI6MTc4MzAwMTExNSwicGF0aCI6Ii8xOTQ5NjAvNTMxNzkyMzQ5LTM1YTMxNGJiLTA2NWItNDg2Zi04ZTU4LTk3MmJkYjQ1NTE2Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNzAyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDcwMlQxNDA1MTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01Yjc0ZjJkOTVlOTZmN2JlYWRmYTdiZTg1NWI0MTc0NDJjYWQ4ZmYxMzhmNmUyOTUyZmE1MTRmNGQzYmViMzkzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.NYdlwocmAT1kBjdV9UuYrG1ld9W3K90l9f8isa-XAt8)](https://private-user-images.githubusercontent.com/194960/531792349-35a314bb-065b-486f-8e58-972bdb45516c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODMwMDE0MTUsIm5iZiI6MTc4MzAwMTExNSwicGF0aCI6Ii8xOTQ5NjAvNTMxNzkyMzQ5LTM1YTMxNGJiLTA2NWItNDg2Zi04ZTU4LTk3MmJkYjQ1NTE2Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNzAyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDcwMlQxNDA1MTVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01Yjc0ZjJkOTVlOTZmN2JlYWRmYTdiZTg1NWI0MTc0NDJjYWQ4ZmYxMzhmNmUyOTUyZmE1MTRmNGQzYmViMzkzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.NYdlwocmAT1kBjdV9UuYrG1ld9W3K90l9f8isa-XAt8)> ⚠️ **Development tool only.** Inspector exposes the project's full DI graph and configuration (sensitive keys are masked on a best-effort basis only). It refuses to start against an application running in production mode; override with `MCP_INSPECTOR_ALLOW_PRODUCTION=1` only if you fully understand the exposure.

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

[](#installation)

With [Claude Code](https://claude.com/product/claude-code) and the [Nette plugin](https://github.com/nette/claude-code):

```
/install-mcp-inspector

```

Or manually:

```
composer require nette/mcp-inspector
```

After installation, restart Claude Code session to activate the MCP server.

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

[](#available-tools)

### DI Container

[](#di-container)

ToolDescription`di_get_services`List all registered services as name → type, filterable`di_get_service`Get details of a specific service (type, tags, instantiation status)`di_get_parameter_names`List all parameter names (nested values flattened to dotted notation)`di_get_parameter`Read a single parameter by name (sensitive masking, Windows path normalization)`di_get_aliases`List service aliases as alias → canonical name map`di_find_by_tag`Find services by tag`di_find_by_type`Find services implementing a type/interface (with autowired flag)### Database

[](#database)

ToolDescription`db_get_tables`List all database tables`db_get_columns`Get columns of a specific table (types, nullable, primary key, foreign keys)`db_get_relationships`Get foreign key relationships between all tables (belongsTo, hasMany)`db_get_indexes`Get indexes for a table`db_explain_query`Run EXPLAIN on a SELECT query (read-only, safe)`db_generate_entity`Generate PHP entity class code for a table### Router

[](#router)

ToolDescription`router_get_routes`List all registered routes with masks and defaults`router_match_url`Match URL to presenter/action (e.g., "/article/123")`router_generate_url`Generate URL for presenter/action (e.g., "Article:show")### Tracy Debugger

[](#tracy-debugger)

ToolDescription`tracy_get_last_exception`Get last logged exception with details`tracy_get_exceptions`List recent exception files`tracy_get_exception`Get full details of a specific exception by HTML filename`tracy_get_warnings`Get recent PHP warnings`tracy_get_log`Get entries from any Tracy log levelConfiguration
-------------

[](#configuration)

The inspector requires a single file in your project root: **`mcp-bootstrap.php`**. It must `return` a `Closure` that produces a fully built `Nette\DI\Container`. The script is responsible for requiring its own autoloader.

### Live config reload

[](#live-config-reload)

The bridge invokes the closure on **every** tool call, so config edits in `common.neon`, `services.neon`, etc. are picked up live — no need to restart Claude Code or the MCP server. Nette caches the compiled container on disk and reuses it when configs are unchanged, so the per-call overhead is just a metadata check and a `require`.

In auto-rebuild mode (debug), Nette also handles the long-running-process case where PHP cannot redeclare an already-loaded class: when configs change, Nette generates a uniquely-named copy of the new container into memory via `eval()` (gated behind `autoRebuild=true`, never used in production). This requires `nette/di` ≥ 3.2 with the live-reload patch.

If a rebuild fails (e.g. a typo in your config), the bridge keeps serving the last-known-good container and adds a `_warning` field to tool results so you immediately see the failure message and the container source.

### Standard skeleton

[](#standard-skeleton)

For Nette Web Project where `App\Bootstrap::boot()` is static:

```
