Skip to content

Commit f123dae

Browse files
committed
Merge branch 'main' of https://github.com/modelcontextprotocol/typescript-sdk into LucaButBoring-feat/elicitation-sampling-streaming
# Conflicts: # examples/client/src/simpleStreamableHttp.ts
2 parents 9943196 + b0ef89f commit f123dae

File tree

201 files changed

+14031
-13025
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+14031
-13025
lines changed

.changeset/brave-lions-glow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@modelcontextprotocol/node': patch
3+
---
4+
5+
Prevent Hono from overriding global Response object by passing `overrideGlobalObjects: false` to `getRequestListener()`. This fixes compatibility with frameworks like Next.js whose response classes extend the native Response.

.changeset/busy-weeks-hang.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@modelcontextprotocol/core': patch
3+
'@modelcontextprotocol/server': patch
4+
---
5+
6+
Fix ReDoS vulnerability in UriTemplate regex patterns (CVE-2026-0621)

.changeset/cyan-cycles-pump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@modelcontextprotocol/server': patch
3+
---
4+
5+
missing change for fix(client): replace body.cancel() with text() to prevent hanging

.changeset/funky-baths-attack.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@modelcontextprotocol/node': patch
3+
'@modelcontextprotocol/test-integration': patch
4+
'@modelcontextprotocol/server': patch
5+
'@modelcontextprotocol/core': patch
6+
---
7+
8+
remove deprecated .tool, .prompt, .resource method signatures

.changeset/heavy-walls-swim.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@modelcontextprotocol/server': patch
3+
---
4+
5+
reverting application/json in notifications

.changeset/oauth-error-http200.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@modelcontextprotocol/client': patch
3+
---
4+
5+
Fix OAuth error handling for servers returning errors with HTTP 200 status
6+
7+
Some OAuth servers (e.g., GitHub) return error responses with HTTP 200 status instead of 4xx. The SDK now checks for an `error` field in the JSON response before attempting to parse it as tokens, providing users with meaningful error messages.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@modelcontextprotocol/client': patch
3+
---
4+
5+
Respect capability negotiation in list methods by returning empty lists when server lacks capability
6+
7+
The Client now returns empty lists instead of sending requests to servers that don't advertise the corresponding capability:
8+
9+
- `listPrompts()` returns `{ prompts: [] }` if server lacks prompts capability
10+
- `listResources()` returns `{ resources: [] }` if server lacks resources capability
11+
- `listResourceTemplates()` returns `{ resourceTemplates: [] }` if server lacks resources capability
12+
- `listTools()` returns `{ tools: [] }` if server lacks tools capability
13+
14+
This respects the MCP spec requirement that "Both parties SHOULD respect capability negotiation" and avoids unnecessary server warnings and traffic. The existing `enforceStrictCapabilities` option continues to throw errors when set to `true`.

.changeset/shy-times-learn.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@modelcontextprotocol/node': patch
3+
'@modelcontextprotocol/test-integration': patch
4+
'@modelcontextprotocol/server': patch
5+
'@modelcontextprotocol/core': patch
6+
---
7+
8+
deprecated .tool, .prompt, .resource method removal

.github/pages/_config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
title: '@modelcontextprotocol/sdk'
2+
3+
# Include generated files and directories which may start with underscores
4+
include:
5+
- '_*'

