Proposal: Extract Discovery module from core SDK for better modularity
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 重构
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- php
调研方向
没有指定具体的文件或测试。首先检查 core SDK 的 Discovery 模块,包括其对 symfony/finder、phpdocumentor/reflection-docblock 以及自定义标记化依赖项的使用,然后将提议的 mcp/discovery 包边界与 Spiral、Laravel 和 Symfony 的集成进行比较。当团队就提取设计及其框架集成边界达成一致时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- PHP
- 星标
- 1.6k
- 派生
- 173
- 平均合并
- 2 天 49 分钟
- 30 天内合并 PR
- 23
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelcontextprotocol/php-sdk 的其他 Issue
-
[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStan 未关闭Server
难度 1/5 1 小时以内 新手友好度 78/100
modelcontextprotocol/php-sdk#468 · 2 条评论 ·
-
needs confirmation needs maintainer action Server
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/php-sdk#398 · 1 个 reaction ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
modelcontextprotocol/php-sdk#370 ·
-
enhancement
难度 4/5 3-5 天 新手友好度 55/100
modelcontextprotocol/php-sdk#510 · 1 条评论 ·
-
bug
难度 4/5 3-5 天 新手友好度 45/100
modelcontextprotocol/php-sdk#504 ·
查看 modelcontextprotocol/php-sdk 的全部 Issue
相似的 Issue
-
Solved site promotion gate fails on runner PHP patch drift (expects 8.2.33, runner installs 8.2.34) 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
Automattic/blocks-engine#2161 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
Automattic/static-site-importer#1824 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
0. Needs triage bug
难度 2/5 1-3 小时 新手友好度 75/100
-
0. Needs triage 35-feedback bug
难度 2/5 1-3 小时 新手友好度 75/100