-
Notifications
You must be signed in to change notification settings - Fork 103
Description
Greetings! 👋
I'm part of the team developing the AI packages for WordPress, and work alongside @galatanovidiu on the MCP Adapter.
I was chatting with Ovi about the different integration challenges the SDK has for various projects such as WordPress, Drupal, Laravel, and so forth. I had an idea that I'd like to share here for friendly consideration. First, let me lay out my thought process:
MCP in PHP Structures
Arguably the most important part of this SDK for many of us is taking the complex and evolving MCP specification and representing it in PHP structures. Having things like a Server class that has an MCP Component registry, and DTOs for things like Tools, Prompts, and so forth, is such a big deal. Learning the specification in the first place and then translating that into PHP data structures is so valuable.
Implementation Challenges
The subsequent challenge is taking these data structures and making it actually do something. Hahah! Whether that's through CLI, HTTP, or whatever. WordPress, Laravel, Drupal, and such all have distinct systems for routing, handling HTTP transports, and so forth. Trying to make a system that adapts to each libraries special snowflake needs is a significant undertaking.
Separate packages?
So what if we separated these challenges? What if there were php-data-sdk and php-server-sdk structures? The later depending on the former. This would give folks like us, building the MCP Adapter, an immediately high value way of sharing the php-data-sdk and contributing back to it. It's also a nice separation of concerns as that package becomes strictly about making sure it accurately represents the latest MCP spec, and can even have its versioning match it.
Ideally the data structure would be PHP 7.4 compatible for those of us still working with hosts to push along PHP in the web, and then having the PHP 8.x be on the server level.
Anyway, there's my idea! I'm curious what others think! 😄