-
Notifications
You must be signed in to change notification settings - Fork 171
Optimizer in vMCP #3278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimizer in vMCP #3278
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3278 +/- ##
==========================================
- Coverage 64.81% 63.13% -1.69%
==========================================
Files 372 386 +14
Lines 36163 37791 +1628
==========================================
+ Hits 23440 23860 +420
- Misses 10884 12052 +1168
- Partials 1839 1879 +40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c897084 to
7b932fc
Compare
fdb387b to
29e89d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Large PR Detected
This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.
How to unblock this PR:
Add a section to your PR description with the following format:
## Large PR Justification
[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformationAlternative:
Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.
See our Contributing Guidelines for more details.
This review will be automatically dismissed once you add the justification section.
#3253) * feat: Add optimizer package with semantic tool discovery and ingestion This PR introduces the optimizer package, a Go port of the mcp-optimizer Python service that provides semantic tool discovery and ingestion for MCP servers. - **Semantic tool search** using vector embeddings (384-dim) - **Token counting** for LLM cost estimation - **Full-text search** via SQLite FTS5 - **Multiple embedding backends**: Ollama, vLLM, or placeholder (testing) - **Production-ready database** with sqlite-vec for vector similarity search
* feat: Add optimizer integration endpoints and tool discovery - Add find_tool and call_tool endpoints to vmcp optimizer - Add semantic search and string matching for tool discovery - Update optimizer integration documentation - Add test scripts for optimizer functionality
* feat: Add token metrics and observability to optimizer integration
29e89d0 to
eb22a40
Compare
…failures The checkPodsReady function was checking all pods with matching labels, including old pods that had completed (Phase: Succeeded) from previous deployments. This caused the auth discovery e2e test to fail when old pods were still present during deployment updates. Fix: Skip pods that are not in Running phase and ensure at least one running pod exists after filtering.
Large PR justification has been provided. Thank you!
|
✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review. |
The test was failing with 'connection reset by peer' errors when trying to connect to the health endpoint. This can happen if pods crash or restart between the BeforeAll setup and the actual test execution. Fix: Add explicit pod readiness verification right before the health check and also check pod readiness inside the Eventually loop to catch pods that crash during health check retries. This makes the test more robust by ensuring pods are stable before attempting HTTP connections.
The health check was using http.Get() without a timeout, which could cause hangs. Add an explicit HTTP client with 10s timeout and improve error messages to help diagnose connection reset issues.
* remove docs * fixes from review * simplify code and fixes from review * fixes from review * fix ci --------- Co-authored-by: taskbot <taskbot@users.noreply.github.com>
Run the server as a standalone process Previously it was instantiating the server in-process. Use the full binary to ensure that the tests are realistic.
…nfig - Use DeepCopy() for automatic passthrough of config fields (Optimizer, Metadata, etc.) - Add resolveEmbeddingService() to resolve Kubernetes Service names to URLs - Ensures optimizer config is properly converted from CRD to runtime config - Resolves embeddingService references in Kubernetes deployments
- Add CLI fallback for embeddingService when not resolved by operator - Normalize localhost to 127.0.0.1 in embeddings to avoid IPv6 issues - Add HTTP timeout (30s) to prevent hanging connections - Remove WithContinuousListening() to use timeout-based approach
Add tracing spans to all aggregator methods to enable visibility of capability aggregation in Jaeger. This includes spans for: - AggregateCapabilities (parent span) - QueryAllCapabilities (parallel backend queries) - QueryCapabilities (per-backend queries) - ResolveConflicts (conflict resolution) - MergeCapabilities (final merge) All spans include relevant attributes like backend counts, tool/resource/prompt counts, and error recording. This fixes the issue where capability aggregation logs appeared but no spans were visible in Jaeger.
Signed-off-by: nigel brown <nigel@stacklok.com>
|
Closing to create a new PR with updated description. |
|
Superseded by #3373 |
Merge jerm/2026-01-13-optimizer-in-vmcp into main
This PR merges 17 commits that integrate the MCP optimizer into vMCP, adding semantic tool discovery, observability, Kubernetes support, and various bug fixes and improvements.
Core Optimizer Integration
Add Optimizer Package (#3253)
Add Optimizer Integration Endpoints (#3318)
find_toolandcall_toolendpoints to vMCP optimizerResolve Tool Names in optim.find_tool (#3337)
Observability & Metrics
Add Token Metrics and Observability (#3347)
Add OpenTelemetry Tracing to Capability Aggregation
AggregateCapabilities(parent span)QueryAllCapabilities(parallel backend queries)QueryCapabilities(per-backend queries)ResolveConflicts(conflict resolution)MergeCapabilities(final merge)Kubernetes Integration
Add Dynamic/Static Mode Support (#3235)
Add DeepCopy and Kubernetes Service Resolution
DeepCopy()for automatic passthrough of config fields (Optimizer, Metadata, etc.)resolveEmbeddingService()to resolve Kubernetes Service names to URLsKubernetes Optimizer Integration Fixes (#3359)
WithContinuousListening()to use timeout-based approachTesting & Reliability Improvements
Run API E2E Test Server as Standalone Process (#3356)
Fix Flaky E2E Tests
checkPodsReadyto prevent flaky test failuresFix Unrecognized Dotty Names
Infrastructure
Bump Operator CRDs Chart Version
Documentation Updates
Summary
This PR consolidates the complete integration of the MCP optimizer into vMCP, enabling semantic tool discovery, reducing token usage, and providing comprehensive observability. The integration includes full Kubernetes support, robust error handling, and improved test reliability.
Related PRs