Library
AI & agents/15 minutes read

MCP authorization: how to document access and auth for your MCP server

Published December 1, 2026
HC

Harkirat Chahal

Growth

Share this article


MCP authorization: how to document access and auth for your MCP server
SUMMARY

Authentication verifies who is connecting to an MCP server; authorization decides what that identity can do. This guide explains how MCP authorization works and what your docs should cover, from connection requirements, per-client sign-in, CI credentials and scopes to tool side effects, admin controls, errors and revocation, plus how to make auth docs readable for agents.

Model Context Protocol (MCP) is an open standard that lets AI applications like Claude Code and Cursor connect to external tools and data. These applications use MCP clients to communicate with MCP servers, allowing AI agents to retrieve information and perform actions on a user's behalf.

For example, a developer might connect Claude Code to a project management MCP server to search issues and update project tasks. The agent successfully retrieves an issue, but when it tries to update that issue, the request fails because the developer's account lacks editing permission.

This illustrates why authorization matters. Authentication verifies who is requesting access, while authorization determines what that identity is allowed to do. Even when an MCP client has successfully connected to a server, the underlying application may enforce additional permissions. Clear docs help developers configure connections, understand access requirements, and troubleshoot authorization failures.

This guide explains how MCP authorization works, what your documentation should include, and how to make those instructions useful to developers and AI agents.

Key points on MCP authorization

  • MCP authentication verifies the identity of a user or application accessing a server. Authorization determines which resources and operations that identity can access.
  • MCP authorization docs should cover connection requirements, supported MCP clients, authentication methods, scopes and permissions, tool side effects, organization controls, and errors and revocation.
  • AI agents benefit from readable documentation that explains setup requirements, permissions, and recovery steps.

How MCP authorization works

When a developer connects an AI application to an MCP server, several components are involved:

  • The AI application: The AI tool that runs the agent and hosts the MCP client
  • The MCP client: The component within the AI application that communicates with the MCP server and manages the authorization flow
  • The authorization server: The service that authenticates users or applications and issues access tokens
  • The MCP server: The service that exposes tools or data, validates access tokens, and enforces access restrictions

For servers accessed over HTTP, MCP defines an OAuth-based authorization flow. Instead of sharing a password with the MCP client, the developer signs in through an authorization server and grants access when prompted. The MCP client obtains an access token and sends it with requests to the MCP server.

Here's how a typical connection works:

  1. A developer adds an MCP server URL to Claude Code, Cursor, or another supported AI application.
  2. The MCP client sends a request to the server and receives a 401 Unauthorized response when authorization is required.
  3. The MCP client uses the server's OAuth Protected Resource Metadata to locate the authorization server and discover its authorization endpoints.
  4. The MCP client identifies itself using a supported client registration method and directs the developer to the authorization server to sign in and approve access when required.
  5. The MCP client obtains an access token from the authorization server and includes it in subsequent requests.
  6. The MCP server validates the token and checks whether the requested operation is permitted.

Authentication establishes whose identity or credentials are associated with the request. Authorization determines what that identity is allowed to do.

In the project management example, a developer can authenticate successfully while still lacking permission to update an issue. An access token doesn't override the user's existing permissions.

Not every MCP server requires OAuth. Public servers may allow access without authentication, while local servers using stdio typically receive credentials through environment variables or local configuration rather than the HTTP-based OAuth flow.

What should your MCP auth docs include?

Your MCP authorization guide should cover seven areas:

  • Connection requirements: Server URLs, supported transports, account prerequisites, and sign-in requirements
  • Supported MCP clients: Setup instructions for Claude Code, Cursor, and other tested applications
  • Authentication methods: Interactive sign-in and supported methods for automated workflows
  • Scopes and permissions: Required OAuth scopes, tool access, and account-level restrictions
  • Tool side effects: What each tool changes and when those changes take effect
  • Organization controls: Administrator approvals, roles, and access settings
  • Errors and revocation: Common failures, troubleshooting steps, and instructions for disconnecting clients, revoking grants, and rotating credentials

