symfony-agent-mcp
symfony-agent-mcp
Features • Quick Start • Integration • Usage • Documentation • Contributing • License
Symfonyアプリケーション向けの本番対応Model Context Protocol (MCP)サーバーです。AIアシスタントに、Symfonyコードベース全体の深い読み取り専用のイントロスペクションを提供します — ルート、コントローラー、サービス、エンティティ、データベーススキーマ、マイグレーション、イベント、フォーム、セキュリティ、Doctrine、Messenger、Twig、API Platformなど、その他多数。
クライアント | インストール |
Claude Code |
|
Claude Desktop |
|
Cursor |
|
VS Code Copilot |
|
任意のMCPクライアント | stdioトランスポート、 |
機能
16カテゴリにわたる1,679のツール
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")セキュリティ最優先設計
読み取り専用 — 何も書き込んだり、変更したり、実行したりしません
自動編集 — パスワード、トークン、APIキー、データベース資格情報は、AIにデータが渡される前に
[REDACTED]に置き換えられますDLPパイプライン — 多層データ損失防止スキャナー(クレジットカード、JWT、SSHキー、クラウド資格情報などの正規表現パターン+構造検出)
パス検証 — ディレクトリトラバーサル攻撃は入力層でブロックされます
コード実行なし — PHPファイルは静的に解析されます(
evalなし、PHPランタイムなし)ネットワーク呼び出しなし — すべてのデータはローカルファイルのみから取得されます
プロンプトインジェクションフィルター — ツール出力はAIに転送される前にインジェクションパターンがスキャンされます
Related MCP server: Symfony Debug MCP Server
クイックスタート
オプションA: npx(インストール不要)
npx @shakaran/symfony-agent-mcpオプションB: グローバルにインストール
npm install -g @shakaran/symfony-agent-mcp
symfony-agent-mcpオプションC: ソースから
git clone https://github.com/shakaran/symfony-agent-mcp
cd symfony-agent-mcp
pnpm install
pnpm build
pnpm startNode.jsのセットアップ、トラブルシューティング、初回使用の検証を含むステップバイステップガイドは、GETTING_STARTED.mdを参照してください。
統合
ワンクリックインストール
クライアント | インストール |
Cursor | |
VS Code | |
VS Code Insiders | |
Windsurf | |
Claude Code | |
Claude Desktop |
Claude Code
サーバーを登録するには、一度実行します:
# 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.jsすべてのプロジェクトでグローバルに利用できるようにするには、--scope userフラグを追加します:
claude mcp add --scope user symfony -- npx @shakaran/symfony-agent-mcpClaude Desktop
Claude Desktopの設定ファイル(claude_desktop_config.json)に追加します:
{
"mcpServers": {
"symfony": {
"command": "npx",
"args": ["@shakaran/symfony-agent-mcp"]
}
}
}Cursor
.cursor/mcp.jsonに追加します:
{
"symfony": {
"command": "npx",
"args": ["@shakaran/symfony-agent-mcp"]
}
}VS Code Copilot
.vscode/mcp.jsonに追加します:
{
"servers": {
"symfony": {
"type": "stdio",
"command": "npx",
"args": ["@shakaran/symfony-agent-mcp"]
}
}
}使用方法
すべてのツールは、Symfonyアプリケーションのルートを指すapp_pathパラメータを受け入れます:
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: 7Claudeで使用できるプロンプトの例:
"POSTメソッドを持つすべてのルートとそのコントローラーを表示して"
"
doctrine.event_listenerでタグ付けされたサービスはどれ?""本番ログの最後の50行をリストアップして"
"サービスコンテナに循環依存はありますか?"
"Userとリレーションを持つDoctrineエンティティはどれ?"
"マイグレーション履歴と破壊的なマイグレーションを表示して"
"セキュリティ属性を持たないコントローラーはどれ?"
設定
すべての設定は、MCPサーバープロセスに渡される環境変数によって行われます。
ツール検出
変数 | デフォルト | 説明 |
|
| 動的ツール検出を有効にします。 |
|
| セッションごとにアクティブ化できる推定トークンの最大数。この制限を超えるとアクティブ化はブロックされます。 |
セキュリティとアクセス
変数 | デフォルト | 説明 |
| (任意) | サーバーが検査できる絶対アプリパスのコロン区切りリスト。例: |
|
|
|
| (すべて) | カンマ区切りのツール名の許可リスト。リストされたツールのみが呼び出し可能です。 |
| (なし) | カンマ区切りの拒否リスト。許可リストよりも優先されます。 |
| (オフ) | リクエスト署名用の32文字以上のシークレット。リクエストごとの認証を有効にします。 |
| (オフ) | セッショントークン生成用のシークレット。 |
| (オフ) | 受信リクエストで検証するトークン。 |
|
|
|
|
| セッショントークンの有効期間(秒)。 |
レート制限
変数 | デフォルト | 説明 |
|
| ウィンドウあたりの最大リクエスト数。 |
|
| レート制限ウィンドウ(ミリ秒)(1分)。 |
|
| 1秒あたりの最大バーストリクエスト数。 |
トランスポート
変数 | デフォルト | 説明 |
| (オフ) | HTTP/SSEトランスポート用のポート。設定すると、stdioに加えてHTTPサーバーが起動します。 |
|
|
|
|
| ツールごとの実行タイムアウト(ミリ秒)。 |
例: 動的ツールを無効にしたClaude Code
{
"mcpServers": {
"symfony": {
"command": "npx",
"args": ["@shakaran/symfony-agent-mcp"],
"env": {
"SYMFONY_MCP_DYNAMIC_TOOLS": "false"
}
}
}
}例: トークンバジェットを80,000トークンに増加
{
"mcpServers": {
"symfony": {
"command": "node",
"args": ["/path/to/symfony-agent-mcp/dist/server.js"],
"env": {
"SYMFONY_MCP_TOKEN_BUDGET": "80000"
}
}
}
}ローカルインストール(ソースから)
ローカルクローンからサーバーを実行したい場合に使用します(npm publishは不要です)。
# 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.js次に、MCPクライアントがビルドされたファイルを指すように設定します:
Claude Code(一度実行):
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"]
}
}
}ヒント: 再ビルド(
pnpm build)後、MCPクライアントを再起動して変更を反映してください。
読み取るもの
サーバーはSymfonyアプリからファイルを直接読み取ります — データベース接続やPHPランタイムは不要です:
config/routes.yaml、config/routes/*.yaml— YAMLルートPHP 8の
#[Route]属性(src/Controller/内のコントローラー)config/services.yaml— DIコンテナサービスconfig/packages/*.yaml— フレームワーク、セキュリティ、Doctrine、メッセンジャー、メーラーの設定src/Entity/*.php— Doctrineエンティティファイル(PHP 8属性+アノテーション)var/log/*.log— アプリケーションログmigrations/、src/Migrations/— Doctrineマイグレーションファイルcomposer.json、composer.lock— パッケージ情報.env、.env.local、.env.*.local— 環境変数(機密値は自動的に伏せ字にされます)
Symfony互換性
Symfony | PHP | ORMマッピング |
5.4 LTS | 8.0+ | アノテーションまたは属性 |
6.x | 8.0+ | 属性 |
7.x | 8.2+ | 属性 |
8.x | 8.2+ | 属性 |
要件
Node.js ≥ 22.0.0
pnpm ≥ 11.0.0(または開発用のnpm/yarn)
開発
pnpm install
pnpm dev # watch mode (TypeScript → dist/)
pnpm test # run all tests
pnpm lint # ESLint
pnpm typecheck # tsc --noEmit完全な開発ガイドについては、DEVELOPMENT.mdを参照してください:アーキテクチャの概要、新しいツールの追加、テスト戦略、コントリビューションガイドライン。
ドキュメント
ドキュメント | 説明 |
ステップバイステップのセットアップ、Node.jsの前提条件、トラブルシューティング | |
システム設計、セキュリティパイプライン、コンポーネント概要、16カテゴリにわたる全1,679ツールのドキュメント | |
開発ワークフロー、ツールの追加、テスト、コントリビューション | |
脅威モデル、DLPパイプライン、責任ある開示ポリシー | |
リリース履歴とロードマップ | |
プロジェクトの概要と統計 |
コントリビューション
Issueとプルリクエストは、github.com/shakaran/symfony-agent-mcpで歓迎します。
PRを提出する前にDEVELOPMENT.mdを読み、責任ある開示ポリシーについてはSECURITY.mdを読んでください。
ライセンス
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