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
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
Tools

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

Tools
Discovery

The /.well-known/* manifests the plugin publishes automatically.

Discovery
Authentication

Bearer-token validation, OIDC providers, and mapping claims to users.

Authentication
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 uvx run-first guidance.

Reference Examples
Deployment

Sticky routing on Mcp-Session-Id, shared session stores, and multi-replica notes for Cloud Run / GKE.

Deployment
ADK Integration

Connect Google ADK clients to your remote Litestar MCP server.

ADK Integration