# Leanmcp ## Docs - [Getting Your API Key](https://docs.leanmcp.com/ai-gateway/api-keys.md): Create a LeanMCP API key to use the AI Gateway - [Claude Code](https://docs.leanmcp.com/ai-gateway/claude-code.md): Route Claude Code through LeanMCP AI Gateway for full observability — every prompt, token count, and tool call logged. - [Cline](https://docs.leanmcp.com/ai-gateway/cline.md): Use the LeanMCP AI Gateway with Cline - [Cursor](https://docs.leanmcp.com/ai-gateway/cursor.md): Use the LeanMCP AI Gateway with Cursor IDE - [For Developers](https://docs.leanmcp.com/ai-gateway/for-developers.md): Build AI-powered applications with security, observability, and cost control - [For Personal Users](https://docs.leanmcp.com/ai-gateway/for-personal-users.md): Use AI Gateway to monitor and secure your personal AI coding assistant usage - [Getting Started](https://docs.leanmcp.com/ai-gateway/getting-started.md): Set up AI Gateway in minutes and start tracking your AI usage - [AI Gateway Overview](https://docs.leanmcp.com/ai-gateway/introduction.md): Route all your AI requests through a single proxy for complete visibility and control - [Observability](https://docs.leanmcp.com/ai-gateway/observability.md): Complete visibility into every AI request across your entire codebase - [OpenClaw](https://docs.leanmcp.com/ai-gateway/openclaw.md): Use the LeanMCP AI Gateway with OpenClaw - [OpenCode](https://docs.leanmcp.com/ai-gateway/opencode.md): Use the LeanMCP AI Gateway with OpenCode CLI - [Raycast](https://docs.leanmcp.com/ai-gateway/raycast.md): Use the LeanMCP AI Gateway with Raycast AI via BYOK - [SDK Integration](https://docs.leanmcp.com/ai-gateway/sdk-integration.md): Use the LeanMCP AI Gateway in your applications with official SDKs - [Security](https://docs.leanmcp.com/ai-gateway/security.md): Protect sensitive data and block malicious users from abusing your AI features - [Token Optimization](https://docs.leanmcp.com/ai-gateway/token-optimization.md): Reduce AI costs through A/B testing, usage analysis, and smart optimization - [Windsurf](https://docs.leanmcp.com/ai-gateway/windsurf.md): Use the LeanMCP AI Gateway with Windsurf IDE - [Build MCP Server](https://docs.leanmcp.com/api-reference/build.md): Create a new MCP server from templates and configuration - [Add a new message to a specific chat via API key](https://docs.leanmcp.com/api-reference/chat-messages-api-key/add-a-new-message-to-a-specific-chat-via-api-key.md): Convenient endpoint to add a message to a chat using API key authentication. MessageIndex is auto-calculated. Requires CHAT scope. - [Add multiple messages to a chat via API key](https://docs.leanmcp.com/api-reference/chat-messages-api-key/add-multiple-messages-to-a-chat-via-api-key.md): Bulk insert multiple messages into a chat using API key authentication. MessageIndex values are auto-calculated sequentially. Requires CHAT scope. - [Create a new message in a chat via API key](https://docs.leanmcp.com/api-reference/chat-messages-api-key/create-a-new-message-in-a-chat-via-api-key.md): Create a message with explicit chatId using API key authentication. MessageIndex is auto-calculated if not provided. Requires CHAT scope. - [Delete a message via API key](https://docs.leanmcp.com/api-reference/chat-messages-api-key/delete-a-message-via-api-key.md): Delete a specific message using API key authentication. Requires CHAT scope. - [Get all messages for a chat via API key](https://docs.leanmcp.com/api-reference/chat-messages-api-key/get-all-messages-for-a-chat-via-api-key.md): Returns all messages for a specific chat ordered by messageIndex using API key authentication. Requires CHAT scope. - [Get message by ID via API key](https://docs.leanmcp.com/api-reference/chat-messages-api-key/get-message-by-id-via-api-key.md): Get a specific message by its ID using API key authentication. Requires CHAT scope. - [Get message count for a chat via API key](https://docs.leanmcp.com/api-reference/chat-messages-api-key/get-message-count-for-a-chat-via-api-key.md): Returns the total number of messages in a chat using API key authentication. Requires CHAT scope. - [Get the latest message in a chat via API key](https://docs.leanmcp.com/api-reference/chat-messages-api-key/get-the-latest-message-in-a-chat-via-api-key.md): Returns the message with the highest messageIndex in the chat using API key authentication. Requires CHAT scope. - [Get user's recent messages via API key](https://docs.leanmcp.com/api-reference/chat-messages-api-key/get-users-recent-messages-via-api-key.md): Retrieve recent messages by the user across all their chats using API key authentication. Requires CHAT scope. - [Update message content via API key](https://docs.leanmcp.com/api-reference/chat-messages-api-key/update-message-content-via-api-key.md): Update message content or metadata using API key authentication. Requires CHAT scope. - [Create a new chat via API key](https://docs.leanmcp.com/api-reference/chats-api-key/create-a-new-chat-via-api-key.md): Create a new chat using API key authentication. Requires CHAT scope. - [Delete chat via API key](https://docs.leanmcp.com/api-reference/chats-api-key/delete-chat-via-api-key.md): Delete entire chat and all its messages using API key authentication. Requires CHAT scope. - [Get all user chats via API key](https://docs.leanmcp.com/api-reference/chats-api-key/get-all-user-chats-via-api-key.md): Get all chats for the user associated with the API key. Requires CHAT scope. - [Get chat by ID via API key](https://docs.leanmcp.com/api-reference/chats-api-key/get-chat-by-id-via-api-key.md): Get chat metadata by ID using API key authentication. Requires CHAT scope. - [Get chat history (raw messages only) via API key](https://docs.leanmcp.com/api-reference/chats-api-key/get-chat-history-raw-messages-only-via-api-key.md): Returns just the messages for a chat without full metadata using API key authentication. Requires CHAT scope. - [Get complete chat history (chat + messages) via API key](https://docs.leanmcp.com/api-reference/chats-api-key/get-complete-chat-history-chat-+-messages-via-api-key.md): Returns chat metadata along with all messages in the conversation using API key authentication. Requires CHAT scope. - [Get current API key information](https://docs.leanmcp.com/api-reference/chats-api-key/get-current-api-key-information.md): Returns information about the API key being used for authentication - [Get recent chats via API key](https://docs.leanmcp.com/api-reference/chats-api-key/get-recent-chats-via-api-key.md): Get user's most recent chats up to specified limit using API key authentication. Requires CHAT scope. - [Get user chat statistics via API key](https://docs.leanmcp.com/api-reference/chats-api-key/get-user-chat-statistics-via-api-key.md): Get chat statistics for the user associated with the API key. Requires CHAT scope. - [Update chat metadata via API key](https://docs.leanmcp.com/api-reference/chats-api-key/update-chat-metadata-via-api-key.md): Update chat title, summary, etc. using API key authentication. Requires CHAT scope. - [Deploy MCP Server](https://docs.leanmcp.com/api-reference/deploy.md): Deploy your MCP server to production - [Attach a subdomain to a deployment via API key](https://docs.leanmcp.com/api-reference/deployments-api-key/attach-a-subdomain-to-a-deployment-via-api-key.md): Attach a custom subdomain to a deployment using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Create a new deployment from a build via API key](https://docs.leanmcp.com/api-reference/deployments-api-key/create-a-new-deployment-from-a-build-via-api-key.md): Create a new deployment from a build using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Delete a deployment via API key](https://docs.leanmcp.com/api-reference/deployments-api-key/delete-a-deployment-via-api-key.md): Delete a deployment and stop the associated ECS service using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Get a deployment by ID via API key](https://docs.leanmcp.com/api-reference/deployments-api-key/get-a-deployment-by-id-via-api-key.md): Get deployment details by ID using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Get current API key information](https://docs.leanmcp.com/api-reference/deployments-api-key/get-current-api-key-information.md): Returns information about the API key being used for authentication - [Get deployment for a build via API key](https://docs.leanmcp.com/api-reference/deployments-api-key/get-deployment-for-a-build-via-api-key.md): Get deployment associated with a specific build using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Get deployments for a project via API key](https://docs.leanmcp.com/api-reference/deployments-api-key/get-deployments-for-a-project-via-api-key.md): Get all deployments for a specific project using API key authentication. Requires BUILD_AND_DEPLOY scope. - [LeanMCP API](https://docs.leanmcp.com/api-reference/introduction.md): Build, test, and deploy MCPs using the LeanMCP API - [Delete a Lambda build (API Key)](https://docs.leanmcp.com/api-reference/lambda-builds-sdk/delete-a-lambda-build-api-key.md) - [Get a Lambda build by ID (API Key)](https://docs.leanmcp.com/api-reference/lambda-builds-sdk/get-a-lambda-build-by-id-api-key.md) - [Get all Lambda builds for a project (API Key)](https://docs.leanmcp.com/api-reference/lambda-builds-sdk/get-all-lambda-builds-for-a-project-api-key.md) - [Get Lambda build logs (API Key)](https://docs.leanmcp.com/api-reference/lambda-builds-sdk/get-lambda-build-logs-api-key.md) - [Trigger a Lambda build for a project (API Key)](https://docs.leanmcp.com/api-reference/lambda-builds-sdk/trigger-a-lambda-build-for-a-project-api-key.md) - [Check health of a Lambda deployment (API Key)](https://docs.leanmcp.com/api-reference/lambda-deployments-api/check-health-of-a-lambda-deployment-api-key.md) - [Create a new Lambda deployment from a build (API Key)](https://docs.leanmcp.com/api-reference/lambda-deployments-api/create-a-new-lambda-deployment-from-a-build-api-key.md) - [Delete a Lambda deployment (API Key)](https://docs.leanmcp.com/api-reference/lambda-deployments-api/delete-a-lambda-deployment-api-key.md) - [Get a Lambda deployment by ID (API Key)](https://docs.leanmcp.com/api-reference/lambda-deployments-api/get-a-lambda-deployment-by-id-api-key.md) - [Get all Lambda deployments for the current user (API Key)](https://docs.leanmcp.com/api-reference/lambda-deployments-api/get-all-lambda-deployments-for-the-current-user-api-key.md) - [Get Lambda deployment for a build (API Key)](https://docs.leanmcp.com/api-reference/lambda-deployments-api/get-lambda-deployment-for-a-build-api-key.md) - [Get Lambda deployments for a project (API Key)](https://docs.leanmcp.com/api-reference/lambda-deployments-api/get-lambda-deployments-for-a-project-api-key.md) - [Update Lambda deployment configuration (API Key)](https://docs.leanmcp.com/api-reference/lambda-deployments-api/update-lambda-deployment-configuration-api-key.md) - [Check if a subdomain is available (API Key)](https://docs.leanmcp.com/api-reference/lambda-mapping-api/check-if-a-subdomain-is-available-api-key.md) - [Create a new subdomain mapping (API Key)](https://docs.leanmcp.com/api-reference/lambda-mapping-api/create-a-new-subdomain-mapping-api-key.md) - [Delete a subdomain mapping (API Key)](https://docs.leanmcp.com/api-reference/lambda-mapping-api/delete-a-subdomain-mapping-api-key.md) - [Get all mappings for a project (API Key)](https://docs.leanmcp.com/api-reference/lambda-mapping-api/get-all-mappings-for-a-project-api-key.md) - [Get all mappings for current user (API Key)](https://docs.leanmcp.com/api-reference/lambda-mapping-api/get-all-mappings-for-current-user-api-key.md) - [Get mapping by subdomain (API Key)](https://docs.leanmcp.com/api-reference/lambda-mapping-api/get-mapping-by-subdomain-api-key.md) - [Update a subdomain mapping (API Key)](https://docs.leanmcp.com/api-reference/lambda-mapping-api/update-a-subdomain-mapping-api-key.md) - [Archive project via API key](https://docs.leanmcp.com/api-reference/projects-api-key/archive-project-via-api-key.md): Archive a project using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Create a new project via API key](https://docs.leanmcp.com/api-reference/projects-api-key/create-a-new-project-via-api-key.md): Create a new project using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Delete project via API key](https://docs.leanmcp.com/api-reference/projects-api-key/delete-project-via-api-key.md): Delete project using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Get all projects for user via API key](https://docs.leanmcp.com/api-reference/projects-api-key/get-all-projects-for-user-via-api-key.md): Get all projects for the user associated with the API key. Requires BUILD_AND_DEPLOY scope. - [Get current API key information](https://docs.leanmcp.com/api-reference/projects-api-key/get-current-api-key-information.md): Returns information about the API key being used for authentication - [Get project builds via API key](https://docs.leanmcp.com/api-reference/projects-api-key/get-project-builds-via-api-key.md): Get all builds for a project using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Get project by ID via API key](https://docs.leanmcp.com/api-reference/projects-api-key/get-project-by-id-via-api-key.md): Get project details by ID using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Get upload URL for project files via API key](https://docs.leanmcp.com/api-reference/projects-api-key/get-upload-url-for-project-files-via-api-key.md): Get a pre-signed URL for uploading project files using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Start build for project via API key](https://docs.leanmcp.com/api-reference/projects-api-key/start-build-for-project-via-api-key.md): Start a new build for the project using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Update project S3 location via API key](https://docs.leanmcp.com/api-reference/projects-api-key/update-project-s3-location-via-api-key.md): Update project S3 location after successful upload using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Update project via API key](https://docs.leanmcp.com/api-reference/projects-api-key/update-project-via-api-key.md): Update project details using API key authentication. Requires BUILD_AND_DEPLOY scope. - [Test MCP Server](https://docs.leanmcp.com/api-reference/test.md): Test your MCP server with AI agents - [MCP Best Practices](https://docs.leanmcp.com/building/best-practices.md): The art of building MCPs that AI agents love to use - [Introduction](https://docs.leanmcp.com/building/introduction.md): Build production-ready MCP servers with LeanMCP - [Testing & Debugging](https://docs.leanmcp.com/building/testing.md): How to test and debug your MCP servers effectively - [Changelog](https://docs.leanmcp.com/changelog.md): Product updates and announcements for Leanmcp - [Authentication](https://docs.leanmcp.com/cli/authentication.md): Set up API key authentication for the CLI - [Deployment](https://docs.leanmcp.com/cli/deployment.md): Deploy MCP servers to LeanMCP cloud - [Environment Variables](https://docs.leanmcp.com/cli/env-vars.md): Manage Lambda environment variables with the CLI - [Feedback](https://docs.leanmcp.com/cli/feedback.md): Send feedback and bug reports directly from the CLI - [Installation](https://docs.leanmcp.com/cli/installation.md): Install the LeanMCP CLI tool - [Project Management](https://docs.leanmcp.com/cli/projects.md): Manage MCP projects with the CLI - [Prompts](https://docs.leanmcp.com/core-concepts/prompts.md): Template prompts for AI agents - [Resources](https://docs.leanmcp.com/core-concepts/resources.md): Expose data to AI agents - [Tools](https://docs.leanmcp.com/core-concepts/tools.md): Create actions AI agents can perform - [Debugging MCP Servers](https://docs.leanmcp.com/debugging.md): Learn how to test and debug your MCP servers effectively - [Deploy on AWS, GCP, and Azure](https://docs.leanmcp.com/deploy/cloud-providers.md): Deploy MCPs on major cloud providers - [Deployment Overview](https://docs.leanmcp.com/deploy/introduction.md): Deploy your MCP servers to production - [Deploy on LeanMCP Platform](https://docs.leanmcp.com/deploy/leanmcp-platform.md): The easiest way to build, deploy, and monitor MCPs - [Deploy on Vercel](https://docs.leanmcp.com/deploy/vercel.md): Deploy simple MCPs on Vercel with important caveats - [Advanced Examples](https://docs.leanmcp.com/examples/advanced.md): Authentication and Elicitation examples - [Basic Examples](https://docs.leanmcp.com/examples/basic.md): Core MCP examples - Tools, Resources, and Prompts - [AI Gateway](https://docs.leanmcp.com/guides/ai-gateway.md): Unified API proxy for LLM providers with authentication and observability - [Converting APIs to MCPs](https://docs.leanmcp.com/guides/api-to-mcp.md): How to efficiently convert your existing APIs into MCP servers - [Adding Auth and Payment](https://docs.leanmcp.com/guides/auth-and-payment.md): Implementing authentication and payment in your MCP servers - [LeanMCP vs MCP SDK](https://docs.leanmcp.com/guides/leanmcp-vs-mcp-sdk.md): How LeanMCP SDK differs from the official MCP SDK - [LeanMCP vs Workato & Others](https://docs.leanmcp.com/guides/leanmcp-vs-others.md): How LeanMCP compares to Workato and other integration platforms - [MCP vs Claude Skills & Code Mode](https://docs.leanmcp.com/guides/mcp-vs-claude-skills.md): Understanding when to use Model Context Protocol vs Claude's built-in code execution - [Using Prompts and Resources Efficiently](https://docs.leanmcp.com/guides/prompts-and-resources.md): Best practices for leveraging prompts and resources in MCP servers - [Reducing Tokens in MCPs](https://docs.leanmcp.com/guides/reducing-tokens.md): Best practices for minimizing token usage in your MCP servers - [Mitigating React Server Component CVE](https://docs.leanmcp.com/guides/security-rsc-cve.md): Security deep dive - protecting MCP apps from React Server Component vulnerabilities - [Where to Use MCPs](https://docs.leanmcp.com/guides/where-to-use-mcps.md): Understanding when and where to use MCP servers effectively - [Introduction](https://docs.leanmcp.com/index.md): LeanMCP - The fastest way to build and deploy MCP Servers - [Documentation Plan](https://docs.leanmcp.com/plan.md): LeanMCP Documentation Structure and Goals - [Quick Start](https://docs.leanmcp.com/quickstart.md): Build your first MCP server in 5 minutes - [Roadmap](https://docs.leanmcp.com/roadmap.md): What we are building next for LeanMCP - [@leanmcp/auth](https://docs.leanmcp.com/sdk/auth.md): Token-based authentication decorators and multi-provider support for MCP tools - [OAuth Client](https://docs.leanmcp.com/sdk/auth-oauth-client.md): Browser-based OAuth 2.1 client with PKCE, token storage, and automatic refresh - [OAuth Server & Proxy](https://docs.leanmcp.com/sdk/auth-oauth-server.md): Build MCP-compliant OAuth authorization servers with external provider proxy support - [@leanmcp/cli](https://docs.leanmcp.com/sdk/cli.md): Command-line tool for creating, developing, and deploying LeanMCP projects - [@leanmcp/core](https://docs.leanmcp.com/sdk/core.md): Core library for building MCP servers with TypeScript decorators - [@leanmcp/elicitation](https://docs.leanmcp.com/sdk/elicitation.md): Structured user input collection using MCP elicitation protocol - [@leanmcp/env-injection](https://docs.leanmcp.com/sdk/env-injection.md): Request-scoped user secrets injection for MCP tools - [Examples](https://docs.leanmcp.com/sdk/examples.md): Complete examples of LeanMCP SDK usage - [LeanMCP SDK](https://docs.leanmcp.com/sdk/introduction.md): Build production-ready MCP servers with TypeScript decorators - [@leanmcp/ui](https://docs.leanmcp.com/sdk/ui.md): MCP-native React components and hooks for building MCP Apps - [UI Components](https://docs.leanmcp.com/sdk/ui-components.md): MCP-native React components for building MCP Apps - [Decorators & GPT Apps](https://docs.leanmcp.com/sdk/ui-gpt-apps.md): Server-side decorators and ChatGPT-specific integration - [UI Hooks](https://docs.leanmcp.com/sdk/ui-hooks.md): React hooks for MCP tool calls, resources, and host communication - [@leanmcp/utils](https://docs.leanmcp.com/sdk/utils.md): Utility functions and helpers for LeanMCP SDK ## OpenAPI Specs - [leanmcp-sdk-openapi](https://docs.leanmcp.com/leanmcp-sdk-openapi.yaml) ## Optional - [Documentation](https://docs.leanmcp.com) - [Community](https://discord.com/invite/DsRcA3GwPy) - [GitHub](https://github.com/leanmcp)