nette/mcp-inspector

🔭 MCP server for Nette application introspection

Installs: 8

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/nette/mcp-inspector

dev-master / 1.0.x-dev 2026-01-05 03:25 UTC

This package is auto-updated.

Last update: 2026-01-05 03:25:58 UTC


README

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

Installation

With Claude Code and the Nette plugin:

/install-mcp-inspector

Or manually:

composer require nette/mcp-inspector

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

Available Tools

DI Container

Tool Description
di_get_services List all registered services with types and autowiring info
di_get_service Get details of a specific service (factory, setup calls, tags)

Database

Tool Description
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)

Router

Tool Description
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")

Configuration

Create mcp-config.neon in your project root (optional):

# Path to Bootstrap file (defaults to app/Bootstrap.php)
bootstrap: app/Bootstrap.php

# Bootstrap class name (defaults to App\Bootstrap)
bootstrapClass: App\Bootstrap

# Custom toolkits
toolkits:
    - App\Mcp\MyCustomToolkit

Creating Custom Toolkits

use Mcp\Capability\Attribute\McpTool;
use Nette\McpInspector\Toolkit;
use Nette\McpInspector\Bridge\BootstrapBridge;

class MyToolkit implements Toolkit
{
    public function __construct(
        private BootstrapBridge $bridge,
    ) {}

    /**
     * Tool description from PHPDoc.
     * @param string $param Parameter description
     */
    #[McpTool(name: 'my_tool')]
    public function myMethod(string $param): array
    {
        return ['result' => 'data'];
    }
}

Register in mcp-config.neon:

toolkits:
    - App\Mcp\MyToolkit

Standalone Usage

CLI Mode

php vendor/bin/mcp-inspector

HTTP Mode

Copy www/mcp-inspector.php to your web root for HTTP-based MCP access.

Manual MCP Configuration

If not using the Nette plugin, add to your project's .mcp.json:

{
    "mcpServers": {
        "nette-inspector": {
            "command": "php",
            "args": ["vendor/bin/mcp-inspector"]
        }
    }
}

Requirements

  • PHP 8.2+
  • Nette Framework 3.2+