Proposal: Extract Discovery module from core SDK for better modularity
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- php
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Không có tệp hoặc bài kiểm thử cụ thể nào được nêu. Hãy bắt đầu bằng việc xem xét module Discovery của core SDK, bao gồm các dependency symfony/finder, phpdocumentor/reflection-docblock và các dependency tokenization tùy chỉnh, sau đó so sánh ranh giới package mcp/discovery được đề xuất với các integration cho Spiral, Laravel và Symfony. Công việc được xem là hoàn tất khi nhóm đã thống nhất về thiết kế tách chiết và ranh giới tích hợp framework.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- PHP
- Star
- 1.6k
- Fork
- 173
- Merge trung bình
- 2 ngày 49 phút
- Pull request đã merge (30 ngày)
- 23
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/php-sdk
-
[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStan Đang mởServer
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
modelcontextprotocol/php-sdk#468 · 2 bình luận ·
-
needs confirmation needs maintainer action Server
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
modelcontextprotocol/php-sdk#398 · 1 reaction ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
modelcontextprotocol/php-sdk#370 ·
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
modelcontextprotocol/php-sdk#510 · 1 bình luận ·
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
modelcontextprotocol/php-sdk#504 ·
Tất cả issue của modelcontextprotocol/php-sdk
Issue tương tự
-
[Chore] Keep one viget-block-generator skill and replicate it, instead of four tracked copies Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
hector-jewell/food-delivery-system-for-restaurant-using-php#1311 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Sylius/SyliusGridBundle#501 ·