Keep these details in one guide or link to supporting reference pages from a central authorization guide. This gives developers and AI agents a starting point when a connection fails, rather than forcing them to search separate setup, security, and troubleshooting pages to identify the problem.

How to document MCP authorization for developers

Developers need to understand more than how to sign in. They also need to know which tools are available from your MCP server, what permissions those tools require, and how to resolve access errors.

Mintlify's MCP documentation provides useful examples. Its docs MCP server retrieves published documentation, while the Mintlify MCP server allows authorized users to edit content and manage projects.

1. Explain who can connect and how

Before configuring an MCP client, developers need to know which endpoint to use, whether authentication is required, and what their account must have access to.

Start with the server URL, supported transport, account prerequisites, and available capabilities. Separate read-only tools from tools that modify data so developers don't request broader access than their workflows require.

Mintlify demonstrates this separation with its two MCP servers.

For documentation search, a Mintlify site's /mcp endpoint exposes public content without sign-in. On sites with authentication, /authed/mcp allows authenticated users to retrieve content according to their access groups.

The Mintlify MCP uses a separate endpoint, https://mcp.mintlify.com, and requires a Mintlify account with access to the relevant project.

By separating these capabilities, developers can choose the correct connection before attempting authentication. Someone who only needs to search API documentation doesn't need a Mintlify MCP connection with editing capabilities.

Also read: MCP server documentation: how to document for devs and agents

2. Walk through sign-in for each MCP client

Provide instructions for every AI application you've tested. For each one, explain where to configure the server URL, how to sign in, and how to confirm the connection works.

MCP clients differ in how developers configure connections and complete authentication. Someone using Cursor will follow different setup steps from someone using Claude Code, even when both connect to the same MCP server.

For example, developers can add the Mintlify MCP server to Claude Code using:

claude mcp add --transport http mintlify https://mcp.mintlify.com

On first use, Claude Code opens a browser window for OAuth sign-in.

Cursor users can install the Mintlify plugin or add the Mintlify MCP URL through the application's MCP settings. Codex users can configure the connection through its CLI or ~/.codex/config.toml.

End each guide with a verification step, such as listing accessible projects or running a read-only tool. This helps developers confirm authentication and basic access before attempting an operation that modifies data.

3. Document access for CI pipelines and server-side workflows

Document where administrators create client credentials for automated workflows, how the integration obtains access tokens, where secrets should be stored, how to rotate or revoke credentials, and which resources the integration can access.

Browser-based OAuth works when a developer is available to approve access. Automated workflows, such as continuous integration (CI) pipelines and scheduled jobs, need a way to authenticate without human interaction.

For example, a CI pipeline that checks documentation for outdated API references might retrieve pages through an MCP server. That pipeline needs credentials it can use without opening a browser.

Some MCP servers support the OAuth client credentials flow for this purpose. Instead of signing in as a user, the application authenticates using its own client ID and secret.

Mintlify's authenticated docs MCP supports this workflow. Administrators can:

  1. Open the project's Docs MCP settings
  2. Generate a client ID and secret, assigning access groups if the integration needs group-restricted documentation
  3. Exchange those credentials for an access token at the site's /authed/mcp/oauth/token endpoint
  4. Use that token to authenticate requests to /authed/mcp

Documenting the credential lifecycle helps teams set up reliable automation without sharing personal login credentials or granting access beyond what the integration needs.

4. List scopes and what each tool needs

Signing in to an MCP server doesn't automatically grant permission to use every tool. Developers need to know which operations their connection supports and whether additional authorization is required.

OAuth scopes specify the permissions associated with an access token. A scope reference tells developers which permissions to request before calling a tool.

For example, a project management MCP server might publish the following table:

ScopePermissionExample tool
projects:readRead project informationlist_projects
issues:readView issuesget_issue
issues:writeCreate or update issuescreate_issue

Alongside the scope table, document which scopes are requested during initial sign-in, where developers can approve additional access, and whether they must reconnect after their permissions change.

OAuth scopes are only one layer of authorization. Account roles and application-level permissions also determine which operations are available.

For example, the Mintlify MCP inherits the authenticated user's dashboard permissions and can be restricted to specific projects. A developer might successfully connect and list projects but be unable to edit a project their account cannot access.

