Usage Guide#

The Litestar MCP plugin follows a simple mental model: mark routes → the plugin discovers them → clients interact via the MCP transport. These pages cover each piece of that pipeline in isolation, with runnable examples drawn from docs.examples.

Configuration

Configure MCPConfig, task lifecycle, and environment overrides.

Configuration
Standalone Application

A class wrapping Litestar to register tools, resources, and prompts declaratively.

Standalone Application
Marking Routes

Expose handlers with mcp_tool / mcp_resource / mcp_prompt kwargs or the dedicated decorator.

Marking Routes
Prompts

Templated instructions exposed via prompts/list and prompts/get, including standalone and handler-based forms.

Prompts
Resources

Read-only payloads served via resources/list and resources/read, with RFC 6570 URI template support.

Resources
MCP Skills

Agent Skills served over MCP through skills/list, skills/get and resources/read.

MCP Skills
Tools

Executable operations served via tools/list and tools/call, validated through Litestar signature models.

Tools
Discovery

The server/discover request and why MCP publishes no /.well-known/* documents.

Discovery
Authentication

Application-owned authentication through Litestar middleware and guards, and mapping the resulting identity to users.

Authentication
Security

Domain authorization, task ownership boundaries, identity sources, and file/path argument guidance.

Security
Stdio Bridge

Connect stdio-only MCP clients to the loaded Litestar app's MCP endpoint.

Stdio Bridge
Framework Integration

Plugin ordering, guards, OpenAPI, and custom base paths.

Framework Integration
Reference Examples

The docs/examples/notes/ family chooser: Advanced Alchemy vs SQLSpec, no-auth/JWT/Cloud Run/IAP, with single-file uv run guidance.

Reference Examples
Deployment

Stateless multi-replica routing, durable task stores, and cross-worker subscription fan-out.

Deployment
Migrating to 0.12

Move initialize-era clients to MCP 2026-07-28 request metadata, extensions, subscriptions, and MRTR.

Migrating to MCP 0.12.0
A2A Integration

Mount an official A2A SDK handler alongside MCP.

A2A Integration
Agents

Multi-agent orchestration, PromptController, SkillController, and Google GenAI runtime.

Agents