Commit graph

1,064 commits

Author SHA1 Message Date
Jerome
bda811a950
feat: Add CORS configuration for browser-based MCP clients
- Add cors middleware to example servers with Mcp-Session-Id exposed
- Add CORS documentation section to README
- Configure minimal CORS settings (only expose required headers)

This enables browser-based clients to connect to MCP servers by properly
exposing the Mcp-Session-Id header required for session management.

Reported-by: Jerome
2025-07-04 16:06:20 +01:00
bhosmer-ant
1ac2e5926c
Merge pull request #730 from modelcontextprotocol/basil/bump_version 1.15.0
bump version to 1.15.0
2025-07-03 18:19:22 -04:00
Basil Hosmer
979700a7b7
npm install 2025-07-03 18:13:48 -04:00
Basil Hosmer
42d4abf383
bump version to 1.15 2025-07-03 18:06:29 -04:00
bhosmer-ant
9879d7a98e
Merge pull request #725 from sushichan044/revert-670-feat/structured-content-with-type-safety
Revert "fix: add type safety for tool output schemas in ToolCallback"
2025-07-03 17:03:31 -04:00
Inna Harper
0b0ea5b1a1
Merge pull request #721 from cliffhall/allow-custom-fetch
Allow custom fetch
2025-07-03 17:17:35 +01:00
Inna Harper
bf4c5be38e
Merge pull request #728 from modelcontextprotocol/ihrpr/1.14.0 1.14.0
1.14.0
2025-07-03 16:39:10 +01:00
ihrpr
fc197e01f8
1.14.0 2025-07-03 16:09:00 +01:00
Inna Harper
d94386cd70
Merge pull request #727 from modelcontextprotocol/ihrpr/decline-reject
Rename reject to decline
2025-07-03 16:04:25 +01:00
ihrpr
d868c4a147
build 2025-07-03 16:01:14 +01:00
ihrpr
25048b9eaf
rename reject to decline 2025-07-03 15:51:16 +01:00
Kentaro Suzuki
a45e4febd9
Revert "fix: add type safety for tool output schemas in ToolCallback" 2025-07-03 22:13:24 +09:00
Cliff Hall
9766edc5ee
Merge pull request #1 from cliffhall/codex/add-custom-fetch-to-streamablehttp.ts-and-sse.ts
Add custom fetch support to transports
2025-07-01 14:09:40 -04:00
cliffhall
f383a9cb8c * In sse.test.ts
- More specific expectations in test "uses custom fetch implementation from options"

* In sse.ts
  - Import FetchLike from transport.ts

* In steramableHttp.ts
  - Import FetchLike from transport.ts
  - Export StartSSEOptions interface for testing

* In streamableHttp.test.ts
  - import StartSSEOptions from streamableHttp.ts
  - use StartSSEOptions instead of any in test "uses custom fetch implementation"

* In transport.ts
  - Add FetchLike function type
