How tuskira/ai-agent-gateway works
AI Agent Gateway is a self-hosted gateway for MCP tools and multiple LLM providers. Agents authenticate at the gateway, use profile-scoped MCP tools, prompts, resources, and skills, or make proxied LLM calls; the gateway can inject outbound credentials and capture calls for logs and analytics. Administrators manage tenants, connectors, profiles, keys, models, and users through the REST API and embedded console. The README documents the major capabilities; several internal links below are supported by sampled source, while unsampled integrations are omitted rather than inferred.
Main entry points: orchestrator.go MCP orchestrator · llmplane/router.go LLM request router · api/router.go Control API · main.go Gateway process
Components 20
Gateway runtime
- Gateway process
cmd/gateway/main.go - API key auth
internal/auth/apikey/authenticator.go
MCP access
- MCP orchestrator
internal/dataplane/orchestrator/orchestrator.go - Tool routing
internal/dataplane/router/router.go - Backend MCP client
internal/dataplane/client/client.go - MCP sessions
internal/dataplane/session/session.go - Skills validation
internal/skills/validate.go
LLM proxy
- LLM request router
internal/llmplane/router.go - Dialect translation
internal/llmplane/translate/engine.go - LLM providers
internal/llmplane - Tool discovery
internal/discovery/discovery.go
Administration
- Control API
internal/api/router.go - Admin handlers
internal/api/handlers/connectors.go - Admin console
web/src/App.tsx
Persistence and analytics
- PostgreSQL store
internal/store/postgres/store.go - Log ingestion
internal/api/handlers/ingest.go - Analytics sink
pkg/sink/clickhouse/ingest.go
Other components
- Agent client
- MCP server
- LLM service
Connections 24
- Agent client → API key auth: authenticates
README.md - API key auth → MCP orchestrator: authorizes
- API key auth → LLM request router: authorizes
- Agent client → MCP orchestrator: calls MCP
README.md - MCP orchestrator → Tool routing: resolves tools
internal/dataplane/orchestrator/orchestrator.go - MCP orchestrator → Backend MCP client: dispatches calls
internal/dataplane/orchestrator/orchestrator.go - MCP orchestrator → MCP sessions: uses sessions
internal/dataplane/orchestrator/orchestrator.go - MCP orchestrator → Skills validation: serves skills
README.md - Backend MCP client → MCP server: sends MCP
README.md - Agent client → LLM request router: sends LLM calls
README.md - LLM request router → Dialect translation: translates dialect
internal/llmplane/translate/engine.go - LLM request router → LLM providers: routes requests
internal/llmplane/server.go - LLM providers → LLM service: calls upstream
README.md - LLM request router → Tool discovery: scans responses
internal/llmplane/router.go - Gateway process → Control API: starts plane
cmd/gateway/main.go - Gateway process → MCP orchestrator: starts plane
cmd/gateway/main.go - Gateway process → LLM request router: starts plane
- Admin console → Control API: uses REST
- Control API → Admin handlers: routes requests
internal/api/router.go - Admin handlers → PostgreSQL store: manages records
- Agent client → Log ingestion: submits logs
internal/api/handlers/ingest.go - Log ingestion → Analytics sink: writes records
- LLM request router → Analytics sink: captures calls
README.md - Control API → PostgreSQL store: requires persistence
README.md