Your documentation should distinguish these restrictions so developers know whether to request additional OAuth authorization or ask an administrator to update their application permissions.

5. Explain what each tool changes

Developers need to know what an MCP tool changes and when those changes take effect. Without that information, an agent might modify content the developer expected only to inspect.

For example, if a developer asks Claude Code to update an outdated API authentication guide, they need to know whether the edit will appear on the live documentation site, remain unpublished, or require a pull request.

Your docs should answer that explicitly. Document the behavior of tools that create, update, delete, or publish resources, and explain which changes require confirmation or review.

In the Mintlify MCP, the answer depends on the branch. Content edits to the deploy branch remain unpublished until someone calls publish. Edits to other branches can go through a pull request workflow, while certain project management changes take effect immediately.

Pair these details with a read-only way to check access before making changes. Mintlify's list_deployments tool, for example, helps developers identify the projects their Mintlify MCP connection can access.

6. Cover administrator and organization controls

An MCP client can authenticate successfully while an organization setting still prevents an operation.

Document which restrictions administrators control, where to configure them, and how developers request changes. Otherwise, developers may repeatedly reconnect or request new tokens when the problem is an organization policy.

Mintlify documents several relevant controls:

  • OAuth redirect domains: Administrators can configure allowed redirect domains in MCP settings when an AI application uses a callback domain that isn't already permitted.
  • Publishing settings: Project settings and branch protection determine which content changes can be published directly and which require review.
  • Role permissions: Certain operations, including changes to protected project settings, require the appropriate Mintlify dashboard role.

For each restriction, identify the administrator responsible and the steps developers should take to request access. This helps teams resolve permission problems without weakening existing controls.

7. Document authorization errors and revocation

Developers need to know whether an error comes from authentication, missing permissions, or another restriction, because each cause has a different fix: re-authenticate, request a scope, or ask an administrator.

For example, 401 Unauthorized means the MCP server needs a valid token. A 403 Forbidden response means the request isn't permitted, even though the MCP client has authenticated.

The table below lists four common errors, which component returns each, what it means, and what to do next.

ErrorReturned byMeaningNext step
401 UnauthorizedMCP serverMissing, invalid, or expired tokenAuthenticate or obtain a new token
403 ForbiddenMCP serverMissing scope or insufficient account permissionsCheck scopes and user access
429 Too Many RequestsMCP serverRate limit exceededFollow retry guidance
invalid_scopeAuthorization serverInvalid or unsupported requested scopeCheck documented scopes

Include server-specific limits, because a 429 means the MCP client is sending requests faster than the server allows, and retrying immediately keeps failing. Developers need the limit and its window to pace their agents.

Your docs should also explain how to end access. Removing an MCP server from an AI application doesn't invalidate the access already granted, so document how to revoke it.

Mintlify users can revoke Mintlify MCP authorization through dashboard MCP settings, which stops access within 30 seconds. Developers using Claude Code can separately remove the local Claude Code connection using claude mcp remove <name>.

Revoking authorization prevents future access, but it doesn't undo completed actions, such as pull requests already opened by an agent.

How to make your auth readable for agents

Your docs should support agents in two ways: the MCP client authenticates on the agent's behalf when it calls your server's tools, and the agent reads your written docs to help a developer set up, check permissions, and fix errors.

Publish authorization metadata clients can discover

Publish OAuth Protected Resource Metadata for your HTTP-based MCP server. Specify where clients can find the metadata, which scopes are required, and how clients should register.

Keep your documentation consistent with the server's published metadata and authorization configuration. This helps developers understand the access requirements and allows compatible MCP clients to discover the authorization server and initiate the OAuth flow.

For example, an MCP server could expose metadata at:

https://mcp.example.com/.well-known/oauth-protected-resource

The metadata identifies the authorization server responsible for issuing access tokens.

When authentication is required, the MCP server returns a 401 Unauthorized response. Its WWW-Authenticate header can identify the metadata URL, which MCP clients can also discover through well-known endpoints.

Return authorization errors that identify missing scopes

Configure your MCP server to return permission errors that explain which additional authorization is required.

