Skip to content

fix: remove mark3labs/mcp-go dependency entirely#164

Merged
JAORMX merged 1 commit into
mainfrom
fix/remove-mcp-go-dependency
Jul 13, 2026
Merged

fix: remove mark3labs/mcp-go dependency entirely#164
JAORMX merged 1 commit into
mainfrom
fix/remove-mcp-go-dependency

Conversation

@JAORMX

@JAORMX JAORMX commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the mark3labs/mcp-go dependency from the module graph entirely.

The mcpcompat/mcp/alias.go file was the single chokepoint that re-exported ~100 types from mcp-go via type aliases. This PR replaces it with standalone definitions that preserve the same JSON wire format (identical struct tags, identical custom marshaling). The wire-format golden tests in mcp_test.go guard the conversion and pass unchanged.

Changes

  • Delete alias.go — the single file that imported mark3labs/mcp-go/mcp
  • Create 10 standalone files in mcpcompat/mcp/:
    • consts.goMCPMethod type, method name constants, content type constants
    • jsonrpc.goMeta, RequestId, JSON-RPC types, error codes, PingRequest, EmptyResult
    • content.goContent interface, TextContent, ImageContent, etc., UnmarshalContent, As* helpers
    • tools.goTool (+ custom MarshalJSON), ToolInputSchema, CallToolRequest (with all accessors), CallToolResult, builders
    • resources.goResource, ResourceTemplate, ResourceContents interface, pagination types
    • prompts.goPrompt, PromptMessage, Role
    • elicitation.go — elicitation types + Validate() method
    • logging.goLoggingLevel, SetLevelRequest
    • initialize.goImplementation, ClientCapabilities, ServerCapabilities, InitializeRequest/Result
    • helpers.go — sentinel errors, NewTextContent, NewJSONRPCErrorDetails, etc.
  • Simplify ResourceTemplate.URITemplate from *URITemplate (wrapping yosida95/uritemplate/v3) to plain string — nobody in the codebase accesses this field
  • Fix stray direct mcp-go import in registry/converters/converters_test.go to use the shim
  • Update doc.go to reflect standalone definitions rather than aliases
  • go mod tidy removes mark3labs/mcp-go, yosida95/uritemplate, spf13/cast

Verification

  • go test ./... — all 23 packages pass
  • golangci-lint run ./... — 0 issues
  • Golden wire-format tests in mcpcompat/mcp/mcp_test.go pass unchanged
  • grep 'mark3labs/mcp-go' go.mod go.sum — no matches
  • Zero code imports of mark3labs/mcp-go (only historical context in doc comments)

Closes #160 (the Renovate PR bumping mcp-go is now moot)

Replace the mcp-go type aliases in mcpcompat/mcp/alias.go with standalone
definitions that preserve the same JSON wire format. The mcp-go dependency
is now completely eliminated from the module graph.

The alias.go file (single chokepoint that re-exported ~100 types from
mcp-go) is replaced by 10 standalone files defining every type, constant,
and helper with identical JSON tags and marshaling logic. The wire-format
golden tests in mcp_test.go guard the conversion and pass unchanged.

Key changes:
- Delete alias.go; create consts.go, content.go, tools.go, jsonrpc.go,
  resources.go, prompts.go, elicitation.go, logging.go, initialize.go,
  helpers.go with standalone definitions
- Simplify ResourceTemplate.URITemplate from *URITemplate (wrapping
  yosida95/uritemplate/v3) to a plain string — nobody accesses the field
- Add ElicitationParams.Validate() method used by mcpcompat/server
- Fix stray direct mcp-go import in registry/converters/converters_test.go
  to use the shim
- Update doc.go to reflect standalone definitions rather than aliases
- go mod tidy removes mark3labs/mcp-go, yosida95/uritemplate, spf13/cast

Closes #160 (the Renovate PR bumping mcp-go is now moot)

@rdimitrov rdimitrov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 🚀 🚀

@JAORMX JAORMX merged commit e60be13 into main Jul 13, 2026
5 checks passed
@JAORMX JAORMX deleted the fix/remove-mcp-go-dependency branch July 13, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants