mcp

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mcp implements the Model Context Protocol gateway (шаг хребта после 6): streamable-HTTP JSON-RPC passthrough to upstream MCP servers, fronted by virtual-key auth so budgets/RPM/concurrency apply to tool calls exactly like model traffic. Tool-call events land in the same request_events pipeline (endpoint /v1/mcp/<server>, no token accounting).

v1 scope: one configured HTTP endpoint per server; stdio transports are out of scope (the gateway is a network process).

Tool-surface pinning (G2): the first tools/list response per server is pinned (sha256 + tool names); any later change is audited and, when the server declares `pin_tools: true`, the changed listing is BLOCKED (409) as a rug-pull guard. Pins are per-process (in-memory).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gateway

type Gateway struct {
	Snapshot      func() *config.Snapshot
	Auth          *policy.Auth
	Client        *http.Client
	Telemetry     telemetry.Recorder
	ConfigVersion int64
	// contains filtered or unexported fields
}

func (*Gateway) Serve

func (g *Gateway) Serve(w http.ResponseWriter, r *http.Request, name string)

Serve handles POST /v1/mcp/<server>. name is the path segment after the prefix. Streaming responses (SSE from the upstream) are forwarded verbatim.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL