mcpconfig

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mcpconfig reads MCP (Model Context Protocol) server configuration from the Claude Code settings file (~/.claude/settings.json).

V1 scope:

  • Lists plugins from the enabledPlugins map as MCP entries.
  • Status is "enabled" for true entries, "disabled" for false entries.
  • Tool count is 0 (live socket ping is deferred to V2).

LSP detection is explicitly out of scope for V1 — callers receive an empty LSP list. This is a known limitation documented here.

Read failure (file missing, permission denied, malformed JSON) is treated as an empty configuration — no error is propagated to the caller.

The Source type satisfies ports.MCPSource — pass it wherever that interface is expected.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source reads MCP configuration from the Claude Code settings file.

Backed by a claudesettings.Reader so the parse is served from cache when the file hasn't changed since the last call. Production code should share the Reader with lspscan so the per-tick reads coalesce.

Source satisfies the ports.MCPSource interface.

func New

func New() Source

New constructs a Source with its own private settings Reader at the default path. Use NewWith to share a Reader across adapters.

func NewWith

func NewWith(r *claudesettings.Reader) Source

NewWith constructs a Source backed by the given settings Reader. A nil reader is treated as "use a fresh default-path Reader".

func (Source) MCPs

func (s Source) MCPs() ([]ports.MCPEntry, error)

MCPs implements ports.MCPSource.

It returns the list of configured MCP entries from the settings file, sorted alphabetically by name for stable output.

An empty slice (no error) is returned when:

  • The settings file does not exist.
  • The file cannot be read or parsed.
  • No enabledPlugins key is present.

Jump to

Keyboard shortcuts

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