modelcontextprotocol / modelcontextprotocol/php-sdk
Proposal: Extract Discovery module from core SDK for better modularity
まだ誰も着手していません。
- 主要言語
- PHP
- スター
- 1.6k
- フォーク
- 173
- 平均マージ
- 2日 49分
- マージ済み PR(30日)
- 23
説明
Hey team,
I can see a lot of thought went into making the developer experience smooth with the Discovery module. The automatic scanning and registration is definitely a nice convenience feature.
I was reviewing the SDK architecture and noticed that the Discovery functionality is currently bundled directly into the core SDK package. While this makes getting started really easy, I'm wondering if we might want to consider a different approach for the long-term health of the project.
Here's what I'm thinking about:
Maintenance and Release Complexity
The Discovery module brings in some pretty heavy dependencies like symfony/finder and phpdocumentor/reflection-docblock, plus it includes custom tokenization logic. This means the SDK's release cycle could get tangled up with Discovery-related updates.
Framework Integration Challenges
I've been looking at how this would integrate with frameworks like Spiral, Laravel, and Symfony, and they already have really mature discovery systems with optimized caching and pre-compilation. It seems like we might be asking framework developers to choose between using their battle-tested discovery systems or staying compatible with our SDK approach.
Architectural Separation
What do you think about splitting this into separate concerns? Something like:
- Keep the SDK focused on the core MCP protocol implementation (message handling, JSON-RPC transport, tool schemas)
- Move Discovery into either a separate
mcp/discoverypackage or framework-specific integrations - Let applications choose the discovery approach that fits their architecture
This way:
- The core SDK stays lightweight with minimal dependencies
- Framework integrations can use their native discovery systems
- Standalone apps can still use convenient auto-discovery if they want
- We can evolve Discovery independently from protocol updates
Specific Benefits
For microservices that just need manual tool registration, they wouldn't carry the file scanning dependencies. Framework developers could contribute optimized integrations for their specific ecosystems. And SDK maintenance could focus on what it does best - implementing the MCP protocol cleanly.
I might be missing some context about the design decisions here, so I'd love to hear your thoughts! Is there a specific reason Discovery needs to be in the core SDK, or would a more modular approach work better?
Happy to discuss this further or help with any refactoring if the team thinks this direction makes sense.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
特定のファイルやテストは指定されていません。まず、core SDK の Discovery モジュールを確認します。これには、symfony/finder、phpdocumentor/reflection-docblock、およびカスタムトークン化の依存関係が含まれます。次に、提案されている mcp/discovery のパッケージ境界を、Spiral、Laravel、Symfony との統合と比較します。チームが抽出設計とフレームワーク統合の境界について合意すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- php
- 領域
- backend-api-design
- issue の種類
- リファクタリング
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 静か
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100