Symfony Agent MCP

io.github.shakaran由 GitHub 帳號 shakaran 發布v1.0.2更新於 Oct 24, 2026

Read-only Symfony introspection: routes, services, entities, Doctrine, security, Twig and more.

概覽

AI 產生的概覽

一個在本機執行的唯讀 MCP 伺服器,讓 AI 助理檢視 Symfony 應用程式的路由、服務、實體、安全性、Twig 等內容。

可以做什麼
檢視 Symfony 核心結構:路由、控制器、服務、依賴注入容器、事件、指令和 bundle,以及設定與環境設定。查看 Doctrine 實體、關聯、遷移、索引和資料庫結構。審查安全性設定:voter、防火牆、驗證器、JWT、OAuth、CSRF 和存取控制。查看前端資源、Twig 範本、翻譯和 Symfony UX,並檢查測試與靜態分析設定。檢查訊息佇列、API Platform、快取、工作階段、佇列和雲端整合設定。產生程式碼品質與錯誤摘要,包括日誌片段和相依性檢查。
適用情境
適合需要助理回答現有 Symfony 程式碼庫問題的情境,例如有哪些路由、服務如何組裝、實體之間如何關聯、哪些控制器缺少安全性屬性。適用於本機 Symfony 專案的程式碼審查、上手和除錯。
執行需求
透過 stdio 在本機執行,通常使用 npx 或全域 npm 安裝;需要 Node.js 22 或更新版本。每次工具呼叫需提供指向 Symfony 專案根目錄的 app_path。選用環境變數可控制允許路徑、工具允許/封鎖清單、速率限制、token 預算和工作階段驗證。
安裝前請注意
它會讀取專案檔案,包括 .env 檔案和應用程式日誌,但敏感值據稱會自動遮蔽並經過 DLP 過濾掃描。建議用 SYMFONY_MCP_ALLOWED_PATHS 和工具允許/封鎖清單限制存取範圍。設定 SYMFONY_MCP_SESSION_SECRET 會啟用工作階段權杖驗證,並要求用戶端提供 SYMFONY_MCP_SESSION_TOKEN;未設定則驗證關閉。關閉 DLP 掃描會被啟動稽核標記為嚴重問題。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Symfony Agent MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

symfony-agent-mcp

[npm version] [License: MIT] [Node.js] [MCP] [PRs Welcome] [GitHub issues] [GitHub stars] [Build Status] [Coverage] [OpenSSF Scorecard] [Glama score] [smithery badge] [OpenSSF Baseline]

Features • Quick Start • Integration • Usage • Documentation • Contributing • License


A production-ready Model Context Protocol (MCP) server for Symfony applications. Gives AI assistants deep, read-only introspection into your entire Symfony codebase — routes, controllers, services, entities, database schema, migrations, events, forms, security, Doctrine, Messenger, Twig, API Platform, and much more.

ClientInstall
Claude CodeRun claude mcp add → setup
Claude DesktopAdd to claude_desktop_config.json → setup
CursorAdd to .cursor/mcp.json → setup
VS Code CopilotAdd to .vscode/mcp.json → setup
Any MCP clientstdio transport, command: npx @shakaran/symfony-agent-mcp

Features

1,677 Tools across 16 Categories

text
Available tool categories (16 categories, 1,677 tools total, ~164,615 tokens if all active)
  Category         │ Tools      │ Est. tokens    │ Description  ─────────────────┼────────────┼───────────────┼────────────────────────────────────────────────────────  symfony-core     │  548 tools │ ~ 53939 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         │  132 tools │ ~ 12950 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")

Security-first design

  • Read-only — never writes, modifies, or executes anything
  • Auto-redaction — passwords, tokens, API keys, and database credentials are replaced with [REDACTED] before any data reaches the AI
  • DLP pipeline — multi-layer Data Loss Prevention scanner (regex patterns + structural detection for credit cards, JWTs, SSH keys, cloud credentials, etc.)
  • Path validation — directory traversal attacks are blocked at the input layer
  • No code execution — PHP files are parsed statically (no eval, no PHP runtime)
  • No network calls — all data comes from local files only
  • Prompt injection filter — tool output is scanned for injection patterns before being forwarded to the AI

Quick Start

Option A: npx (no install required)

bash
npx @shakaran/symfony-agent-mcp

