symfony-agent-mcp
symfony-agent-mcp
Features • Quick Start • Integration • Usage • Documentation • Contributing • License
Ein produktionsreifer Model Context Protocol (MCP)-Server für Symfony-Anwendungen. Gibt KI-Assistenten tiefe, schreibgeschützte Einblicke in Ihre gesamte Symfony-Codebasis – Routen, Controller, Dienste, Entitäten, Datenbankschema, Migrationen, Ereignisse, Formulare, Sicherheit, Doctrine, Messenger, Twig, API Platform und vieles mehr.
Client | Installation |
Claude Code | Ausführen: |
Claude Desktop | Hinzufügen zu |
Cursor | Hinzufügen zu |
VS Code Copilot | Hinzufügen zu |
Jeder MCP-Client | stdio-Transport, |
Funktionen
1,679 Tools in 16 Kategorien
Available tool categories (16 categories, 1,679 tools total, ~164,729 tokens if all active)
Category │ Tools │ Est. tokens │ Description
─────────────────┼────────────┼────────────────┼────────────────────────────────────────────────────────
symfony-core │ 549 tools │ ~ 53995 tokens │ Routes, services, controllers, events, commands, bundles, DI container, kernel
database │ 176 tools │ ~ 17121 tokens │ Entities, migrations, Doctrine ORM, relationships, query patterns, indexes, DBAL
security │ 133 tools │ ~ 13008 tokens │ Voters, firewalls, authenticators, JWT, OAuth, CSRF, access control, secrets vault
frontend │ 121 tools │ ~ 11568 tokens │ Twig, translations, asset mapper, Symfony UX, Turbo, live components, Webpack
testing │ 110 tools │ ~ 10559 tokens │ PHPUnit, Behat, Cypress, Playwright, Psalm, PHPStan, Rector, static analysis
integrations │ 106 tools │ ~ 10939 tokens │ Stripe, Slack, Sentry, Elasticsearch, Twilio, SendGrid, Mailgun, Datadog, OpenAI
serializer │ 91 tools │ ~ 9031 tokens │ Serializer, validation, forms, constraints, DTOs, transformers, normalizers
messaging │ 87 tools │ ~ 8455 tokens │ Messenger, notifier, webhooks, Mercure, mailer, transports, stamps, failure handling
api │ 68 tools │ ~ 6438 tokens │ API Platform, OpenAPI, GraphQL, REST patterns, versioning, rate limits, Nelmio
infrastructure │ 68 tools │ ~ 6794 tokens │ Docker, CI/CD, Kubernetes, Terraform, Helm, Nginx, serverless, cloud platforms
cache-sessions │ 62 tools │ ~ 5945 tokens │ Cache pools, HTTP cache, sessions, rate limiter, lock, cache warmers, OPcache
config │ 35 tools │ ~ 3157 tokens │ Environment config, framework settings, Monolog, CORS, locale, feature flags
code-quality │ 25 tools │ ~ 2447 tokens │ Profiler, dead code detection, dependency graph, accessibility, code metrics
cloud-aws │ 18 tools │ ~ 1945 tokens │ AWS S3, SES, Cognito, ECS, Lambda/Bref, Parameter Store, Secrets Manager, CloudFront
cloud-other │ 16 tools │ ~ 1851 tokens │ Azure Blob/Pipelines, Google Cloud Run/Storage, Firebase, DigitalOcean, Consul
queues │ 14 tools │ ~ 1476 tokens │ RabbitMQ, Kafka, SQS FIFO/DLQ, Pusher, Redis pub/sub and streams
To activate a category: call activate_category(category: "<key>")
To search for specific tools: call search_tools(query: "what you want to do")Sicherheit zuerst
Nur lesen – schreibt, ändert oder führt niemals etwas aus
Automatische Schwärzung – Passwörter, Tokens, API-Schlüssel und Datenbankanmeldeinformationen werden durch
[REDACTED]ersetzt, bevor Daten an die KI gelangenDLP-Pipeline – mehrschichtiger Data-Loss-Prevention-Scanner (Regex-Muster + strukturelle Erkennung für Kreditkarten, JWTs, SSH-Schlüssel, Cloud-Anmeldeinformationen usw.)
Pfadvalidierung – Directory-Traversal-Angriffe werden auf der Eingabeebene blockiert
Keine Codeausführung – PHP-Dateien werden statisch geparst (kein
eval, keine PHP-Laufzeit)Keine Netzwerkaufrufe – alle Daten stammen nur aus lokalen Dateien
Prompt-Injection-Filter – Tool-Ausgabe wird auf Injektionsmuster überprüft, bevor sie an die KI weitergeleitet wird
Related MCP server: Symfony Debug MCP Server
Schnellstart
Option A: npx (keine Installation erforderlich)
npx @shakaran/symfony-agent-mcpOption B: Globale Installation
npm install -g @shakaran/symfony-agent-mcp
symfony-agent-mcpOption C: Aus dem Quellcode
git clone https://github.com/shakaran/symfony-agent-mcp
cd symfony-agent-mcp
pnpm install
pnpm build
pnpm startSiehe GETTING_STARTED.md für eine Schritt-für-Schritt-Anleitung einschließlich Node.js-Einrichtung, Fehlerbehebung und Erstverwendung.
Integration
Ein-Klick-Installation
Client | Installation |
Cursor | |
VS Code | |
VS Code Insiders | |
Windsurf | |
Claude Code | |
Claude Desktop |
Claude Code
Führen Sie einmal aus, um den Server zu registrieren:
# npx (no local install required)
claude mcp add symfony -- npx @shakaran/symfony-agent-mcp
# Or from a local source build
claude mcp add symfony -- node /path/to/symfony-agent-mcp/dist/server.jsUm es global über alle Projekte verfügbar zu machen, fügen Sie das Flag --scope user hinzu:
claude mcp add --scope user symfony -- npx @shakaran/symfony-agent-mcpClaude Desktop
Fügen Sie es zu Ihrer Claude-Desktop-Konfigurationsdatei (claude_desktop_config.json) hinzu:
{
"mcpServers": {
"symfony": {
"command": "npx",
"args": ["@shakaran/symfony-agent-mcp"]
}
}
}Cursor
Fügen Sie es zu .cursor/mcp.json hinzu:
{
"symfony": {
"command": "npx",
"args": ["@shakaran/symfony-agent-mcp"]
}
}VS Code Copilot
Fügen Sie es zu .vscode/mcp.json hinzu:
{
"servers": {
"symfony": {
"type": "stdio",
"command": "npx",
"args": ["@shakaran/symfony-agent-mcp"]
}
}
}Verwendung
Jedes Tool akzeptiert einen app_path-Parameter, der auf das Wurzelverzeichnis Ihrer Symfony-Anwendung verweist:
list_routes(app_path: "/var/www/myapp")
→ Found 42 routes: GET /api/users [api_users], POST /login [app_login], …
get_entity_details(app_path: "/var/www/myapp", entity_name: "User")
→ Entity: User | Table: users
Properties: id (int, PK), email (string 180), isActive (bool)
Relationships: OneToMany → Post (author)
get_error_summary(app_path: "/var/www/myapp")
→ Last 24h: 3 CRITICAL, 12 ERROR, 47 WARNING
get_code_quality_report(app_path: "/var/www/myapp")
→ God classes: UserManager (1240 lines), dead services: 4, N+1 risks: 7Beispiel-Prompts, die Sie mit Claude verwenden können:
"Zeig mir alle Routen mit POST-Methoden und ihre Controller"
"Welche Dienste sind mit
doctrine.event_listenergetaggt?""Liste die letzten 50 Zeilen des Produktionsprotokolls auf"
"Gibt es zirkuläre Abhängigkeiten im Service-Container?"
"Welche Doctrine-Entitäten haben Beziehungen zu User?"
"Zeig mir die Migrationshistorie und alle destruktiven Migrationen"
"Welche Controller haben keine Sicherheitsattribute?"
Konfiguration
Die gesamte Konfiguration erfolgt über Umgebungsvariablen, die an den MCP-Serverprozess übergeben werden.
Tool-Erkennung
Variable | Standard | Beschreibung |
|
| Dynamische Tool-Erkennung aktivieren. Wenn |
|
| Maximale geschätzte Tokens, die pro Sitzung aktiviert werden können. Die Aktivierung wird blockiert, wenn dieses Limit überschritten würde; übergeben Sie |
Sicherheit & Zugriff
Variable | Standard | Beschreibung |
| (beliebig) | Durch Doppelpunkte getrennte Liste absoluter App-Pfade, die der Server untersuchen darf. Beispiel: |
|
| Setzen Sie auf |
| (alle) | Kommagetrennte Whitelist von Tool-Namen. Nur aufgeführte Tools sind aufrufbar. |
| (keine) | Kommagetrennte Blacklist. Hat Vorrang vor der Whitelist. |
| (aus) | Geheimnis mit 32+ Zeichen für die Anfragesignatur. Aktiviert die Authentifizierung pro Anfrage. |
| (aus) | Geheimnis für die Generierung von Sitzungstokens. |
| (aus) | Token zur Validierung eingehender Anfragen. |
|
| Setzen Sie auf |
|
| Gültigkeitsfenster des Sitzungstokens in Sekunden. |
Ratenbegrenzung
Variable | Standard | Beschreibung |
|
| Maximale Anfragen pro Fenster. Setzen Sie auf |
|
| Ratenbegrenzungsfenster in Millisekunden (1 Minute). |
|
| Maximale Burst-Anfragen in 1 Sekunde. |
Transport
Variable | Standard | Beschreibung |
| (aus) | Port für HTTP/SSE-Transport. Wenn gesetzt, startet einen HTTP-Server zusätzlich zu stdio. |
|
| Setzen Sie auf |
|
| Zeitlimit für die Ausführung pro Tool in Millisekunden. |
Beispiel: Claude Code mit deaktivierten dynamischen Tools
{
"mcpServers": {
"symfony": {
"command": "npx",
"args": ["@shakaran/symfony-agent-mcp"],
"env": {
"SYMFONY_MCP_DYNAMIC_TOOLS": "false"
}
}
}
}Beispiel: Token-Budget auf 80 000 Token erhöht
{
"mcpServers": {
"symfony": {
"command": "node",
"args": ["/path/to/symfony-agent-mcp/dist/server.js"],
"env": {
"SYMFONY_MCP_TOKEN_BUDGET": "80000"
}
}
}
}Lokale Installation (aus dem Quellcode)
Verwenden Sie dies, wenn Sie den Server aus einem lokalen Klon ausführen möchten (keine npm-Veröffentlichung erforderlich).
# 1. Clone the repo
git clone https://github.com/shakaran/symfony-agent-mcp
cd symfony-agent-mcp
# 2. Install dependencies (Node.js ≥ 22 required)
pnpm install # or: npm install
# 3. Build TypeScript → dist/
pnpm build # or: npm run build
# 4. Test the server responds
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | node dist/server.jsKonfigurieren Sie dann Ihren MCP-Client so, dass er auf die erstellte Datei verweist:
Claude Code (einmal ausführen):
claude mcp add symfony -- node /absolute/path/to/symfony-agent-mcp/dist/server.jsClaude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"symfony": {
"command": "node",
"args": ["/absolute/path/to/symfony-agent-mcp/dist/server.js"]
}
}
}VS Code (.vscode/mcp.json):
{
"servers": {
"symfony": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/symfony-agent-mcp/dist/server.js"]
}
}
}Tipp: Nach dem Neuerstellen (
pnpm build) starten Sie Ihren MCP-Client neu, um die Änderungen zu übernehmen.
Was es liest
Der Server liest Dateien direkt aus Ihrer Symfony-Anwendung – keine Datenbankverbindung, keine PHP-Laufzeit erforderlich:
config/routes.yaml,config/routes/*.yaml— YAML-RoutenPHP 8
#[Route]-Attribute an Controllern insrc/Controller/config/services.yaml— DI-Container-Servicesconfig/packages/*.yaml— Framework-, Sicherheits-, Doctrine-, Messenger- und Mailer-Konfigurationsrc/Entity/*.php— Doctrine-Entity-Dateien (PHP 8-Attribute + Annotationen)var/log/*.log— Anwendungs-Logsmigrations/,src/Migrations/— Doctrine-Migrationsdateiencomposer.json,composer.lock— Paketinformationen.env,.env.local,.env.*.local— Umgebungsvariablen (sensible Werte werden automatisch geschwärzt)
Symfony-Kompatibilität
Symfony | PHP | ORM-Mapping |
5.4 LTS | 8.0+ | Annotationen oder Attribute |
6.x | 8.0+ | Attribute |
7.x | 8.2+ | Attribute |
8.x | 8.2+ | Attribute |
Voraussetzungen
Node.js ≥ 22.0.0
pnpm ≥ 11.0.0 (oder npm/yarn für die Entwicklung)
Entwicklung
pnpm install
pnpm dev # watch mode (TypeScript → dist/)
pnpm test # run all tests
pnpm lint # ESLint
pnpm typecheck # tsc --noEmitSiehe DEVELOPMENT.md für den vollständigen Entwicklungsleitfaden: Architekturübersicht, Hinzufügen neuer Tools, Teststrategie und Beitragsrichtlinien.
Dokumentation
Dokument | Beschreibung |
Schritt-für-Schritt-Einrichtung, Node.js-Voraussetzungen, Fehlerbehebung | |
Systemdesign, Sicherheits-Pipeline, Komponentenübersicht, alle 1.679 Tools in 16 Kategorien dokumentiert | |
Entwicklungsworkflow, Hinzufügen von Tools, Testen, Mitwirken | |
Bedrohungsmodell, DLP-Pipeline, Richtlinie zur verantwortungsvollen Offenlegung | |
Versionshistorie und Roadmap | |
Allgemeine Projektübersicht und Statistiken |
Mitwirken
Issues und Pull-Requests sind willkommen unter github.com/shakaran/symfony-agent-mcp.
Bitte lesen Sie DEVELOPMENT.md, bevor Sie einen PR einreichen, und SECURITY.md für die Richtlinie zur verantwortungsvollen Offenlegung.
Lizenz
MIT © Ángel Guzmán Maeso
Available Tools
5 toolsactivate_categoryA
Activate all tools in a category for this session. After activation the MCP client will receive the full tool definitions on the next tools/list refresh. Use list_tool_categories to see available categories and their token costs. Pass force=true to override the token budget guard.
Inputs: category (required), force.
deactivate_categoryA
Remove a previously activated category from this session to free up context budget. Useful when switching between different areas of the codebase.
Inputs: category (required).
get_active_toolsA
Show which tool categories are currently active in this session, how many tools are exposed, and the estimated token cost. Use this to understand your current context budget.
Inputs: no named parameters.
list_tool_categoriesA
List all available tool categories with descriptions, tool counts, and estimated token cost. Use this first to understand what groups of tools exist before activating them. Only the categories you activate will be shown in subsequent tools/list calls.
Inputs: no named parameters.
search_toolsA
Search for specific tools by describing what you want to do. Returns the top matching tool definitions (name + description + input schema) ready to call immediately — no activation needed for one-off use. For repeated use of a group, call activate_category instead.
Inputs: query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: listing categories, searching tools, activating a category, viewing active categories, and deactivating. There is no overlap or ambiguity in their functions.
All tool names follow a consistent verb_noun snake_case pattern (list_tool_categories, search_tools, activate_category, get_active_tools, deactivate_category), making prediction and selection straightforward.
With 5 tools, the set is tightly scoped to the server's purpose of managing tool categories and sessions. Each tool serves a necessary role in the lifecycle without redundancy or bloat.
The surface covers the full lifecycle of tool category management: discovery (list/search), activation, status inquiry, and deactivation. No obvious gaps exist for the stated domain.
Maintenance
Related MCP Connectors
12 read-only MCP tools for AI communication rules, instruction linting & 25-model benchmarks.
Read-only discovery of ChatGXT's integration catalog and public MCP capabilities.
Read-only MCP tools for AI agent discovery, structured resources, and NIULAI information.
The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.
Related MCP Servers
- AlicenseAqualityDmaintenanceA production-ready Model Context Protocol (MCP) server that bridges your Symfony/PHP project with LLMs such as Claude. It exposes tools that let the AI read your project's routes, services, Twig templates, and PHP source code.8MIT
- FlicenseNot gradedqualityCmaintenanceEnables debugging Symfony applications by inspecting profiler data through a standalone MCP server.-
- AlicenseNot gradedqualityCmaintenanceMCP server that exposes Symfony profiler runtime data (requests, queries, logs) to AI agents like Claude Code for debugging and optimization.MIT
- AlicenseAqualityDmaintenanceProvides read-only, structurally safe introspection of a Laravel codebase, letting AI agents inspect routes, models, migrations, jobs, and config without risk of mutation or secret disclosure.8MIT