mcpresolve

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package mcpresolve turns a catalog MCPServer ref (name + tag) into a ResolvedMCP describing the URL and headers (if remote) the caller should wire into local-dev .env. Sits behind a Fetcher interface so init code can drive it from the root registry client while tests inject a fake.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher interface {
	Fetch(ctx context.Context, name, tag string) (*v1alpha1.MCPServer, error)
}

Fetcher abstracts the one registry call this package needs: given a catalog ref, return the MCPServer record. The concrete implementation delegates to client.GetTyped with the root registry client.

type ResolvedMCP

type ResolvedMCP struct {
	Name          string
	RemoteURL     string
	RemoteHeaders map[string]string
}

ResolvedMCP carries the fields a caller needs to decide whether (and what) to write into .env. For Source-mode records, RemoteURL is empty — callers MUST treat that as "skip the .env write." RemoteHeaders is pre-flattened to a plain map with empty-Value entries dropped, ready to embed in MCP_SERVERS_CONFIG as JSON.

func Resolve

func Resolve(ctx context.Context, f Fetcher, name, tag string) (*ResolvedMCP, error)

Resolve fetches the MCPServer at (name, tag) and returns a ResolvedMCP. Errors are wrapped with the ref so callers can surface "--mcp <X>: <err>".

Jump to

Keyboard shortcuts

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