• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 18910702901
51%

Build:
DEFAULT BRANCH: main
Ran 29 Oct 2025 02:12PM UTC
Jobs 1
Files 311
Run time 5min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

29 Oct 2025 02:07PM UTC coverage: 47.047% (-0.4%) from 47.434%
18910702901

push

github

web-flow
Implement capability discovery and querying for Virtual MCP Server (#2354)

* Implement capability discovery and querying for Virtual MCP Server

This implements the core capability discovery and querying functionality
for the Virtual MCP Server feature (based on proposal THV-2106).

Virtual MCP aggregates multiple MCP servers from a ToolHive group into a
single unified interface, enabling complex workflows spanning multiple
tools and services. This PR implements the first phase: discovering
backends and querying their capabilities.

SDK Choice - mark3labs/mcp-go:
We use mark3labs/mcp-go instead of the official modelcontextprotocol/go-sdk
because:
- Already battle-tested in ToolHive (pkg/transport/bridge.go)
- Better client-side flexibility via WithHTTPHeaderFunc for per-backend auth
- Direct http.Handler implementation (no wrapper layer)
- Zero migration risk from existing code
- Both SDKs support standard Go middleware, but mark3labs provides simpler
  integration patterns for our per-backend authentication requirements

Changes:
- Add BackendClient for MCP protocol communication with backends
  - Uses mark3labs/mcp-go SDK for streamable-HTTP and SSE transports
  - Implements ListCapabilities, CallTool, ReadResource, GetPrompt
  - Proper handling of MCP Content interfaces (AsTextContent, AsImageContent)
  - Converts ToolInputSchema structs to map[string]any for domain layer

- Add CLI Backend Discoverer for Docker/Podman workloads
  - Discovers backends from ToolHive groups using existing managers
  - Filters for healthy/running workloads only
  - Converts core.Workload to vmcp.Backend domain types
  - Preserves metadata (group, labels, transport type)

- Add Default Aggregator for capability aggregation
  - Parallel backend queries using errgroup (limit: 10 concurrent)
  - Graceful failure handling (continues with remaining backends)
  - Five-method interface: QueryCapabilities, QueryAllCapabilities,
    ResolveConflicts, MergeCapabilities, Aggrega... (continued)

306 of 879 new or added lines in 8 files covered. (34.81%)

5 existing lines in 2 files now uncovered.

19285 of 40991 relevant lines covered (47.05%)

15.2 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
8
89.74
pkg/vmcp/aggregator/cli_discoverer.go
13
0.0
pkg/vmcp/aggregator/k8s_discoverer.go
23
89.4
pkg/vmcp/aggregator/default_aggregator.go
38
0.0
pkg/vmcp/mocks/mock_backend_registry.go
38
0.0
pkg/vmcp/registry.go
71
0.0
pkg/vmcp/mocks/mock_backend_client.go
139
0.0
pkg/vmcp/aggregator/mocks/mock_interfaces.go
243
14.74
pkg/vmcp/client/client.go

Uncovered Existing Lines

Lines Coverage ∆ File
2
56.0
-0.24% pkg/workloads/manager.go
3
72.39
-1.12% pkg/ignore/processor.go
Jobs
ID Job ID Ran Files Coverage
1 18910702901.1 29 Oct 2025 02:12PM UTC 311
47.05
GitHub Action Run
Source Files on build 18910702901
  • Tree
  • List 311
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #18910702901
  • c864276d on github
  • Prev Build on main (#18904285447)
  • Next Build on main (#18912579892)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc