Skip to content

feat: migrate from mark3labs/mcp-go to toolhive-core/mcpcompat (go-sdk)#5729

Draft
JAORMX wants to merge 3 commits into
mainfrom
feat/remove-mcp-go
Draft

feat: migrate from mark3labs/mcp-go to toolhive-core/mcpcompat (go-sdk)#5729
JAORMX wants to merge 3 commits into
mainfrom
feat/remove-mcp-go

Conversation

@JAORMX

@JAORMX JAORMX commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

What this does

Pure import swap: every github.com/mark3labs/mcp-go/{mcp,server,client,client/transport} import is replaced with the go-sdk-backed compatibility shim in toolhive-core (github.com/stacklok/toolhive-core/mcpcompat/*). No call-site logic changes — the shim mirrors mcp-go's API. This moves ToolHive's MCP protocol handling onto the official modelcontextprotocol/go-sdk, and removes the direct github.com/mark3labs/mcp-go dependency from ToolHive (it remains only as a transitive // indirect requirement pulled in by other modules).

Dependency / merge blocker

Depends on stacklok/toolhive-core#150. The toolhive-core dependency is pinned to that branch commit (6b7da5c, resolved as v0.0.27-0.20260706081226-6b7da5c3241e). Bump it to the released tag once #150 merges.

⚠️ This PR cannot merge until toolhive-core#150 is released.

Verification

All run against the pinned shim commit:

go build ./...   → EXIT=0
go vet ./...     → EXIT=0
test compilation → clean (no compile errors across all packages)

Known behavioral caveats (inherited from the shim)

  1. SendNotificationToAllClients in the stdio bridge forwards only progress/message notifications — tools/list_changed and other methods are dropped because go-sdk v1.6.1 exposes no public generic notification sender.
  2. Per-session dynamic tool dispatch (vMCP projection) needs runtime validation.
  3. SessionIdManager isn't yet wired to go-sdk's session lifecycle.
  4. Transport 401→auth-error mapping is best-effort.

🤖 Generated with Claude Code

Swaps all github.com/mark3labs/mcp-go/{mcp,server,client,client/transport}
imports to the go-sdk-backed compatibility shim in toolhive-core
(github.com/stacklok/toolhive-core/mcpcompat/*). No call-site logic changes —
the shim mirrors mcp-go's API. This moves ToolHive's MCP protocol handling
onto the official modelcontextprotocol/go-sdk.

Depends on stacklok/toolhive-core#150; the toolhive-core dependency is pinned
to that branch commit and should be bumped to the released version once #150
merges.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added the size/M Medium PR: 300-599 lines changed label Jul 6, 2026
Bump github.com/stacklok/toolhive-core to the mcpcompat shim commit that
closes the server/client compatibility gaps exercised by the vMCP and MCP
test suites (pulls the required cel-go v0.29.1). Also fix gci import
grouping in three files flagged by lint (toolhive-core shares the
github.com/stacklok/toolhive prefix, so its imports group with toolhive's).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Jul 6, 2026
@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.61%. Comparing base (fb69e00) to head (407e2ef).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5729      +/-   ##
==========================================
- Coverage   70.65%   70.61%   -0.04%     
==========================================
  Files         682      682              
  Lines       68854    68854              
==========================================
- Hits        48651    48624      -27     
- Misses      16657    16683      +26     
- Partials     3546     3547       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Medium PR: 300-599 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant