litestar-mcp

Expose Litestar route handlers as MCP tools, resources, and prompts.

13|Updated Apr 15, 2026
One-click install
npx skills add https://github.com/litestar-org/litestar-skills --skill litestar-mcp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: litestar-mcp
Source: https://github.com/litestar-org/litestar-skills/tree/main/plugins/litestar/skills/litestar-mcp
Command: npx skills add https://github.com/litestar-org/litestar-skills --skill litestar-mcp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Litestar developers face manual, error-prone work when building Model Context Protocol (MCP) integrations for their web applications, requiring custom boilerplate for route exposure, transport handling, and authentication that duplicates existing Litestar functionality.

Core Features & Use Cases

  • Opt-in Route Marking: Expose Litestar route handlers as MCP tools, resources, or prompts with simple decorator arguments, no extra wrapper code required.
  • Multi-Transport Support: Serve MCP primitives over Streamable HTTP, stdio, or SSE transports for compatibility with all major AI coding agents and IDEs.
  • Production-Ready Guardrails: Built-in pagination, OIDC auth support, tool call observability callbacks, and route filtering to secure and scale MCP deployments. Use case example: An e-commerce team can expose product listing as an MCP resource and add-to-cart as a tool, allowing AI shopping assistants to interact with their store while keeping internal metrics routes hidden from MCP clients.

Quick Start

Use the litestar-mcp skill to configure your existing Litestar application to expose selected route handlers as MCP tools and resources for AI client access.

Frequently Asked Questions about litestar-mcp

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I expose Litestar routes as Model Context Protocol tools?

You can expose Litestar routes as Model Context Protocol tools by using opt-in route marking decorators, eliminating the need for custom wrapper boilerplate. This allows AI clients to directly access selected route handlers as MCP tools, resources, or prompts.

What transports are supported for serving MCP integrations in Litestar?

Litestar MCP integrations support serving primitives over Streamable HTTP, stdio, or SSE transports. This multi-transport compatibility ensures your exposed routes can connect with all major AI coding agents and IDEs.

Can I secure my Model Context Protocol server with OIDC authentication in Litestar?

Yes, you can secure your Model Context Protocol server using built-in OIDC authentication support in Litestar. This production-ready guardrail also includes pagination, route filtering, and tool call observability callbacks to protect and scale deployments.

How do I prevent internal metrics routes from being exposed to AI clients?

You can prevent internal metrics routes from being exposed to AI clients by using opt-in route marking. Only route handlers explicitly marked with decorator arguments are exposed as MCP primitives, keeping internal routes hidden from MCP clients.

Does Litestar require manual boilerplate for adding AI agent integration via MCP?

No, Litestar eliminates manual boilerplate for AI agent integration via MCP. The framework handles route exposure, transport handling, and authentication natively, preventing the error-prone custom code usually required to duplicate existing functionality.

What is the best way to integrate an e-commerce API with AI shopping assistants using MCP?

The best way to integrate an e-commerce API with AI shopping assistants is by exposing product listings as MCP resources and add-to-cart actions as tools via Streamable HTTP. This allows AI clients to interact with your store directly while keeping internal routes hidden.