desktopconfig

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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

View Source
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

func DefaultClaudeDesktopPath() (string, error)

DefaultClaudeDesktopPath returns the per-OS path to Claude Desktop's config.

func HasServer

func HasServer(path, name string) (bool, error)

HasServer returns true if the named entry exists in "mcpServers".

func RemoveServer

func RemoveServer(path, name string) error

RemoveServer removes the named entry from "mcpServers". No-op if the file or entry is absent.

func UpsertServer

func UpsertServer(path, name string, server RemoteServer) error

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.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL