Documentation
¶
Overview ¶
Package mcpsource defines the MCPSource interface and registry for host-pluggable MCP server provisioning. An MCPSource is responsible for standing up an MCP endpoint (starting a container, reaching into a remote service, etc.) and returning its URL + Headers. Arena opens sources at scope boundaries (run / scenario / session) and feeds the result into the existing runtime/mcp registry via its URL/Headers fields.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListMCPSources ¶
func ListMCPSources() []string
ListMCPSources returns the names of every registered source, sorted. Used for "unknown source" error messages.
func RegisterMCPSource ¶
RegisterMCPSource adds a named source implementation. Called from init() blocks in source packages (e.g., mcpsource/docker). Panics on duplicate registration to surface programmer errors at startup.
Types ¶
type MCPConn ¶
type MCPConn struct {
URL string
Headers map[string]string
// ContainerID is the backing container's ID when the source runs one (e.g.
// the docker source); empty for non-container backends. Surfaced into
// SessionEvent metadata so session hooks can reach the sandbox (e.g. a
// workspace-capture hook running `docker cp`).
ContainerID string
}
MCPConn carries the coordinates arena needs to construct an mcp.Client. Fed into mcp.ServerConfig{URL, Headers} in the existing code path.
type MCPSource ¶
type MCPSource interface {
Open(ctx context.Context, args map[string]any) (MCPConn, io.Closer, error)
}
MCPSource opens an MCP endpoint with caller-supplied args.
Implementations validate their own args schema; arena treats args as opaque and only expands scenario template variables before calling Open.
The returned io.Closer is called exactly once when the scope ends. A source that needs no teardown returns io.NopCloser(nil).
func LookupMCPSource ¶
LookupMCPSource returns the source registered under name, if any.
type Scope ¶
type Scope string
Scope is the lifecycle boundary at which a source is opened and closed.
Known scope values. ScopeRun opens once per arena run; ScopeScenario once per scenario; ScopeSession once per session (repetition) within a scenario.
func ParseScope ¶
ParseScope converts a YAML string to a Scope, erroring on unknown values.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package docker implements an MCPSource that provisions MCP servers in Docker containers.
|
Package docker implements an MCPSource that provisions MCP servers in Docker containers. |
|
register
Package register wires the Docker MCPSource into the global registry via a blank import.
|
Package register wires the Docker MCPSource into the global registry via a blank import. |