Document how AI agents can ask developers to approve additional scopes and how to recognize failures caused by account-level restrictions instead. This helps them choose the correct recovery action and avoid unnecessary reauthorization attempts.

If an agent can retrieve an issue but cannot update it because its token lacks the necessary OAuth scope, the MCP client needs that information to request additional access.

The MCP authorization specification recommends returning 403 Forbidden with a WWW-Authenticate challenge when a token lacks required scopes.

For example:

HTTP/1.1 403 Forbidden
WWW-Authenticate: Bearer error="insufficient_scope",
 scope="issues:write",
 resource_metadata="https://mcp.example.com/.well-known/oauth-protected-resource"

The response identifies issues:write as a required scope. A compatible MCP client can use this information to request additional authorization rather than repeatedly submitting the same failing request.

Make authorization documentation available as Markdown

Publish Markdown versions of your authorization guides and link to them from an llms.txt index. These formats help agents find and process setup instructions without relying on rendered web pages.

Keep commands, endpoint URLs, required values, and expected results in the text itself. Instructions that exist only in screenshots or interactive elements may be unavailable to agents consuming Markdown.

OAuth metadata tells MCP clients where to authenticate, but it doesn't explain how to configure AI agents, create CI credentials, or troubleshoot an account permission error.

An llms.txt index could point agents to the relevant documentation:

# MCP documentation

## Connect

- [Client setup](https://docs.example.com/mcp/connect)
- [Authorization](https://docs.example.com/mcp/auth)

## Reference

- [Scopes](https://docs.example.com/mcp/scopes)
- [Troubleshooting](https://docs.example.com/mcp/errors)

Markdown improves access to instructions; it doesn't grant permission to restricted resources. Private documentation must retain its access controls regardless of format.

Document your MCP server's auth with Mintlify

Once you've documented your MCP server's connection requirements, authentication methods, and permissions, the next step is to present that information in a format developers and AI agents can use.

Mintlify provides components for organizing client-specific setup and making your MCP documentation available to AI tools.

The tabs component lets you present separate instructions for Claude Code, Cursor, and other supported AI applications on one page. Developers can follow the steps for their chosen application without navigating unrelated instructions.

The steps component organizes configuration, sign-in, and verification into a sequence.

The visibility component lets you present different versions of a page for humans and agents. For example, developers can see dashboard instructions in the rendered page, while agents retrieving Markdown receive configuration commands and endpoint details.

Mintlify also generates agent-readable resources:

  • Markdown pages: Text versions of documentation pages that agents can retrieve
  • llms.txt: An automatically maintained index that helps agents locate relevant documentation
  • skill.md: A capability guide generated for public documentation sites that helps compatible agents understand how to use a product

For protected documentation, Mintlify's authenticated docs MCP at /authed/mcp restricts results according to the connecting user's permissions.

Start for free to create MCP authorization documentation that developers can follow, and AI agents can retrieve.

Frequently Asked Questions

What is MCP authorization?

MCP authorization determines which resources and operations a user or application can access through an MCP server. For HTTP-based OAuth connections, MCP clients obtain access tokens from an authorization server and send them with requests. The MCP server validates the tokens and enforces applicable permissions.

Does every MCP server need authorization?

No. MCP authorization is optional. Public MCP servers may permit requests without authentication or access grants. MCP servers that expose private information or restricted operations need appropriate access controls.

How do you authenticate a local MCP server?

Local MCP servers using stdio typically obtain credentials through environment variables or local configuration rather than the HTTP-based OAuth authorization flow. Developers should follow the server's documented credential and configuration requirements.

How does Mintlify keep gated docs private when agents connect through MCP?

Mintlify's authenticated docs MCP restricts results according to the connecting user's access groups. Automated integrations can use MCP client credentials, with access restrictions configured for the integration. See how agents and MCP respect docs authentication in Mintlify.

How does Mintlify make documentation readable for agents?

Mintlify generates Markdown versions of documentation pages, an llms.txt index, and skill.md resources for public sites. These formats help AI agents discover documentation, retrieve instructions, and understand product capabilities.

More to read