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
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.
License: CC-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).
Cite this
iinventedlight. 2026. "MCP authorization: OAuth for HTTP transports, environment credentials for stdio." iinventedlight Library, iil:note:17rp2f9p, version of 2026-11-16. https://iinventedlight.com/library/notes/ao-mcp-authorization-oauth/. License: CC-BY-4.0.
@misc{iil_note_17rp2f9p,
author = {{iinventedlight}},
title = {{MCP authorization: OAuth for HTTP transports, environment credentials for stdio}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-16},
url = {https://iinventedlight.com/library/notes/ao-mcp-authorization-oauth/},
note = {Permanent ID iil:note:17rp2f9p. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- ao-mcp-authorization-oauth.schema.json (schema; CC-BY-4.0)
- ao-mcp-authorization-oauth.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/ao-mcp-authorization-oauth.md.