Option B: Install globally

bash
npm install -g @shakaran/symfony-agent-mcpsymfony-agent-mcp

Option C: From source

bash
git clone https://github.com/shakaran/symfony-agent-mcpcd symfony-agent-mcppnpm installpnpm buildpnpm start

See GETTING_STARTED.md for a step-by-step guide including Node.js setup, troubleshooting, and first-use verification.


Integration

One-click Install

Claude Code

Run once to register the server:

bash
# npx (no local install required)claude mcp add symfony -- npx @shakaran/symfony-agent-mcp
# Or from a local source buildclaude mcp add symfony -- node /path/to/symfony-agent-mcp/dist/server.js

To make it available globally across all projects, add the --scope user flag:

bash
claude mcp add --scope user symfony -- npx @shakaran/symfony-agent-mcp

Claude Desktop

Add to your Claude Desktop configuration file (claude_desktop_config.json):

json
{  "mcpServers": {    "symfony": {      "command": "npx",      "args": ["@shakaran/symfony-agent-mcp"]    }  }}

Cursor

Add to .cursor/mcp.json:

json
{  "symfony": {    "command": "npx",    "args": ["@shakaran/symfony-agent-mcp"]  }}

VS Code Copilot

Add to .vscode/mcp.json:

json
{  "servers": {    "symfony": {      "type": "stdio",      "command": "npx",      "args": ["@shakaran/symfony-agent-mcp"]    }  }}

Usage

Every tool accepts an app_path parameter pointing to the root of your Symfony application:

text
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: 7

Example prompts you can use with Claude:

  • "Show me all routes with POST methods and their controllers"
  • "Which services are tagged with doctrine.event_listener?"
  • "List the last 50 lines of the production log"
  • "Are there any circular dependencies in the service container?"
  • "What Doctrine entities have relationships with User?"
  • "Show me the migration history and any destructive migrations"
  • "Which controllers have no security attributes?"

Configuration

All configuration is done via environment variables passed to the MCP server process.

Tool Discovery

VariableDefaultDescription
SYMFONY_MCP_DYNAMIC_TOOLStrueEnable dynamic tool discovery. When true, tools/list returns only 5 meta-tools instead of all 1,677. Set to false to restore the legacy behaviour (all tools always visible).
SYMFONY_MCP_TOKEN_BUDGET40000Maximum estimated tokens that can be activated per session. Activation is blocked when this limit would be exceeded; pass force=true in activate_category to override.

Security & Access

VariableDefaultDescription
SYMFONY_MCP_ALLOWED_PATHS(any)Colon-separated list of absolute app paths the server may inspect. Example: /var/www/app1:/var/www/app2
SYMFONY_MCP_REQUIRE_SYMFONYtrueSet to false to skip Symfony project validation (useful for testing).
SYMFONY_MCP_ALLOWED_TOOLS(all)Comma-separated allowlist of tool names. Only listed tools are callable.
SYMFONY_MCP_BLOCKED_TOOLS(none)Comma-separated denylist. Takes precedence over the allowlist.
SYMFONY_MCP_SIGNING_SECRET(off)32+ character secret for request signing. Enables per-request authentication.
SYMFONY_MCP_SESSION_SECRET(off)Secret for session token generation.
SYMFONY_MCP_SESSION_TOKEN(off)Token to validate on incoming requests.
SYMFONY_MCP_SESSION_STRICTfalseSet to true to reject requests without a valid session token.
SYMFONY_MCP_SESSION_WINDOW300Session token validity window in seconds.

Rate Limiting

VariableDefaultDescription
SYMFONY_MCP_RATE_LIMIT60Max requests per window. Set to 0 to disable.
SYMFONY_MCP_RATE_WINDOW_MS60000Rate limit window in milliseconds (1 minute).
SYMFONY_MCP_RATE_BURST10Max burst requests in 1 second.

Transport

VariableDefaultDescription
SYMFONY_MCP_HTTP_PORT(off)Port for HTTP/SSE transport. When set, starts an HTTP server in addition to stdio.
SYMFONY_MCP_STDIOtrueSet to false to disable stdio transport (useful when running HTTP-only).
SYMFONY_MCP_TOOL_TIMEOUT_MS30000Per-tool execution timeout in milliseconds.

