Documentation
¶
Overview ¶
Package desktopconfig reads, updates, and writes Claude Desktop's MCP server config file (claude_desktop_config.json) atomically and without clobbering unrelated entries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedOS = errors.New("Claude Desktop is not available on this OS; use --client print")
ErrUnsupportedOS indicates Claude Desktop is not available on the current OS.
Functions ¶
func DefaultClaudeDesktopPath ¶
DefaultClaudeDesktopPath returns the per-OS path to Claude Desktop's config.
func RemoveServer ¶
RemoveServer removes the named entry from "mcpServers". No-op if the file or entry is absent.
func UpsertServer ¶
UpsertServer reads the JSON file at path (creating it if absent), inserts or updates the named MCP server entry under "mcpServers", and writes the result atomically (temp file + rename). All other top-level keys and sibling server entries are preserved.
server can be any JSON-marshalable value; in practice either RemoteServer (HTTP) or StdioServer (stdio bridge). The caller picks the shape; this function does not validate it.
Types ¶
type RemoteServer ¶
type RemoteServer struct {
Type string `json:"type,omitempty"`
URL string `json:"url"`
Headers map[string]string `json:"headers,omitempty"`
}
RemoteServer matches the JSON shape Claude Desktop expects for HTTP MCP servers, per docs/mcp/remote-setup.md.
type StdioServer ¶ added in v0.2.1
StdioServer matches the JSON shape Claude Desktop expects for a stdio MCP server: a subprocess invocation. The CLI uses this to install itself as a bridge (`taufinity mcp stdio`), which Claude Desktop launches and which forwards JSON-RPC frames to Studio's /mcp endpoint. The bearer token is NOT embedded — the bridge subprocess reads credentials.json at startup.