litestar-org/litestar-skills/litestar-mcp
Claude Code and agent skill by litestar-org/litestar-skills
- community
Checking that the SKILL.md file is still in the repository.
Auto-activate for litestar_mcp, LitestarMCP, MCP, MCPConfig, MCPSkillsConfig, SkillController, LitestarA2A, A2AConfig, @mcp.tool/resource/prompt, mcp_tool=, or stdio MCP. Not for non-Litestar MCP SDK servers.
Install
npx vskill@latest install litestar-org/litestar-skills/litestar-mcpSKILL.md
litestar-mcp
litestar-mcp exposes explicitly marked Litestar route handlers as Model Context Protocol (MCP) tools, resources, and prompts over JSON-RPC 2.0, and provides an optional A2A 1.0 adapter (LitestarA2A) backed by the official a2a-sdk.
litestar-mcp follows the stateless MCP specification (protocol 2026-07-28 with backward compatibility for 2025-06-18 and 2025-03-26). The MCP transport is POST-only and request-scoped: each request supplies protocol version, method, and capabilities. Call server/discover for capabilities. Features include the io.modelcontextprotocol/skills catalog (MCPSkillsConfig), durable task execution over litestar-queues (QueueTaskExecutor, DurableWorkflowEngine), the stdio-to-HTTP bridge (httpx2), standards-backed LitestarA2A (litestar-mcp[a2a]), and route authentication integration with litestar-security. See Stateless Protocol.
Mark routes by passing mcp_tool="name", mcp_resource="name", or mcp_prompt="name" directly to the Litestar route decorator — Litestar funnels unknown kwargs into handler.opt, so no opt={...} wrapper is needed. Use the decorator forms for structured metadata: @mcp_tool adds schemas, annotations, scopes, and task policy; @mcp_prompt adds title, arguments, and icons. Route description keys are mcp_description, mcp_resource_description, and mcp_prompt_description; MCPOptKeys can rename every key the plugin reads. There is no opt={"mcp_tool_name": ...} form or mcp_exclude key. To hide a route, leave it unmarked.
Code Style Rules
- PEP 604 unions:
T | None, neverOptional[T] - Consumer Litestar app modules MAY use
from __future__ import annotations - Async all I/O. Pure standalone
@mcp.tool/@mcp.resource/@mcp.promptfunctions may be sync; keep blocking I/O out of the event loop.
Quick Reference
Install
The stdio-to-Streamable-HTTP bridge is included in the core package (httpx2). Install the a2a extra when mounting the optional A2A 1.0 SDK adapter (LitestarA2A):
Basic Setup
The transport and discovery surface across the ecosystem is:
| Endpoint | Owner | Purpose | |
|---|---|---|---|
POST /mcp | LitestarMCP | The only MCP transport route. JSON-RPC endpoint for server/discover, tools/*, resources/*, resources/templates/list, resources/directory/read, prompts/*, skills/*, completion/complete, subscriptions/listen, and optional tasks/* methods | |
POST /a2a | LitestarA2A (litestar-mcp[a2a]) | Optional A2A 1.0 JSON-RPC and SSE streaming endpoint | |
GET /.well-known/agent-card.json | LitestarA2A (litestar-mcp[a2a]) | Standard A2A 1.0 agent card discovery route (with ETag and Cache-Control) | |
GET /.well-known/oauth-protected-resource | SecurityPlugin (litestar-security) | RFC 9728 OAuth 2.1 protected-resource metadata via SecurityConfig(protected_resource=ProtectedResourceConfig(...)) |
MCPConfig
| Option | Type | Default | Description | ||
|---|---|---|---|---|---|
base_path | str | "/mcp" | URL prefix for the MCP transport endpoint | ||
include_in_schema | bool | False | Include the /mcp router in OpenAPI | ||
name | `str \ | None` | None | Server name; defaults to OpenAPI title | |
instructions | `str \ | None` | None | Server instructions advertised to MCP clients | |
guards | `list[Any] \ | None` | None | Litestar guards applied to the MCP router | |
route_opt | `dict[str, Any] \ | None` | None | Route opt mapping merged into the mounted MCP router (e.g., {AUTH_POLICY_OPT_KEY: required("api-key", "oidc")} with litestar-security) | |
allowed_origins | `list[str] \ | None` | None | Restrict accepted Origin headers | |
include_operations | `list[str] \ | None` | None | Only expose matching operation names | |
exclude_operations | `list[str] \ | None` | None | Exclude matching operation names | |
include_tags | `list[str] \ | None` | None | Only expose routes with matching OpenAPI tags | |
exclude_tags | `list[str] \ | None` | None | Exclude routes with matching OpenAPI tags | |
tasks | `bool \ | MCPTaskConfig` | False | Enable MCP task support (io.modelcontextprotocol/tasks). Pass MCPTaskConfig to configure the backing Store and record TTLs | |
skills | `MCPSkillsConfig \ | None` | None | Enable the io.modelcontextprotocol/skills catalog serving <path>/<name>/SKILL.md directories | |
opt_keys | MCPOptKeys | MCPOptKeys() | Rename the handler.opt keys the plugin reads | ||
cache_ttl_ms | int | 0 | Response cache lifetime in milliseconds; 0 disables caching | ||
cache_scope | Literal["private", "public"] | "private" | Whether cached responses may be shared between callers | ||
subscription_max_streams | int | 10000 | Max concurrent SSE streams | ||
subscription_keepalive_seconds | float | 15.0 | Seconds between SSE keepalive pings | ||
stream_queue_capacity | int | 256 | Maximum queued progress notifications per request stream | ||
stream_cleanup_timeout | float | 5.0 | Positive finite seconds allowed for cooperative stream producer cleanup | ||
subscription_channels | `Any \ | None` | None | Channels backend backing subscriptions/listen fan-out | |
list_page_size | int | 100 | Page size for tools/list, resources/list, resources/templates/list, skills/list, prompts/list, and resources/directory/read | ||
before_tool_call | `BeforeToolCallHook \ | None` | None | Observe each tools/call before dispatch | |
after_tool_call | `AfterToolCallHook \ | None` | None | Observe each tools/call result, exception, and duration | |
max_blob_bytes | `int \ | None` | 25 * 1024 * 1024 | Maximum raw byte length for base64-embedded blobs; None disables the cap |
Filters (include_tags/exclude_tags/include_operations/exclude_operations) gate both list responses and direct invocation. A filtered tool/resource/template behaves like an unknown name or URI intools/call/resources/read; still useguardsorroute_optauth policies for real access control.
Route Marking
mcp_resource_template takes effect alongside mcp_resource — the resource supplies the name the template binds to. A handler can expose more than one MCP role (a tool and a resource) at once; the description-override keys (mcp_description vs mcp_resource_description) are kind-specific so each surface can carry its own prose.
Register prompts not bound to a route with the @mcp_prompt decorator plus LitestarMCP(prompts=[...]):
Use structured metadata when the agent needs sharper tool selection:
Accessing Request Context And Progress
Retrieve active MCP scope and metadata inside tool, resource, or prompt handlers with get_mcp_request_context(). When the client supplies a progress token (params._meta.progressToken), call await ctx.report_progress(...) to stream notifications/progress SSE events over the active request stream:
Standalone MCP App, Skills Catalog, A2A 1.0, Binary Results, and Auth
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/litestar-mcp/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/litestar-org/litestar-skills/litestar-mcp)