---
title: "Secure auth for MCP servers"
description: "Give AI agents access to your app with OAuth 2.1 flows, tool permissions, PKCE, scopes, and more."
url: https://workos.com/mcp
---

Authorization for AI

# Secure auth for MCP servers

Give AI agents access to your app with OAuth 2.1 flows, tool permissions, PKCE, scopes, and more.

[Explore MCP Docs](https://workos.com/docs/authkit/mcp)

## Add OAuth to your MCP server

WorkOS AuthKit supports OAuth 2.1 as a compatible authorization server for MCP apps, based on the latest MCP protocol specification. This enables fine-grained authorization for agentic applications and workflows.

[See an example MCP](https://mcp.shop/)

[Learn how to add auth to your MCP server in 10 min](https://workos.com/mcp#)

## Get started with MCP

Everything you need to master the basics and ship your first app

[Read the MCP docsWe take the complexity of an evolving and intricate protocol and make securing it with AuthKit as easy as pasting a URL.Read the docs](https://workos.com/docs/authkit/mcp)[Fork MCP examplesGetting started quickly with open source templates. AuthKit MCP supports every language and framework.View code on GitHub](https://github.com/workos/mcp.shop)[Bring your own usersAlready have users and login? WorkOS Connect can run as standalone middleware to only provide MCP OAuth flows — no migration necessary.Get started](https://workos.com/changelog/standalone-oauth-for-mcp)

## Auth for MCP has never been easier

WorkOS AuthKit handles all the complexity of the OAuth Authorization Server. You just build the MCP tools and resource endpoints.

[Read the docs](https://workos.com/docs/authkit/mcp)

[Get your AuthKit domain](https://workos.com/signup)

server.py

```python
from fastmcp import FastMCP
from fastmcp.server.auth.providers.workos import AuthKitProvider

# The AuthKitProvider automatically discovers WorkOS endpoints
# and configures JWT token validation
auth_provider = AuthKitProvider(
    authkit_domain="https://your-project-12345.authkit.app",
    base_url="http://localhost:8000"  # Use your actual server URL
)

mcp = FastMCP(name="AuthKit Secured App", auth=auth_provider)
```

> “WorkOS was the obvious choice for our MCP OAuth. Fast iteration, enterprise features built-in, and it just worked. Shipped Rube to everyone from indie devs to enterprise customers in two weeks.”

Rahul Tarak

Founding Engineer

> “We wanted to ship an MCP server quickly and with WorkOS we were able to integrate in a matter of days to handle everything related to OAuth. This let us focus on building the best MCP server for our customers.”

Matthew McClure

Co-founder & VP of Developer Experience

## Go deeper with MCP Guides

Go beyond the basics with guides for MCP experts

[MCP Architecture DiagramsVisual breakdown of MCP workflows and architecture.](https://docs.anthropic.com/en/docs/mcp)

[Securing AI AgentsBest practices for authenticating, authorizing, and defending AI agents in enterprise environments.](https://workos.com/blog/securing-ai-agents)

[How MCP Servers WorkAn inside look at how MCP servers operate, from components to architecture and execution flow.](https://workos.com/blog/how-mcp-servers-work)

[Integrating WorkOS with Cloudflare MCPDetailed integration guide with real-world examples.](https://workos.com/blog/workos-cloudflare-mcp-auth-for-agentic-ai)

## Watch sessions from MCP Night by WorkOS

[MCP Night KeynoteMichael Grinich introduces enterprise-ready authorization for MCP servers, powered by WorkOS.](https://workos.com/mcp#)

[Panel: OpenAI + AnthropicLeaders from Anthropic and OpenAI discuss collaboration on MCP.](https://workos.com/mcp#)

[Notion MCP: An inside lookMarissa Felix & Kenneth Sinder demo Notion MCP, allowing users to reference Notion documents and databases.](https://workos.com/mcp#)

[Mux + WorkOS MCPMatt McClure demonstrates the new Mux/WorkOS MCP video integration.](https://workos.com/mcp#)

[Cursor MCPEric Zakariasson discusses how users are utilizing MCP within Cursor.](https://workos.com/mcp#)

[xmcp - The TypeScript MCP FrameworkValentina Bearzotti demonstrates how XMCP helps developers build and deploy MCP servers more easily.](https://workos.com/mcp#)

[MCP-UILiad Yosef & Ido Salomon show how MCP-UI enables interactive UI for MCP servers.](https://workos.com/mcp#)

[VS Code MCPHarald Kirschner discusses how VS Code helps solve common problems encountered when working with MCPs.](https://workos.com/mcp#)

[Block MCPRichard Moot demonstrates how Block reduced their entire API platform to just three tools: discovery, planning, and execution.](https://workos.com/mcp#)

## Connect with the MCP Community

Register for local MCP events and contribute to community projects

[WorkOS EventsDiscover upcoming WorkOS events — from flagship MCP Nights to casual dev days and happy hours.Explore upcoming events](https://luma.com/calendar/cal-Z1tslEBMjjCh4fd)[MCP Discord ServerJoin the dev-focused space to connect, share projects, and stay in the loop with fellow MCP builders.Join the Discord](https://discord.com/invite/model-context-protocol-1312302100125843476)

## Ready to get started with MCP?

[Explore docs](https://workos.com/docs/authkit/mcp)[Example project](https://github.com/workos/mcp.shop)
