Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@wachterjohannes
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
Docs? yes
Issues -
License MIT

Description

This PR introduces the AI Mate component (symfony/ai-mate), a standalone MCP server that enables AI assistants (Claude, GitHub Copilot, JetBrains AI, Cursor) to interact with PHP/Symfony applications through standardized tools.

Key Features

Core Server

  • Extension discovery system via extra.ai-mate in composer.json
  • Automatic service registration with Symfony DI container
  • Feature filtering to enable/disable specific tools per extension
  • Built-in tools: php-version, operating-system, php-extensions

Symfony Bridge (symfony/ai-mate-symfony)

  • symfony-services tool for container introspection
  • Parses compiled container XML to expose service definitions

Monolog Bridge (symfony/ai-mate-monolog)

  • Log search and analysis tools
  • Supports both JSON and standard Monolog line formats
  • Tools: monolog-search, monolog-search-regex, monolog-context-search, monolog-tail, monolog-list-files, monolog-list-channels, monolog-by-level

Architecture

Unlike other Symfony AI components, Mate is standalone and does not integrate with the AI Bundle. It runs as an independent MCP server via stdio transport.

src/ai-mate/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ Command/           # CLI commands (serve, init, discover, clear-cache)
β”‚   β”œβ”€β”€ Container/         # DI container management
β”‚   β”œβ”€β”€ Discovery/         # Extension discovery system
β”‚   β”œβ”€β”€ Capability/        # Built-in MCP tools
β”‚   β”œβ”€β”€ Service/           # Internal services
β”‚   └── Bridge/
β”‚       β”œβ”€β”€ Symfony/       # Container introspection
β”‚       └── Monolog/       # Log analysis
β”œβ”€β”€ tests/
β”œβ”€β”€ resources/             # Template files for init command
└── bin/mate               # Executable

Usage Example

# Install
composer require symfony/ai-mate

# Initialize configuration
vendor/bin/mate init

# Discover extensions
vendor/bin/mate discover

# Start server (typically called by AI assistant)
vendor/bin/mate serve

Creating custom tools:

// mate/MyTool.php
namespace App\Mate;

use Mcp\Capability\Attribute\McpTool;

class MyTool
{
   #[McpTool(name: 'my_tool', description: 'My custom tool')]
   public function execute(string $param): array
   {
       return ['result' => $param];
   }
}

Documentation

Comprehensive documentation added to docs/components/mate.rst:

  • Quick start guide
  • Configuration reference
  • Bridge documentation with troubleshooting
  • Integration guides for Claude Desktop, Claude Code, JetBrains AI
  • Extension development guide"

@wachterjohannes
Copy link
Contributor Author

A special thanks goes to @Nyholm which was a great companion during the prototype phase and discussion partner on the symfony con in amsterdam where this ideas was born

@Nyholm
Copy link
Member

Nyholm commented Dec 15, 2025

Johannes and I have been working on this together for the past few weeks. The idea of AI Mate is to create a framework agnostic platform where we easily can integrate with Symfony/Sulu/Laravel/Whatever specific features.

@chr-hertel
Copy link
Member

Coming out of stealth mode - hitting symfony/ai repo πŸŽ‰

Awesome stuff - thanks for driving that and spinning it up only in two weeks since SymfonyCon - will give it a deeper read, when you ping me πŸ‘

@chr-hertel chr-hertel added the Mate Issues & PRs about the AI Mate component label Dec 15, 2025
@wachterjohannes wachterjohannes force-pushed the feature/ai-mate-component branch 9 times, most recently from 6f175e1 to da96bfe Compare December 16, 2025 19:05
@chr-hertel
Copy link
Member

Hey @wachterjohannes, thanks again, one rather conceptual question.

In understand this PR now like mate would integrate with the dependencies of the main application, right? did you consider installing it as a phar to get rid of that dependency range?

@wachterjohannes
Copy link
Contributor Author

Hey @wachterjohannes, thanks again, one rather conceptual question.

In understand this PR now like mate would integrate with the dependencies of the main application, right? did you consider installing it as a phar to get rid of that dependency range?

yes absolutly - this should be a point on the list in the next weeks - but i think for now we could go with that and collect feedback!

@wachterjohannes wachterjohannes force-pushed the feature/ai-mate-component branch 2 times, most recently from a33b39d to 17ca459 Compare December 16, 2025 21:46
@wachterjohannes wachterjohannes force-pushed the feature/ai-mate-component branch from 744e7a1 to 93bc9da Compare December 19, 2025 19:42
@wachterjohannes
Copy link
Contributor Author

@OskarStark i have rebased again - and except the open questions there should be fixed everything

Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments

Symfony Bridge
~~~~~~~~~~~~~~

