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 ¶
func New(initial map[string]agentconfig.MCPServerConfig) *MapRegistry
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 ¶
func (r *MapRegistry) Get(id string) (agentconfig.MCPServerConfig, bool)
Get returns the MCP server config for id.
func (*MapRegistry) Set ¶
func (r *MapRegistry) Set(id string, cfg agentconfig.MCPServerConfig)
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 Writer ¶
type Writer interface {
Set(id string, cfg agentconfig.MCPServerConfig)
Delete(id string)
}
Writer stores MCP server configuration by ID.