Skip to content

Docs/examples: avoid wildcard CORS for StreamableHTTP#2015

Open
TheodorNEngoy wants to merge 1 commit intomodelcontextprotocol:mainfrom
TheodorNEngoy:codex/python-streamablehttp-cors-allowlist
Open

Docs/examples: avoid wildcard CORS for StreamableHTTP#2015
TheodorNEngoy wants to merge 1 commit intomodelcontextprotocol:mainfrom
TheodorNEngoy:codex/python-streamablehttp-cors-allowlist

Conversation

@TheodorNEngoy
Copy link

Updates the StreamableHTTP docs snippet + low-level examples to avoid allow_origins=["*"].

  • Uses allow_origin_regex to allow browser clients from ChatGPT origins (https://chatgpt.com, https://chat.openai.com) and localhost dev (http(s)://localhost|127.0.0.1(:port))
  • Keeps the intent of exposing Mcp-Session-Id for browser-based clients
  • Docs/examples only; no runtime behavior changes to the SDK

This reduces the risk of copy/paste wildcard-CORS configs in MCP servers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant