Skip to content

mcpsnoop wrap for Claude Desktop, so the config edit stops being manual #136

Description

@kerlenton

Context

Everything about mcpsnoop is zero-config except the one step at the very start, hand-editing a client config to wrap the server command. It is the only manual operation left, and it lands before the user has any reason to trust the tool enough to edit a config for it.

This stalled before because config formats differ across clients and drift over time, which made the how unclear. Narrowing to one client removes that objection without pretending the wider problem is solved.

Proposed change

wrap locates the config, backs it up, and rewrites the named server's command to run through mcpsnoop --. unwrap restores it. Re-running wrap does not double-wrap. --dry-run prints the change without writing. A missing config or an unknown server name is a clear message, not a stack trace.

Do Claude Desktop completely, and structure it so a second client is a new file rather than a rewrite of this one.

Scope boundary

One client. No discovery across clients, no touching a config the user did not name, and nothing written without a backup first.

Acceptance criteria

  • wrap edits the config and unwrap restores it byte for byte
  • Idempotent under repeated wrap
  • --dry-run writes nothing
  • Clear errors for a missing config or an unknown server
  • Adding a second client later means adding a file, not changing this one
  • Tests against fixture configs for all of the above

Files

  • new cmd/mcpsnoop/wrap.go, registered in cmd/mcpsnoop/main.go
  • internal/paths/paths.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions