mcp-gateway

command
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package main implements the MCP gateway service.

Request filter pipeline

Every inbound request is processed through a fixed ordered pipeline of five stages before audit/analytics finalization runs unconditionally as stage 6. Stage order is security-sensitive and is fixed in code:

Stage 1 – InspectFilter:   bounded body capture; RPC method and tool name extraction
Stage 2 – PolicyFilter:    atomic policy snapshot acquisition; OAuth metadata early-exit
Stage 3 – AuthFilter:      optional OAuth and adapter-certificate authentication
Stage 4 – AuthzFilter:     authorization and session/grant evaluation
Stage 5 – UpstreamFilter:  credential cleanup; path rewrite; upstream proxy
Stage 6 – (orchestrator):  audit/analytics finalization

Ordering guarantees:

  • Authentication (stage 3) always completes before authorization (stage 4).
  • The policy snapshot (stage 2) is captured once and held immutable for the entire exchange lifetime; no later stage may re-acquire it.
  • Authorization consumes AuthenticatedRequest and produces EvaluatedRequest; upstream preparation (stage 5) only reads its policy and identity.

Filters have typed phase inputs and outputs (see filter.go). A non-nil FilterResponse halts processing; stage 6 runs from the HTTP orchestrator.

Directories

Path Synopsis
Package credential is the shared credential gateway.
Package credential is the shared credential gateway.

Jump to

Keyboard shortcuts

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