Documentation
¶
Overview ¶
Package mcpgateway implements the ark MCP gateway — an http.Handler that exposes ArkAgent capabilities as callable MCP tools over the standard SSE transport.
A single Gateway instance serves all namespaces. Agent-as-tool calls are translated into task queue submissions; results are returned as MCP tool responses. The agent runtime is unchanged — it never knows whether a task came from a pipeline step or a tool call.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GatewayURL ¶
GatewayURL returns the base agent URL for the given agent. Used by the ArkAgent reconciler to build the resolved MCPServerSpec.URL. The agent runtime MCP client appends /tools/list and /tools/call to this URL.
Types ¶
type Gateway ¶
type Gateway struct {
// contains filtered or unexported fields
}
Gateway is the MCP SSE gateway. It implements http.Handler. A single instance is registered as a controller-runtime Runnable and serves all namespaces on a dedicated port.
func New ¶
New creates a Gateway. tq is the operator's shared task queue (used as the fallback for standalone agents). taskQueueURL is the base connection URL used when opening agent-specific queue streams.
func (*Gateway) ServeHTTP ¶
func (g *Gateway) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP dispatches incoming requests to the appropriate handler.
GET /healthz → 200 OK GET /namespaces/:ns/agents/:name/sse → MCP SSE session (external clients) POST /namespaces/:ns/agents/:name/message → MCP JSON-RPC message (SSE transport) POST /namespaces/:ns/agents/:name/tools/list → REST tools discovery (agent runtime) POST /namespaces/:ns/agents/:name/tools/call → REST tool call (agent runtime)