
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.
概览
一个本地运行的只读 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 预算和会话认证。
安装
在 SourceWeft 中
- 打开 控制台中的 Symfony Agent MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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.
Features
1,677 Tools across 16 Categories
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)
Option B: Install globally
Option C: From source
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:
To make it available globally across all projects, add the --scope user flag:
Claude Desktop
Add to your Claude Desktop configuration file (claude_desktop_config.json):
Cursor
Add to .cursor/mcp.json:
VS Code Copilot
Add to .vscode/mcp.json:
Usage
Every tool accepts an app_path parameter pointing to the root of your Symfony application:
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
Security & Access
Rate Limiting
Transport
Example: Claude Code with dynamic tools disabled
Example: token budget increased to 80 000 tokens
Local Install (from source)
Use this when you want to run the server from a local clone (no npm publish needed).
Then configure your MCP client to point at the built file:
Claude Code (run once):
Claude Desktop (claude_desktop_config.json):
VS Code (.vscode/mcp.json):
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 insrc/Controller/ config/services.yaml— DI container servicesconfig/packages/*.yaml— Framework, security, doctrine, messenger, mailer configsrc/Entity/*.php— Doctrine entity files (PHP 8 attributes + annotations)var/log/*.log— Application logsmigrations/,src/Migrations/— Doctrine migration filescomposer.json,composer.lock— Package info.env,.env.local,.env.*.local— Environment variables (sensitive values auto-redacted)
Symfony Compatibility
Requirements
- Node.js ≥ 22.0.0
- pnpm ≥ 11.0.0 (or npm/yarn for development)
Development
See DEVELOPMENT.md for the full development guide: architecture overview, adding new tools, testing strategy, and contribution guidelines.
Documentation
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
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版本历史
1- v1.0.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分