The Symfony bridge (``symfony/ai-symfony-mate``) provides container introspection tools
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still thinking about the naming, symfony/ai-symfony-mate-extension would be the best fit IMHO, but we are talking about bridges here.

Proposal, lets keep the therm Bridge in the namespace and code, to ease development (I don't want to have special cases by introducing an Extension namespace), but lets use extension to communicate it in the docs and for package names. WDYT?

@chr-hertel @Nyholm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, not sure, feels inconsistent to me - we don't have it anywhere else symfony/ai-azure-platform-extension?

should we drop the term "extension" at all in favor of "bridge"?
i feel it's more like coming from phpstan - with symfony not usually used but bridge

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, lets use the bridge wording everywhere and get rid of extension term

@chr-hertel
Copy link
Member

I guess "extension" vs "bridge" is some kind of higher level decision we need to take.

@wachterjohannes
Copy link
Contributor Author

@OskarStark @chr-hertel i also think that bridge would fit better in this repo. not sure if it makes sense for external developer. But let us try and if we can explain that well it should not be an issue in the future.

@Nyholm is that ok for you?

@wachterjohannes
Copy link
Contributor Author

@OskarStark will go on with the extension => bridge renaming after @Nyholm give his opinion about that

@OskarStark
Copy link
Contributor

No worries πŸ˜‰

@wachterjohannes wachterjohannes force-pushed the feature/ai-mate-component branch 2 times, most recently from 7e0ef7f to dd5bd7a Compare December 20, 2025 18:45
@wachterjohannes
Copy link
Contributor Author

@OskarStark @chr-hertel @Nyholm i have already done the renaming in the latest commit - if you are all happy with it i should give it a last try in my example repo before we can finally merge it

@OskarStark
Copy link
Contributor

Do you think it is a good idea to add it to the demo application in this repo?

@Nyholm
Copy link
Member

Nyholm commented Dec 20, 2025

I do believe an "extension" is a more generic term than "bridge". A "bridge" connects two things. An "extension" adds some kind of functionally.

I agree that we should be constant and call it "bridge" in this repo. Ie, we should use the "Bridge" namespace and name our code accordingly. BUT, if I create "Tobias private Mate integration"-package, that is for sure an "extension".

So in the AI Mate code, we should refer to "extension".


I see that you changed to "Bridge". I dont think this should be a blocker for merging. We can open an issue and talk about it before the first tag.

@wachterjohannes
Copy link
Contributor Author

@Nyholm i also agree to you! as i already mentioned that the term is not so self-explaining.

I have done the renaming in a completly own commit so no worries to revert that.

@OskarStark i also thought about that. but i think that should be part of a follow up pull-request.

@OskarStark
Copy link
Contributor

Ok let's go with bridge and open an issue. Afterwards let's create a PR with extension, but we would need to tackle a lot of scripts etc.

I would also like @fabpot's opinion if extension renaming would have some more side effects

@wachterjohannes
Copy link
Contributor Author

@OskarStark think thats a pragmatic solution! ler us merge it with bridge, merge it and i will create follow up PRs about extension term and example in the next days

@fabpot
Copy link
Member

fabpot commented Dec 21, 2025

Ok let's go with bridge and open an issue. Afterwards let's create a PR with extension, but we would need to tackle a lot of scripts etc.

I would also like @fabpot's opinion if extension renaming would have some more side effects

Anything happening before 1.0 has not big consequences.

Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge from my side @chr-hertel, please give a final review

@carsonbot carsonbot changed the title [Mate] Add AI Mate component for MCP server integration Add AI Mate component for MCP server integration Dec 21, 2025
@wachterjohannes
Copy link
Contributor Author

@OskarStark i tried this in my example repo so also from my side its good to go

@OskarStark
Copy link
Contributor

As it is quite a new concept of a Symfony component, can you maybe share a small video in the PR header how you use it in PhpStorm or anywhere else?

@chr-hertel
Copy link
Member

Good to merge from my side @chr-hertel, please give a final review

on it right now πŸ‘

Copy link
Member

@chr-hertel chr-hertel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will provide a follow up about referencing dev for composer, but we should just bring that in and level up in smaller steps

@chr-hertel chr-hertel force-pushed the feature/ai-mate-component branch from 1b0b490 to c151ab8 Compare December 21, 2025 15:18
@chr-hertel
Copy link
Member

Thank you @wachterjohannes.

@chr-hertel chr-hertel merged commit 424bd3d into symfony:main Dec 21, 2025
11 checks passed
@wachterjohannes wachterjohannes deleted the feature/ai-mate-component branch December 21, 2025 15:20
@wachterjohannes
Copy link
Contributor Author

@chr-hertel it was a pleasure! but now we have to improve it πŸ˜…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature Mate Issues & PRs about the AI Mate component Status: Reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants