Background
MCP Resources are designed for static/reference data that clients can cache and browse, while Tools are for actions with side effects or dynamic computation. Currently, several tools return large static datasets on every call.
Current State
- Device profiles are already registered as Resources (
tools.go:125-156, URI device://<id>)
- Resource capabilities:
(false, false) — no templates, no subscriptions (main.go:28)
- The following tools return static reference data but are registered as Tools:
show_decoder_details (tools.go:30-36, handlers.go:104-124) — full decoder documentation
show_driver_details (tools.go:38-44, handlers.go:126-146) — full driver details + raw output
Problem
- LLMs calling these tools consume tokens for data that is essentially static documentation
- MCP clients cannot cache Tool results, but can cache Resource contents
- Decoder/driver details are reference data, not actions — semantically they belong as Resources
Proposed Changes
- Register decoder details as Resources with URI
decoder://<id> (e.g. decoder://uart)
- Register driver details as Resources with URI
driver://<id> (e.g. driver://demo)
- Keep the existing Tools as convenience wrappers (backward compatibility) or deprecate them
- Enable resource list capabilities: change
WithResourceCapabilities(false, false) to (true, false) if resource templates are used
Acceptance Criteria
Affected Files
internal/tools/tools.go — add resource registration
cmd/sigrok-mcp-server/main.go — update resource capabilities
internal/tools/tools_test.go — add tests
Background
MCP Resources are designed for static/reference data that clients can cache and browse, while Tools are for actions with side effects or dynamic computation. Currently, several tools return large static datasets on every call.
Current State
tools.go:125-156, URIdevice://<id>)(false, false)— no templates, no subscriptions (main.go:28)show_decoder_details(tools.go:30-36,handlers.go:104-124) — full decoder documentationshow_driver_details(tools.go:38-44,handlers.go:126-146) — full driver details + raw outputProblem
Proposed Changes
decoder://<id>(e.g.decoder://uart)driver://<id>(e.g.driver://demo)WithResourceCapabilities(false, false)to(true, false)if resource templates are usedAcceptance Criteria
decoder://<id>MCP Resourcesdriver://<id>MCP ResourcesAffected Files
internal/tools/tools.go— add resource registrationcmd/sigrok-mcp-server/main.go— update resource capabilitiesinternal/tools/tools_test.go— add tests