---
source: https://iinventedlight.com/library/notes/ao-mcp-authorization-oauth.md
title: "MCP authorization: OAuth for HTTP transports, environment credentials for stdio"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (specification; earlier contributions MIT) (Model Context Protocol); Apache-2.0 (google-gemini/gemini-cli (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Model Context Protocol, Authorization (MCP specification 2025-11-25), Apache-2.0 (specification; earlier contributions MIT) (https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/LICENSE); google-gemini/gemini-cli (GitHub), MCP servers with the Gemini CLI, Apache-2.0 (https://raw.githubusercontent.com/google-gemini/gemini-cli/main/LICENSE)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-16
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-16
as_of: 2026-11-16
confidence: medium
untested: "Not reproduced (2026-11-16). MCP 2025-11-25 authorization spec and Gemini CLI docs read; no OAuth flow was run."
category: agent-operations
topic_area: "agent operations: MCP authorization"
tags: [mcp, authorization, oauth, gemini-cli, tokens]
client: Librarian
sources:
  - id: S1
    title: "Authorization (MCP specification 2025-11-25)"
    publisher: Model Context Protocol
    url: https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization
    accessed: 2026-11-16
    license: "Apache-2.0 (specification; earlier contributions MIT)"
  - id: S2
    title: "MCP servers with the Gemini CLI"
    publisher: google-gemini/gemini-cli (GitHub)
    url: https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md
    accessed: 2026-11-16
    license: "Apache-2.0"
---
# MCP authorization: OAuth for HTTP transports, environment credentials for stdio
**Answer:** Authorization is optional for MCP implementations. When supported, HTTP-based transports should conform to the MCP authorization specification. STDIO transports should not follow that specification; instead, they retrieve credentials from the environment.

## Roles and tokens

A protected MCP server acts as an OAuth 2.1 resource server and accepts protected resource requests using access tokens. MCP clients must include the `resource` parameter in authorization and token requests, binding tokens to their intended audiences. Token passthrough is explicitly forbidden. Clients and servers must implement secure token storage.

## Gemini CLI client behavior

For remote MCP servers over SSE or HTTP transports, Gemini CLI supports OAuth 2.0 authentication. With OAuth discovery, it can detect 401 responses and discover OAuth endpoints from server metadata. Use `/mcp auth` to list servers requiring authentication or authenticate with one.

## See also

- [ao-mcp-transports-and-trust](https://iinventedlight.com/library/notes/ao-mcp-transports-and-trust/)
- [ao-mcp](https://iinventedlight.com/library/notes/ao-mcp/)
- [ao-mcp-opencode-config](https://iinventedlight.com/library/notes/ao-mcp-opencode-config/)

## Claims

- id: C1
  claim: MCP authorization is optional.
  source: S1
  evidence: "Authorization is **OPTIONAL** for MCP implementations."

- id: C2
  claim: STDIO implementations should use environment credentials.
  source: S1
  evidence: "instead retrieve credentials from the environment."

- id: C3
  claim: MCP forbids token passthrough.
  source: S1
  evidence: "token passthrough is explicitly forbidden."

- id: C4
  claim: Gemini CLI supports OAuth for remote MCP servers.
  source: S2
  evidence: "Gemini CLI supports OAuth 2.0 authentication for remote MCP servers"

## Sources

- [S1] Authorization (MCP specification 2025-11-25). Model Context Protocol. https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization . License: Apache-2.0 (specification; earlier contributions MIT). Accessed 2026-11-16.

- [S2] MCP servers with the Gemini CLI. google-gemini/gemini-cli (GitHub). https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md . License: Apache-2.0. Accessed 2026-11-16.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Model Context Protocol, Authorization (MCP specification 2025-11-25), Apache-2.0 (specification; earlier contributions MIT) (https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/LICENSE); google-gemini/gemini-cli (GitHub), MCP servers with the Gemini CLI, Apache-2.0 (https://raw.githubusercontent.com/google-gemini/gemini-cli/main/LICENSE). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
