← All projects
MCPMCP SDKAgentTool Callingsymfony-ai

Symfony Code Mode

As a Symfony app grows, why should an agent load every tool definition to answer one question? Symfony Code Mode gives it two MCP tools to start with. search_tools finds the tools its user can access. execute_tools calls them. We started with agent-written PHP in a sandbox so an agent could combine results from several tools. For services a team already runs, a tool name and JSON arguments were enough. With Symfony AI and the PHP MCP SDK, the agent can chain those calls while the application runs on ordinary Symfony hosting. Tool search answered “what can I call?” Our next question was “how does this team do the job?” We prototyped the MCP working group’s named Groups proposal so teams can publish a procedure alongside the tools it uses. In the 90-second demo, an agent finds the team’s refund procedure, reads an order, and uses its policy ID to look up the right rules. Asked about a second order, it follows the same procedure and Symfony denies the read. You can follow the calls in the Symfony Profiler, then try the conversation in your own MCP client. https://ronaldtebrake.github.io/symfony-hackathon/#judge-demo

Play the video on YouTube 1:30

2 comments

IV
Illia Vasylevskyi Nov 2, 2026

Cool idea! Will check how it play out, and maybe yoink some implementation. I'm using code mode in my harness https://github.com/ineersa/agent-core/blob/main/docs/tools.md#code_mode. I basically expose it as a tool to model, where model can write any PHP scripts and use functions i expose, for example tool(name, arguments) which gives model access to any coding agent tool available (including MCPs), and it can use it results as a simple PHP variable. It kinda works, pretty fun, I don't see a lot of benefits in day to day coding agent work, but it unlocks some interesting scripting of workflows.

RT
Ronald te Brake 16 days ago

Thanks a lot Illia! Yoink away 😄 I've started with sandboxed PHP using gvisor, but didnt want the overhead of having a dependency like that.. and landed on two MCP tools to discover and call Symfony services. I think you’re onto something with repeatable workflows, I'm now trying to see where that takes me. There are some interesting insights I got from the working group on this https://modelcontextprotocol.io/community/working-groups/progressive-disclosure I do think there are some interesting approaches still. We also now see Claude Code have their own code mode for their tools, which I mean from a client side point of view makes sense (see https://code.claude.com/docs/en/code-mode) A lot of moving parts, super interesting, happy to compare notes.

Join the conversation with your SymfonyConnect account. Sign in