Export MCP notification-method constants and converge call sites
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.2k
- Forks
- 300
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 184
Description
Context
A library-reuse review of #5934 found that MCP notification/request method-name wire strings are hardcoded in several places because no shared, exported source defines them:
pkg/transport/proxy/streamable/dispatcher.go— #5934 collected them into a localconstblock (notifications/tools/list_changed,notifications/resources/list_changed,notifications/prompts/list_changed,notifications/progress,notifications/resources/updated,notifications/message,resources/subscribe,resources/unsubscribe).pkg/mcp/parser.go— hardcodes the same strings as (unexported) map keys for request parsing.pkg/vmcp/forwarding.go— declares its ownMethodProgressNotification/MethodLogNotificationconstants.
toolhive-core/mcpcompat/mcp already exports some method/level constants (e.g. MethodSetLogLevel, LoggingLevel* — now reused in #5934), and the go-sdk defines the notification methods but only unexported, so they aren't reusable today.
Proposed work
- Upstream the missing MCP notification/request method-name constants into
toolhive-core/mcpcompat/mcp(the shared low-level package this repo already depends on), or export them frompkg/mcpif that's the more appropriate home. - Converge the call sites (
streamableproxy local block,pkg/mcp/parser.gomap keys,pkg/vmcpconstants) onto the single exported source so the wire strings are defined once.
Notes
- Avoid the wrong dependency direction: transport/
pkg/mcpmust not importpkg/vmcp. A shared home intoolhive-core/mcpcompatorpkg/mcpkeeps layering correct. - Confirmed as a follow-up (not a blocker) by the #5934 review panel.
Generated with Claude Code
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the existing exported constants in toolhive-core/mcpcompat/mcp, then compare the method strings and constants in pkg/transport/proxy/streamable/dispatcher.go, pkg/mcp/parser.go, and pkg/vmcp/forwarding.go. Check the relevant Go package tests before and after the change. Done means the listed wire strings have one exported source and the call sites use it without reversing the package dependency direction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend-api-design
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100