Example: Claude Code with dynamic tools disabled

json
{  "mcpServers": {    "symfony": {      "command": "npx",      "args": ["@shakaran/symfony-agent-mcp"],      "env": {        "SYMFONY_MCP_DYNAMIC_TOOLS": "false"      }    }  }}

Example: token budget increased to 80 000 tokens

json
{  "mcpServers": {    "symfony": {      "command": "node",      "args": ["/path/to/symfony-agent-mcp/dist/server.js"],      "env": {        "SYMFONY_MCP_TOKEN_BUDGET": "80000"      }    }  }}

Local Install (from source)

Use this when you want to run the server from a local clone (no npm publish needed).

bash
# 1. Clone the repogit clone https://github.com/shakaran/symfony-agent-mcpcd 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 respondsecho '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | node dist/server.js

Then configure your MCP client to point at the built file:

Claude Code (run once):

bash
claude mcp add symfony -- node /absolute/path/to/symfony-agent-mcp/dist/server.js

Claude Desktop (claude_desktop_config.json):

json
{  "mcpServers": {    "symfony": {      "command": "node",      "args": ["/absolute/path/to/symfony-agent-mcp/dist/server.js"]    }  }}

VS Code (.vscode/mcp.json):

json
{  "servers": {    "symfony": {      "type": "stdio",      "command": "node",      "args": ["/absolute/path/to/symfony-agent-mcp/dist/server.js"]    }  }}

Tip: After rebuilding (pnpm build), restart your MCP client to pick up the changes.


What It Reads

The server reads files directly from your Symfony app — no database connection, no PHP runtime needed:

  • config/routes.yaml, config/routes/*.yaml — YAML routes
  • PHP 8 #[Route] attributes on controllers in src/Controller/
  • config/services.yaml — DI container services
  • config/packages/*.yaml — Framework, security, doctrine, messenger, mailer config
  • src/Entity/*.php — Doctrine entity files (PHP 8 attributes + annotations)
  • var/log/*.log — Application logs
  • migrations/, src/Migrations/ — Doctrine migration files
  • composer.json, composer.lock — Package info
  • .env, .env.local, .env.*.local — Environment variables (sensitive values auto-redacted)

Symfony Compatibility

SymfonyPHPORM mapping
5.4 LTS8.0+Annotations or Attributes
6.x8.0+Attributes
7.x8.2+Attributes
8.x8.2+Attributes

Requirements

  • Node.js ≥ 22.0.0
  • pnpm ≥ 11.0.0 (or npm/yarn for development)

Development

bash
pnpm installpnpm dev            # watch mode (TypeScript → dist/)pnpm test           # run all testspnpm lint           # ESLintpnpm typecheck      # tsc --noEmit

See DEVELOPMENT.md for the full development guide: architecture overview, adding new tools, testing strategy, and contribution guidelines.


Documentation

DocumentDescription
GETTING_STARTED.mdStep-by-step setup, Node.js prerequisites, troubleshooting
ARCHITECTURE.mdSystem design, security pipeline, component overview, all 1,677 tools across 16 categories documented
DEVELOPMENT.mdDevelopment workflow, adding tools, testing, contributing
SECURITY.mdThreat model, DLP pipeline, responsible disclosure policy
CHANGELOG.mdRelease history and roadmap
PROJECT_SUMMARY.mdHigh-level project overview and statistics

Contributing

Issues and pull requests are welcome at github.com/shakaran/symfony-agent-mcp.

Please read DEVELOPMENT.md before submitting a PR, and SECURITY.md for the responsible disclosure policy.


Project standards

StandardStatus
OpenSSF BaselineLevel 1, 2 and 3
OpenSSF Best PracticesPassing
OpenSSF Scorecard7.4 / 10
Supply chainPublished from CI with SLSA provenance and SBOM
Reproducible buildVerified in CI, byte-identical across builds
Code scanningZero open alerts
Secret scanningZero open alerts
Tests1,019 — src/utils/ at 100%, transport at 99.5%
LicensingMIT, SPDX headers on every source file
Sign-offDeveloper Certificate of Origin, checked in CI

See SECURITY.md for the threat model, the assurance case and the remediation thresholds, and ROADMAP.md for what is planned.

License

MIT © Ángel Guzmán Maeso

來源:README.md,提交 6af2551

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分