mcp

package
v1.167.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package mcp provides utilities for managing MCP (Model Context Protocol) server configurations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandEnvVars

func ExpandEnvVars(s string) string

ExpandEnvVars expands ${VAR} and ${VAR:-default} patterns in a string

func MergeAndWrite

func MergeAndWrite(inputDirs []string, outputPath string, opts MergeOptions) error

MergeAndWrite is a convenience function that merges configs and writes to output

func WriteConfig

func WriteConfig(config *MCPConfig, outputPath string) error

WriteConfig writes the merged config to a file

Types

type MCPConfig

type MCPConfig struct {
	MCPServers map[string]MCPServer `json:"mcpServers"`
}

MCPConfig represents the structure of MCP configuration

func MergeConfigs

func MergeConfigs(inputDirs []string, opts MergeOptions) (*MCPConfig, error)

MergeConfigs merges multiple MCP config directories into a single config. Later directories take precedence over earlier ones (last wins).

type MCPServer

type MCPServer struct {
	Type    string            `json:"type"`              // "http", "stdio", "sse"
	URL     string            `json:"url,omitempty"`     // for http/sse
	Command string            `json:"command,omitempty"` // for stdio
	Args    []string          `json:"args,omitempty"`    // for stdio
	Env     map[string]string `json:"env,omitempty"`
	Headers map[string]string `json:"headers,omitempty"` // for http/sse
}

MCPServer represents a single MCP server configuration

type MergeOptions

type MergeOptions struct {
	ExpandEnv bool
	Verbose   bool
	Logger    func(format string, args ...interface{})
}

MergeOptions configures the merge behavior

Jump to

Keyboard shortcuts

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