Documentation
¶
Overview ¶
Copyright (c) Roman Atachiants and contributors. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for details. Package mcp implements the optional MCP endpoint for llmux. It exposes application-owned agents as MCP tools over stateless Streamable HTTP, reusing the shared agent execution and lifecycle machinery through the Host seam. MCP SDK types never cross back into the public agent contract.
Index ¶
Constants ¶
const ProtocolVersion = "2026-07-28"
ProtocolVersion is the MCP protocol revision served by Transport. Requests at older revisions are rejected; legacy initialize handshakes cannot proceed against this endpoint.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host interface {
// List returns the caller-visible unified catalog for this request.
// Only entries with a nonempty Info.Tool become MCP tools. A nil or empty
// result yields an empty tool catalog rather than a hidden failure.
List(ctx context.Context) (map[string]chat.Info, error)
// Run executes one canonical non-streaming request through the shared
// lifecycle coordinator. Replays return without preparation or execution.
// Accepted work that fails preparation is finalized exactly once.
Run(ctx context.Context, idempotencyKey string, parsed *protocol.ParsedRequest) (chat.Response, error)
// Limits returns the handler request and output limits.
Limits() chat.Limits
// LogError observes operational failures without exposing them.
LogError(ctx context.Context, err error)
}
Host is the execution seam provided by the llmux Handler. It keeps the MCP adapter from duplicating lifecycle machinery: resolution, validation, acceptance (including CatalogAgent), preparation, execution, and Finish.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport owns the stateless Streamable HTTP endpoint for one Handler.
func NewTransport ¶
NewTransport builds the MCP endpoint transport.