survos / mcp-bundle
Exposes a Survos app to AI coding agents as MCP tools (via symfony/ai-mate). Tools are thin wrappers over existing console exports (meta:export, atlas:export, dataset:*), giving agents a queryable view of the app's declared metadata graph and its dataset workflows.
Fund package maintenance!
Requires
- php: ^8.5
- mcp/sdk: ^0.5
- survos/kit-bundle: ^2.5
- symfony/config: ^8.1
- symfony/console: ^8.1
- symfony/dependency-injection: ^8.1
- symfony/http-kernel: ^8.1
- symfony/process: ^8.1
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^13.0
- symfony/framework-bundle: ^8.1
Suggests
- survos/atlas-bundle: Provides atlas:export — raw routes/entities/attributes for the atlas tools.
- survos/dataset-bundle: Provides dataset:head / dataset:browse for the dataset workflow tools.
- survos/field-bundle: Provides meta:export — the entity+route+field metadata graph the page-design tools wrap.
- survos/import-bundle: Provides import:convert for the dataset_convert tool.
This package is auto-updated.
Last update: 2026-06-20 20:31:41 UTC
README
Exposes a Survos application to AI coding agents as MCP tools, via symfony/ai-mate.
The goal: when an agent is asked to "design a dashboard for a tenant" or
"show me how to display this entity's fields", it can query the app's declared
metadata (field-bundle #[Field] / #[RouteMeta] / #[RouteIdentity], atlas's
route/entity graph) instead of guessing from variable names — and it can drive
dataset workflows (dataset:head, import:convert) by intent.
Status: repurposed scaffold (2026-06). This bundle previously held an experimental MCP client (JSON-RPC over Symfony HttpClient). That code was removed: the official
mcp/sdkMcp\Clientfully supersedes it (typed results, cursor pagination, progress callbacks, HTTP and stdio transports, and it accepts a PSR-18 client — so you can still pass Symfony'sPsr18Client). The bundle now goes the other direction: it provides tools to an agent. See PLAN.md for the full design and build steps.
Architecture
- Transport = ai-mate. This bundle declares
extra.ai-mate.scan-dirs: ["src/Mcp"]and ships#[McpTool]classes (Mcp\Capability\Attribute\McpTool, frommcp/sdk). - Tools wrap existing exports — they don't reinvent them.
meta:export(field-bundle) andatlas:export(atlas-bundle) already emit the metadata graph; the dataset commands already exist. MCP tools call them. - Why wrappers, not services: ai-mate builds its own standalone container and
never boots the app kernel, so a
#[McpTool]cannot autowire app compile-time services (EntityMetaRegistry,DatasetResolver, …). Each tool therefore runsbin/console <command> --format=jsonviasymfony/processand returns the parsed JSON. The in-app console command is the real engine.
Tools (planned — see PLAN.md)
| Tool | Wraps | Answers |
|---|---|---|
describe_entity |
meta:export --entity --fields |
fields, facets, widgets, URL identity for displaying an entity |
routes_for_entity |
meta:export --entity |
routes by Purpose — "design a dashboard for a tenant" |
find_routes_injecting |
meta + atlas | routes that inject an entity (declared + inferred candidates) |
suggest_pages |
meta:export gaps |
missing routes worth adding |
atlas_attributes / atlas_query |
atlas:export |
the raw attribute/route/entity map |
dataset_head / dataset_list / dataset_convert |
dataset:* / import:convert |
dataset workflows by intent |
survos_command |
any bin/console |
generic long-tail fallback |
Installation
composer require survos/mcp-bundle
Then, in the host app: register the bundle, run vendor/bin/mate discover, and
enable the extension in mate/extensions.php. Verify with
vendor/bin/mate debug:capabilities --format=json.
Requires
PHP 8.4+, Symfony 8.1+. Extends Survos\Kit\AbstractSurvosBundle.