2025-07-01 14:00:56 -04:00
Cliff Hall
242c8248f7
Update src/client/streamableHttp.ts
nullish coalescing operator ?? instead of the logical OR operator || to handle the case where this?._eventSourceInit?.fetch or this._fetch might be null or undefined but not falsy

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-01 13:34:04 -04:00
Cliff Hall
7d8c061028
Update src/client/streamableHttp.ts
nullish coalescing operator ?? instead of the logical OR operator || to handle the case where this?._eventSourceInit?.fetch or this._fetch might be null or undefined but not falsy

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-01 13:33:56 -04:00
Cliff Hall
8e02df150e
Update src/client/sse.ts
nullish coalescing operator ?? instead of the logical OR operator || to handle the case where this?._eventSourceInit?.fetch or this._fetch might be null or undefined but not falsy

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-01 13:33:48 -04:00
Cliff Hall
a3c4e28138
Update src/client/streamableHttp.ts
nullish coalescing operator ?? instead of the logical OR operator || to handle the case where this?._eventSourceInit?.fetch or this._fetch might be null or undefined but not falsy

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-01 13:33:39 -04:00
Cliff Hall
3300a43742
Update src/client/sse.ts
nullish coalescing operator ?? instead of the logical OR operator || to handle the case where this?._eventSourceInit?.fetch or this._fetch might be null or undefined but not falsy

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-01 13:33:31 -04:00
Cliff Hall
e5167cbe20 Update streamableHttp custom fetch test 2025-07-01 13:20:28 -04:00
Inna Harper
1b14bd7fa4
Merge pull request #719 from modelcontextprotocol/ihrpr/1.13.3 1.13.3
Bump version to 1.13.3
2025-07-01 16:46:01 +01:00
ihrpr
cfec7d9b39
1.13.3 2025-07-01 16:43:50 +01:00
Glen Maddern
6f5e53b44b
Returning undefined from discoverOAuthMetadata for CORS errors (#717)
* Returning undefined from `discoverOAuthMetadata` for CORS errors

This behaviour was already happening for the root URL, but the new `fetchWithCorsRetry` logic differed.

The issue was if the server returns a 404 for `/.well-known/oauth-authorization-server/xyz` that didn't have the `access-control-allow-origin`, a TypeError was being thrown. There was logic there already to handle a TypeError for a _preflight_ request (cause by custom headers), but not the fallback. I refactored so all combinations return `undefined`.

* Add test for CORS error handling that should return undefined

This test covers the scenario where both the initial request with headers
and the retry without headers fail with CORS TypeErrors. The desired
behavior is to return undefined instead of throwing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix test comment

---------

Co-authored-by: Glen Maddern <glen@glenmaddern.com>
Co-authored-by: Paul Carleton <paulc@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Paul Carleton <paulcarletonjr@gmail.com>
2025-07-01 16:24:27 +01:00
Inna Harper
fb4d07f0ee
Merge pull request #698 from RishiNandha/main
Added Sampling Example to README
2025-06-30 16:31:42 +01:00
ihrpr
a8fa0b342a
build 2025-06-30 16:25:26 +01:00
ihrpr
3d6acd3d9a
add an example and update readme 2025-06-30 16:23:19 +01:00
Inna Harper
5e20ee1fc5
Merge pull request #371 from formulahendry/junhan/http-doc
docs: add error handling when it fails to start HTTP server
2025-06-30 15:28:21 +01:00
ihrpr
a02704cd32
Merge branch 'main' into junhan/http-doc 2025-06-30 15:25:06 +01:00
Inna Harper
0a1cfd949f
Merge pull request #463 from marcopeg/main
doc minimum node version requirment
2025-06-30 15:15:35 +01:00
Inna Harper
27a412cc65
Merge branch 'main' into main 2025-06-30 15:13:54 +01:00
bhosmer-ant
95339723f0
Merge pull request #670 from sushichan044/feat/structured-content-with-type-safety
fix: add type safety for tool output schemas in ToolCallback
2025-06-30 10:10:38 -04:00
bhosmer-ant
a40b353fb6
Merge branch 'main' into feat/structured-content-with-type-safety 2025-06-30 10:08:09 -04:00
Inna Harper
a1a486de1c
Merge pull request #455 from XiaofuHuang/xiaofhua/pid-StdioClientTransport
fix: Expose the MCP child process PID as an accessible property in StdioClientTransport
2025-06-30 14:46:21 +01:00
ihrpr
0db4407d43
Merge branch 'main' into xiaofhua/pid-StdioClientTransport 2025-06-30 14:44:36 +01:00
Inna Harper
7682c4cf4f
Merge pull request #598 from sinedied/fix-empty-schema
fix: missing "properties" property in empty schema
2025-06-30 13:20:42 +01:00
sushichan044
fb303d748f
tidying up 2025-06-28 14:56:02 +09:00
Inna Harper
64a60c4ecd
Merge pull request #571 from garciasdos/main
fix: extra headers when they are a Headers object
2025-06-27 17:29:06 +01:00
Inna Harper
99c75281bd
Merge pull request #661 from kentcdodds/resource-types
add overloads for registerResource method in McpServer class
2025-06-27 17:05:01 +01:00
Felix Weinberger
191c2cbb0e
Merge pull request #386 from muzea/hotfix/windows-default-env
fix: add windows env PROGRAMFILES, avoid some exe can not be found
2025-06-27 15:54:19 +01:00
Felix Weinberger
d54ebee8fe
Merge branch 'main' into hotfix/windows-default-env 2025-06-27 15:50:27 +01:00
Inna Harper
773b842127
Merge pull request #424 from domnit/eventsource-parser-dep
fix: add missing eventsource-parser dependency
2025-06-27 15:28:28 +01:00
ihrpr
c17d851bb8
Merge branch 'main' into eventsource-parser-dep 2025-06-27 15:26:57 +01:00
Inna Harper
0c9b9fbec3
Merge pull request #704 from modelcontextprotocol/ihrpr/fix-lint
fix lint
2025-06-27 14:17:15 +01:00
ihrpr
53ad0a01d5
fix lint 2025-06-27 14:14:21 +01:00
Inna Harper
26a98de872
Merge pull request #565 from ddworken/main
Implement DNS Rebinding Protections per spec
2025-06-27 14:13:11 +01:00
David Dworken
8bc7374f5e
Fix merge conflict 2025-06-26 16:12:26 -07:00
David Dworken
185fb23f34
Merge branch 'main' into main 2025-06-26 16:10:00 -07:00
Inna Harper
1e52f38f36
Merge pull request #701 from modelcontextprotocol/ihrpr/1.13.2 1.13.2
Update version of the package to 1.13.2
2025-06-26 18:54:47 +01:00
ihrpr
9d678ce591
1.13.2 2025-06-26 18:52:24 +01:00
Inna Harper
be845dd4ea
Merge pull request #391 from christian-bromann/cb/sse-tests
test(server): add more tests for `SSEServerTransport` class
2025-06-26 18:28:53 +01:00