.github/pages/index.html

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
---
2+
# Jekyll front matter to enable Liquid templating
3+
---
4+
5+
<!doctype html>
6+
<html lang="en">
7+
<head>
8+
<meta charset="utf-8" />
9+
<meta name="viewport" content="width=device-width, initial-scale=1" />
10+
<title>MCP TypeScript SDK - API Documentation</title>
11+
<meta http-equiv="refresh" content="1; url={{ site.data.latest_version }}/" />
12+
<link rel="canonical" href="{{ site.data.latest_version }}/" />
13+
<style>
14+
* {
15+
box-sizing: border-box;
16+
}
17+
body {
18+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
19+
max-width: 800px;
20+
margin: 0 auto;
21+
padding: 2rem;
22+
line-height: 1.6;
23+
color: #333;
24+
}
25+
h1 {
26+
color: #1a1a1a;
27+
border-bottom: 2px solid #eee;
28+
padding-bottom: 0.5rem;
29+
}
30+
h2 {
31+
color: #444;
32+
margin-top: 2rem;
33+
}
34+
a {
35+
color: #0066cc;
36+
text-decoration: none;
37+
}
38+
a:hover {
39+
text-decoration: underline;
40+
}
41+
.redirect-notice {
42+
background: #f0f7ff;
43+
border: 1px solid #cce0ff;
44+
border-radius: 6px;
45+
padding: 1rem;
46+
margin-bottom: 2rem;
47+
}
48+
.versions-table {
49+
width: 100%;
50+
border-collapse: collapse;
51+
margin: 1rem 0;
52+
}
53+
.versions-table th,
54+
.versions-table td {
55+
text-align: left;
56+
padding: 0.75rem;
57+
border-bottom: 1px solid #eee;
58+
}
59+
.versions-table th {
60+
background: #f5f5f5;
61+
font-weight: 600;
62+
}
63+
.package-versions {
64+
display: none;
65+
background: #fafafa;
66+
border-radius: 6px;
67+
padding: 1rem;
68+
margin-top: 1rem;
69+
}
70+
.package-versions.loaded {
71+
display: block;
72+
}
73+
.package-list {
74+
list-style: none;
75+
padding: 0;
76+
margin: 0;
77+
}
78+
.package-list li {
79+
padding: 0.25rem 0;
80+
font-family: monospace;
81+
font-size: 0.9rem;
82+
}
83+
.package-name {
84+
color: #666;
85+
}
86+
.package-version {
87+
color: #0066cc;
88+
font-weight: 500;
89+
}
90+
@media (prefers-color-scheme: dark) {
91+
body {
92+
background: #1a1a1a;
93+
color: #e0e0e0;
94+
}
95+
h1 {
96+
color: #fff;
97+
border-bottom-color: #333;
98+
}
99+
h2 {
100+
color: #ccc;
101+
}
102+
a {
103+
color: #66b3ff;
104+
}
105+
.redirect-notice {
106+
background: #1a2a3a;
107+
border-color: #2a4a6a;
108+
}
109+
.versions-table th {
110+
background: #2a2a2a;
111+
}
112+
.versions-table td,
113+
.versions-table th {
114+
border-bottom-color: #333;
115+
}
116+
.package-versions {
117+
background: #2a2a2a;
118+
}
119+
.package-name {
120+
color: #999;
121+
}
122+
}
123+
</style>
124+
</head>
125+
<body>
126+
<h1>MCP TypeScript SDK</h1>
127+
128+
<div class="redirect-notice">
129+
<p>Redirecting to <a href="{{ site.data.latest_version }}/">latest documentation ({{ site.data.latest_version }})</a>...</p>
130+
</div>
131+
132+
<h2>Package Versions</h2>
133+
<div id="package-versions" class="package-versions">
134+
<p>Loading package versions...</p>
135+
</div>
136+
137+
<h2>All Documentation Versions</h2>
138+
<p>Select a version to view its API documentation:</p>
139+
<ul id="versions-list">
140+
<li><a href="{{ site.data.latest_version }}/">{{ site.data.latest_version }}</a> (latest)</li>
141+
</ul>
142+
143+
<script>
144+
// Redirect to latest version
145+
setTimeout(function () {
146+
window.location.href = '{{ site.data.latest_version }}/';
147+
}, 1000);
148+
149+
// Load and display package versions from versions.json
150+
fetch('{{ site.data.latest_version }}/versions.json')
151+
.then(function (response) {
152+
if (!response.ok) throw new Error('versions.json not found');
153+
return response.json();
154+
})
155+
.then(function (data) {
156+
var container = document.getElementById('package-versions');
157+
var html = '<p>Packages included in the latest documentation:</p><ul class="package-list">';
158+
159+
for (var pkg in data.packages) {
160+
html +=
161+
'<li><span class="package-name">' +
162+
pkg +
163+
'</span>: <span class="package-version">' +
164+
data.packages[pkg] +
165+
'</span></li>';
166+
}
167+
168+
html += '</ul>';
169+
html +=
170+
'<p style="font-size: 0.85rem; color: #666; margin-top: 1rem;">Generated from tag: ' +
171+
data.generated_from_tag +
172+
'</p>';
173+
174+
container.innerHTML = html;
175+
container.classList.add('loaded');
176+
})
177+
.catch(function (err) {
178+
// versions.json may not exist for older docs
179+
document.getElementById('package-versions').style.display = 'none';
180+
});
181+
</script>
182+
</body>
183+
</html>

0 commit comments

Comments
 (0)