pkg/

directory
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT

Directories

Path Synopsis
Package bouncer provides token validation, secret pattern matching, and streaming redaction for MCP proxy request/response filtering and security enforcement.
Package bouncer provides token validation, secret pattern matching, and streaming redaction for MCP proxy request/response filtering and security enforcement.
Package bridge connects an MCP client that only speaks stdio to a Streamable HTTP MCP endpoint, the shared LeanProxy gateway in practice.
Package bridge connects an MCP client that only speaks stdio to a Streamable HTTP MCP endpoint, the shared LeanProxy gateway in practice.
Package codemode is the experimental "code mode" spike (issue #325): the model sends one execute_code call holding a short JavaScript program, the program calls upstream tools and filters their results inside a sandbox, and only its final value goes back into the context window.
Package codemode is the experimental "code mode" spike (issue #325): the model sends one execute_code call holding a short JavaScript program, the program calls upstream tools and filters their results inside a sandbox, and only its final value goes back into the context window.
Package gateway provides the MCP gateway tools (list_servers, list_tools, invoke_tool) of the `serve` TCP front end.
Package gateway provides the MCP gateway tools (list_servers, list_tools, invoke_tool) of the `serve` TCP front end.
Package httpsec holds the Host/Origin validation, bearer-token and security-header helpers shared by LeanProxy's local HTTP servers: the admin endpoints (pkg/dashboard, pkg/metrics, issue #316) and the Streamable HTTP MCP front end (pkg/streamhttp, issue #309).
Package httpsec holds the Host/Origin validation, bearer-token and security-header helpers shared by LeanProxy's local HTTP servers: the admin endpoints (pkg/dashboard, pkg/metrics, issue #316) and the Streamable HTTP MCP front end (pkg/streamhttp, issue #309).
mcp
exposure
Package exposure decides how LeanProxy exposes the upstream tools to one MCP client (issue #322): through its own discovery router (search_tools, list_servers, list_tools, invoke_tool), or directly, every upstream tool listed in tools/list under a namespaced name, so a client with native tool search (Claude Code, the Anthropic and OpenAI APIs, Cursor, ...) can defer and discover the tools itself.
Package exposure decides how LeanProxy exposes the upstream tools to one MCP client (issue #322): through its own discovery router (search_tools, list_servers, list_tools, invoke_tool), or directly, every upstream tool listed in tools/list under a namespaced name, so a client with native tool search (Claude Code, the Anthropic and OpenAI APIs, Cursor, ...) can defer and discover the tools itself.
governor
Package governor holds the building blocks of the response token governor (issue #319): its `response:` config block, the per-session spill store that keeps the full (redacted) result of a shortened tool call, the smart text and structural JSON truncation, the read_result retrieval primitives (paging, grep, a JSONPath subset), and the field projection of #320 (project.go).
Package governor holds the building blocks of the response token governor (issue #319): its `response:` config block, the per-session spill store that keeps the full (redacted) result of a shortened tool call, the smart text and structural JSON truncation, the read_result retrieval primitives (paging, grep, a JSONPath subset), and the field projection of #320 (project.go).
responsecache
Package responsecache implements the opt-in, exact-match tools/call response cache (issue #299): a bounded-by-bytes LRU keyed on the pre-redaction request, storing the redacted response.
Package responsecache implements the opt-in, exact-match tools/call response cache (issue #299): a bounded-by-bytes LRU keyed on the pre-redaction request, storing the redacted response.
Package migrate owns the on-disk YAML schema for LeanProxy's user-server configuration.
Package migrate owns the on-disk YAML schema for LeanProxy's user-server configuration.
Package policy is the per-tool policy layer (issue #314, audit S14, OWASP MCP02 / MCP07): which upstream tools a client may call, which ones need a human's confirmation first, and which ones are refused.
Package policy is the per-tool policy layer (issue #314, audit S14, OWASP MCP02 / MCP07): which upstream tools a client may call, which ones need a human's confirmation first, and which ones are refused.
Package pool provides stdio MCP server subprocess pooling and management.
Package pool provides stdio MCP server subprocess pooling and management.
mcpregistry
Package mcpregistry is a client for the official MCP Registry API (https://registry.modelcontextprotocol.io/, API version v0), used as the default marketplace source (issue #313).
Package mcpregistry is a client for the official MCP Registry API (https://registry.modelcontextprotocol.io/, API version v0), used as the default marketplace source (issue #313).
Package streamhttp is LeanProxy's own MCP Streamable HTTP front end (issue #309): one shared local gateway that any number of MCP clients reach by URL, instead of every IDE spawning its own `server run --stdio` process with its own child servers.
Package streamhttp is LeanProxy's own MCP Streamable HTTP front end (issue #309): one shared local gateway that any number of MCP clients reach by URL, instead of every IDE spawning its own `server run --stdio` process with its own child servers.
Package telemetry is the optional OpenTelemetry bootstrap for leanproxy-mcp (issue #317): OTLP/HTTP trace and metric exporters, off by default.
Package telemetry is the optional OpenTelemetry bootstrap for leanproxy-mcp (issue #317): OTLP/HTTP trace and metric exporters, off by default.
Package toolpin pins upstream tool definitions and detects tool poisoning and rug pulls (issue #310, OWASP MCP03).
Package toolpin pins upstream tool definitions and detects tool poisoning and rug pulls (issue #310, OWASP MCP03).
Package toolsearch is the ranked, cross-server tool index behind the search_tools gateway tool (issue #305).
Package toolsearch is the ranked, cross-server tool index behind the search_tools gateway tool (issue #305).
This file (issue #324) rebuilds an auditable savings breakdown purely from counters the proxy actually recorded: the response governor's GovernorStats (#319-#321), the schema/discovery counters (#324) and telemetry's plain counters (#317), all read from this package's JSONL store (Store.Load).
This file (issue #324) rebuilds an auditable savings breakdown purely from counters the proxy actually recorded: the response governor's GovernorStats (#319-#321), the schema/discovery counters (#324) and telemetry's plain counters (#317), all read from this package's JSONL store (Store.Load).

Jump to

Keyboard shortcuts

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