Documentation
¶
Overview ¶
Package mmmcp combines configured MCP components behind one server.
Index ¶
- func ConfigFromContext(ctx context.Context) (*config.Config, bool)
- func ConfigIDFromContext(ctx context.Context) (string, bool)
- func ContextWithConfig(ctx context.Context, cfg *config.Config) context.Context
- func ContextWithConfigID(ctx context.Context, id string) context.Context
- func ContextWithDSN(ctx context.Context, dsn string) context.Context
- func DSNFromContext(ctx context.Context) (string, bool)
- type AuthorizationError
- type Composite
- func (c *Composite) Close() error
- func (c *Composite) HTTPHandler() http.Handler
- func (c *Composite) Refresh(ctx context.Context) error
- func (c *Composite) ResolveToolCall(ctx context.Context, cfg *config.Config, name string, ...) (catalog.ResolvedToolCall, bool, error)
- func (c *Composite) RunStdio(ctx context.Context) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigFromContext ¶
ConfigFromContext returns the complete configuration snapshot attached to ctx.
func ConfigIDFromContext ¶ added in v0.1.3
ConfigIDFromContext returns the nonempty configuration ID attached to ctx.
func ContextWithConfig ¶
ContextWithConfig attaches a complete configuration snapshot to ctx.
func ContextWithConfigID ¶ added in v0.1.3
ContextWithConfigID identifies a configuration across stateless requests and notification subscriptions. The ID must remain stable across configuration changes, and all requests sharing an ID must have the same configuration view. An empty ID disables shared notification tracking.
func ContextWithDSN ¶
ContextWithDSN selects event storage for work performed with ctx. An empty DSN explicitly selects SQLite.
Types ¶
type AuthorizationError ¶
type AuthorizationError = component.AuthorizationError
AuthorizationError reports an authorization challenge returned by an HTTP component.
type Composite ¶
type Composite struct {
// contains filtered or unexported fields
}
Composite is a reusable composite MCP server.
func (*Composite) HTTPHandler ¶
HTTPHandler returns the Streamable HTTP MCP, health, and readiness handler.
func (*Composite) ResolveToolCall ¶ added in v0.2.0
func (c *Composite) ResolveToolCall(ctx context.Context, cfg *config.Config, name string, arguments json.RawMessage) (catalog.ResolvedToolCall, bool, error)
ResolveToolCall resolves a call against the same current catalog used by the frontend. Callers can use the result for policy checks before forwarding the request; the frontend resolves the call again before invoking a component.
type Options ¶
type Options struct {
Logger *slog.Logger
HTTPClient *nethttp.Client
// ClientInfo identifies mmmcp to downstream components. Nil uses mmmcp/dev.
ClientInfo *mcp.Implementation
// ForwardClientInfo forwards the frontend client identity to downstream components.
// ClientInfo is used when the frontend identity is unavailable.
ForwardClientInfo bool
// OAuth supplies a component-specific OAuth handler for downstream HTTP clients.
OAuth http.OAuthHandlerProvider
// DSN selects the default event storage. An empty DSN selects SQLite.
DSN string
// LookupEnv supplies the allow-listed baseline for command components.
LookupEnv func(string) (string, bool)
// CommandTerminateDuration controls each SDK command shutdown stage.
CommandTerminateDuration time.Duration
// PageSize limits each composite feature-list page. Zero returns a complete family.
PageSize int
// Storage controls SQL connection pools, data location, and event retention.
Storage storage.Options
}
Options configures the composite runtime.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package catalog compiles immutable composite feature snapshots and routes.
|
Package catalog compiles immutable composite feature snapshots and routes. |
|
cmd
|
|
|
mmmcp
command
|
|
|
Package component defines the downstream MCP boundary used by the catalog and composite server.
|
Package component defines the downstream MCP boundary used by the catalog and composite server. |
|
http
Package http implements Streamable HTTP component clients.
|
Package http implements Streamable HTTP component clients. |
|
stdio
Package stdio implements isolated command-backed MCP components.
|
Package stdio implements isolated command-backed MCP components. |
|
Package namespace constructs collision-safe MCP identities.
|
Package namespace constructs collision-safe MCP identities. |
|
scripts
|
|
|
imagecheck
command
|
|
|
Package storage provides persistent state used by the composite server.
|
Package storage provides persistent state used by the composite server. |
|
migrations
Package migrations embeds and applies storage schema migrations.
|
Package migrations embeds and applies storage schema migrations. |
|
Package testserver provides reusable HTTP MCP component fixtures.
|
Package testserver provides reusable HTTP MCP component fixtures. |
|
stdiohelper
command
|
|
|
Package toolsearch indexes allowed MCP tools and implements search tool responses.
|
Package toolsearch indexes allowed MCP tools and implements search tool responses. |