mcpregistry

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package mcpregistry stores MCP server definitions by ID.

It exposes small reader and writer interfaces plus an in-memory map-backed implementation via New. Applications typically inject a Reader into higher-level runtime components such as github.com/normahq/norma/pkg/runtime/agentfactory.Factory.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapRegistry

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

MapRegistry is an in-memory MCP registry.

func New

New creates an in-memory MCP registry initialized from initial values.

Example
registry := New(map[string]agentconfig.MCPServerConfig{
	"state": {
		Type: agentconfig.MCPServerTypeHTTP,
		URL:  "http://127.0.0.1:9090/mcp",
	},
})

cfg, ok := registry.Get("state")
fmt.Println(ok)
fmt.Println(cfg.Type)
Output:
true
http

func (*MapRegistry) Delete

func (r *MapRegistry) Delete(id string)

Delete removes the MCP server config for id.

func (*MapRegistry) Get

Get returns the MCP server config for id.

func (*MapRegistry) Set

Set stores or replaces the MCP server config for id.

type Reader

type Reader interface {
	Get(id string) (agentconfig.MCPServerConfig, bool)
}

Reader looks up MCP server configuration by ID.

type Registry

type Registry interface {
	Reader
	Writer
}

Registry combines lookup and mutation of MCP server configs.

type Writer

type Writer interface {
	Set(id string, cfg agentconfig.MCPServerConfig)
	Delete(id string)
}

Writer stores MCP server configuration by ID.

Jump to

Keyboard shortcuts

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