Skip to content

Commit 6baed53

Browse files
committed
revert documentation changes
1 parent 8b52418 commit 6baed53

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

docs/streamable-http.md

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ The Streamable HTTP mode enables the GitHub MCP Server to run as an HTTP service
88
- **OAuth Metadata Endpoints** — Standard `.well-known/oauth-protected-resource` discovery for OAuth clients
99
- **Scope Challenge Support** — Automatic scope validation with proper HTTP 403 responses and `WWW-Authenticate` headers
1010
- **Scope Filtering** — Restrict available tools based on authenticated credentials and permissions
11-
- **CORS & Browser Client Support** — Built-in CORS middleware and configurable cross-origin protection for browser-based MCP clients
1211
- **Custom Base Paths** — Support for reverse proxy deployments with customizable base URLs
1312

1413
## Running the Server
@@ -60,36 +59,6 @@ The OAuth protected resource metadata's `resource` attribute will be populated w
6059

6160
This allows OAuth clients to discover authentication requirements and endpoint information automatically.
6261

63-
## Cross-Origin & Browser Client Support
64-
65-
The HTTP server includes built-in CORS middleware and cross-origin request handling to support browser-based MCP clients (e.g., web apps, MCP Inspector).
66-
67-
### Default Behavior
68-
69-
`RunHTTPServer` enables browser cross-origin support out of the box by wiring in two things:
70-
71-
1. **CORS middleware** (`SetCorsHeaders`) — responds to preflight `OPTIONS` requests and sets `Access-Control-*` headers on all MCP endpoint responses
72-
2. **Cross-origin protection bypass** — bypasses the SDK's `Sec-Fetch-Site` rejection so cross-origin POST requests are allowed
73-
74-
This is safe because the server authenticates exclusively via bearer tokens (`Authorization` header), which are not ambient credentials — a malicious cross-origin page cannot cause the browser to attach them automatically. Standard CSRF protection is therefore not required.
75-
76-
> **Note:** CORS headers on MCP endpoints are provided by `SetCorsHeaders` middleware. OAuth metadata discovery routes (e.g., `/.well-known/oauth-protected-resource`) handle CORS independently.
77-
78-
### Library / Custom Integrations
79-
80-
If you embed the server as a library (using `ServerConfig` directly rather than `RunHTTPServer`), neither the CORS middleware nor the cross-origin bypass is applied automatically. To support browser clients, you must:
81-
82-
1. Add `middleware.SetCorsHeaders` to your router
83-
2. Set the `CrossOriginProtection` field on `ServerConfig` with an appropriate bypass pattern
84-
85-
The `CrossOriginProtection` options are:
86-
87-
- **`nil`**`RunHTTPServer` auto-bypasses (allows all origins); library consumers get the SDK default (reject cross-origin POSTs)
88-
- **Explicit bypass** — Create a `CrossOriginProtection` with `AddInsecureBypassPattern("/")` to allow all cross-origin requests
89-
- **SDK default** — Use `http.NewCrossOriginProtection()` without any bypass patterns to reject cross-origin POSTs
90-
91-
The SDK default is appropriate when browser cross-origin clients are not required (e.g., native CLI clients only, or same-origin browser deployments where the client and server share the same origin).
92-
9362
## Client Configuration
9463

9564
### Using OAuth Authentication

0 commit comments

Comments
 (0)