Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
71ae3ac
[v2] Мonorepo, `sdk-client`, `sdk-server`, `sdk-core` package split (…
KKonstantinov Dec 19, 2025
8a1b457
fix: v2 follow-up improvements (#1318)
felixweinberger Dec 19, 2025
f1f2550
Changesets: add @changesets/changelog-github (#1323)
KKonstantinov Dec 20, 2025
d4bd9fe
v2: changeset config fix (#1324)
KKonstantinov Dec 20, 2025
f82c997
changeset action update (#1325)
KKonstantinov Dec 20, 2025
6b4d99f
test: use toStrictEqual instead of toEqual in in-memory tests (#1330)
starfish719 Dec 23, 2025
0a75810
fix: prevent ReDoS vulnerability in UriTemplate regex patterns (#1363)
DevJanderson Jan 7, 2026
09a658b
fix(client): replace body.cancel() with text() to prevent hanging (#1…
grimmerk Jan 9, 2026
8b6e455
fix(server): application/json header for notifictions (#1373)
mattzcarey Jan 9, 2026
3466a9e
fix(server): add missing changeset for body.cancel() fix (#1372)
mattzcarey Jan 9, 2026
1014d9f
feat: add client conformance testing (#1360)
pcarleton Jan 9, 2026
2bb7f47
feat: add workflow to publish v1.x releases on tag push (#1367)
pcarleton Jan 9, 2026
0073ab2
Add server conformance testing (#1375)
pcarleton Jan 13, 2026
227c125
docs: add guidance on discussing features before opening PRs (#1311)
felixweinberger Jan 13, 2026
5ce4b5e
chore: update licensing to Apache 2.0 for new contributions (#1377)
domdomegg Jan 13, 2026
f495077
[v2] Decouple `server` from `express` and `hono` - http framework-agn…
KKonstantinov Jan 16, 2026
17a2c39
readme fix (#1391)
KKonstantinov Jan 16, 2026
8bf13e4
flaky test fix (#1392)
KKonstantinov Jan 16, 2026
2edbe8c
Use correct schema for client sampling validation when tools are pres…
olaservo Jan 19, 2026
40f6ba7
[v2] move to Headers object (#1327)
KKonstantinov Jan 20, 2026
f66a55b
Revert "fix(server): application/json header for notifictions" (#1388)
mattzcarey Jan 20, 2026
9296459
fix: prevent Hono from overriding global Response object (#1410)
mattzcarey Jan 20, 2026
9fc7e28
`v2` ESlint fixes (#1403)
KKonstantinov Jan 20, 2026
25f288b
Add API documentation with GitHub Pages deployment (#1109)
jonathanhefner Jan 20, 2026
55a28ed
chore(deps): bump hono from 4.11.3 to 4.11.4 in the npm_and_yarn grou…
dependabot[bot] Jan 22, 2026
bf6f16c
eslint fixes in tests (#1418)
KKonstantinov Jan 22, 2026
3eb18ec
`v2`: pnpm audit fixes (#1394)
KKonstantinov Jan 22, 2026
11e3266
fix: resolve pnpm audit vulnerabilities by removing @pnpm/workspace.*…
felixweinberger Jan 23, 2026
dcf708d
`v2` - clean deprecated methods and exports (#1419)
KKonstantinov Jan 23, 2026
b2326af
fix(server): handle undefined arguments for tools with all optional p…
su-ram Jan 23, 2026
4b5fdcb
fix: handle OAuth error responses returned with HTTP 200 status (#1343)
christso Jan 26, 2026
00249ce
feat(client): return empty lists when server lacks capability (#1386)
PederHP Jan 26, 2026
b0ef89f
`v2`: fix simpleStreamableHttp auth example for inspector connect flo…
KKonstantinov Jan 28, 2026
4a0db70
docs: add v1 to v2 migration guide (#1438)
felixweinberger Feb 2, 2026
64f2782
fix: remove cyclic workspace dependency between test-helpers and clie…
felixweinberger Feb 2, 2026
a5670de
chore: suppress unrs-resolver build script warning (#1445)
felixweinberger Feb 2, 2026
f6e8204
fix: replace schema-based handlers with string method names (#1446)
mattzcarey Feb 2, 2026
92f5ce5
chore: disable pnpm manage-package-manager-versions in .npmrc (#1452)
felixweinberger Feb 3, 2026
160902e
feat: allow overriding protocol versions in Client, Server, and Trans…
mattzcarey Feb 3, 2026
0f0a4eb
`v2`: Errors refactor (ProtocolError, SdkError, OAuthError) (#1454)
KKonstantinov Feb 3, 2026
1fb7b25
`v2`: Move conformance into workspace (#1470)
KKonstantinov Feb 3, 2026
bc883af
feat: auto-select JSON Schema validator based on runtime (#1456)
mattzcarey Feb 3, 2026
be5670f
feat!: drop Zod v3 support (#1460)
mattzcarey Feb 3, 2026
7bb79eb
refactor: replace RequestHandlerExtra with structured context types (…
felixweinberger Feb 3, 2026
faeb03e
[RFC] refactor: remove vestigial generic type parameters from Protoco…
felixweinberger Feb 3, 2026
0da5d3f
ci: add Claude GitHub Actions for @claude mentions and code review (#…
felixweinberger Feb 5, 2026
65bbcea
Fix cross-session task leakage (#1486)
localden Feb 6, 2026
8654c7f
Fix: Respect explicit listChanged: false capability setting (#1513)
mattzcarey Feb 10, 2026
327243c
fix: add missing hono peer dependency to @modelcontextprotocol/node (…
corvid-agent Feb 10, 2026
44d9132
Use recursive glob in TypeDoc config to find nested middleware packag…
jonathanhefner Feb 10, 2026
7e80df6
fix: output TypeDoc to `tmp/docs/` by default (#1482)
jonathanhefner Feb 10, 2026
64fb21d
docs: add missing code fences to JSDoc `@example` blocks (#1485)
jonathanhefner Feb 10, 2026
efed431
docs: add `{@link}` and `@see` tags to JSDoc comments (#1490)
jonathanhefner Feb 10, 2026
7778c74
docs: fix grammar, typos, and style in JSDoc comments (#1491)
jonathanhefner Feb 10, 2026
91f6a27
feat: add streaming methods for elicitation and sampling (#1210)
LucaButBoring Feb 11, 2026
42b3359
Add code reference links and backticks to JSDoc comments (#1484)
jonathanhefner Feb 11, 2026
553d6d4
Add `sync-snippets` script for type-checked examples (#1487)
jonathanhefner Feb 13, 2026
55857a8
ci: add TypeDoc validation to `check:all` with `treatWarningsAsErrors…
jonathanhefner Feb 13, 2026
c9ac842
Add JSDoc `@example` tags with companion `.examples.ts` files (#1524)
jonathanhefner Feb 13, 2026
20d5e4e
Overhaul `docs/server.md` to be a more complete, self-contained serve…
jonathanhefner Feb 13, 2026
288eaf8
Add new sections and inline code snippets to `docs/client.md` (#1526)
jonathanhefner Feb 13, 2026
dc896e1
feat: expose discoverOAuthServerInfo() and add provider caching for a…
felixweinberger Feb 13, 2026
284a413
Dissolve `capabilities.md` into `server.md` and `client.md` (#1532)
jonathanhefner Feb 17, 2026
2b620d7
fix: resolve TypeDoc warnings from directory-pointing relative links …
jonathanhefner Feb 17, 2026
6cd75c6
Import "Build a weather server" quickstart guide (#1549)
jonathanhefner Feb 18, 2026
d6dc0ab
Import "Build an LLM-powered chatbot" quickstart guide (#1550)
jonathanhefner Feb 18, 2026
3c31f96
Update SECURITY.md to use GitHub Security Advisories (#1555)
localden Feb 19, 2026
1c4c77a
Add JSDoc descriptions and `@example` blocks to `Client` public metho…
jonathanhefner Feb 20, 2026
ad6b177
Replace Claude for Desktop with VS Code + Copilot in server quickstar…
jonathanhefner Feb 20, 2026
c4ee360
Rewrite `docs/client.md` as a code-heavy, prose-light how-to guide (#…
jonathanhefner Feb 20, 2026
7e10f2c
fix: call onerror for silently swallowed transport errors
qing-ant Feb 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works with multi-package repos, or single-package repos to help you version and publish your code. You can find the full documentation for it
[in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
5 changes: 5 additions & 0 deletions .changeset/add-hono-peer-dep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modelcontextprotocol/node': patch
---

Add missing `hono` peer dependency to `@modelcontextprotocol/node`. The package already depends on `@hono/node-server` which requires `hono` at runtime, but `hono` was only listed in the workspace root, not as a peer dependency of the package itself.
5 changes: 5 additions & 0 deletions .changeset/brave-lions-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modelcontextprotocol/node': patch
---

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.
6 changes: 6 additions & 0 deletions .changeset/busy-weeks-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modelcontextprotocol/core': patch
'@modelcontextprotocol/server': patch
---

Fix ReDoS vulnerability in UriTemplate regex patterns (CVE-2026-0621)
17 changes: 17 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "modelcontextprotocol/typescript-sdk" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [
"@modelcontextprotocol/examples-client",
"@modelcontextprotocol/examples-client-quickstart",
"@modelcontextprotocol/examples-server",
"@modelcontextprotocol/examples-server-quickstart",
"@modelcontextprotocol/examples-shared"
]
}
5 changes: 5 additions & 0 deletions .changeset/cyan-cycles-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modelcontextprotocol/server': patch
---

missing change for fix(client): replace body.cancel() with text() to prevent hanging
10 changes: 10 additions & 0 deletions .changeset/expose-auth-server-discovery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@modelcontextprotocol/client': minor
---

Add `discoverOAuthServerInfo()` function and unified discovery state caching for OAuth

- New `discoverOAuthServerInfo(serverUrl)` export that performs RFC 9728 protected resource metadata discovery followed by authorization server metadata discovery in a single call. Use this for operations like token refresh and revocation that need the authorization server URL outside of `auth()`.
- New `OAuthDiscoveryState` type and optional `OAuthClientProvider` methods `saveDiscoveryState()` / `discoveryState()` allow providers to persist all discovery results (auth server URL, resource metadata URL, resource metadata, auth server metadata) across sessions. This avoids redundant discovery requests and handles browser redirect scenarios where discovery state would otherwise be lost.
- New `'discovery'` scope for `invalidateCredentials()` to clear cached discovery state.
- New `OAuthServerInfo` type exported for the return value of `discoverOAuthServerInfo()`.
5 changes: 5 additions & 0 deletions .changeset/fix-task-session-isolation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modelcontextprotocol/core': patch
---

Fix InMemoryTaskStore to enforce session isolation. Previously, sessionId was accepted but ignored on all TaskStore methods, allowing any session to enumerate, read, and mutate tasks created by other sessions. The store now persists sessionId at creation time and enforces ownership on all reads and writes.
8 changes: 8 additions & 0 deletions .changeset/funky-baths-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@modelcontextprotocol/node': patch
'@modelcontextprotocol/test-integration': patch
'@modelcontextprotocol/server': patch
'@modelcontextprotocol/core': patch
---

remove deprecated .tool, .prompt, .resource method signatures
5 changes: 5 additions & 0 deletions .changeset/heavy-walls-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@modelcontextprotocol/server': patch
---

reverting application/json in notifications
7 changes: 7 additions & 0 deletions .changeset/oauth-error-http200.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@modelcontextprotocol/client': patch
---

Fix OAuth error handling for servers returning errors with HTTP 200 status

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.
14 changes: 14 additions & 0 deletions .changeset/respect-capability-negotiation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@modelcontextprotocol/client': patch
---

Respect capability negotiation in list methods by returning empty lists when server lacks capability

The Client now returns empty lists instead of sending requests to servers that don't advertise the corresponding capability:

- `listPrompts()` returns `{ prompts: [] }` if server lacks prompts capability
- `listResources()` returns `{ resources: [] }` if server lacks resources capability
- `listResourceTemplates()` returns `{ resourceTemplates: [] }` if server lacks resources capability
- `listTools()` returns `{ tools: [] }` if server lacks tools capability

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`.
8 changes: 8 additions & 0 deletions .changeset/shy-times-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@modelcontextprotocol/node': patch
'@modelcontextprotocol/test-integration': patch
'@modelcontextprotocol/server': patch
'@modelcontextprotocol/core': patch
---

deprecated .tool, .prompt, .resource method removal
6 changes: 6 additions & 0 deletions .changeset/tender-snails-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modelcontextprotocol/client': patch
'@modelcontextprotocol/server': patch
---

Initial 2.0.0-alpha.0 client and server package
5 changes: 5 additions & 0 deletions .github/pages/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
title: '@modelcontextprotocol/sdk'

# Include generated files and directories which may start with underscores
include:
- '_*'
183 changes: 183 additions & 0 deletions .github/pages/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
---
# Jekyll front matter to enable Liquid templating
---

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>MCP TypeScript SDK - API Documentation</title>
<meta http-equiv="refresh" content="1; url={{ site.data.latest_version }}/" />
<link rel="canonical" href="{{ site.data.latest_version }}/" />
<style>
* {
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 2rem;
line-height: 1.6;
color: #333;
}
h1 {
color: #1a1a1a;
border-bottom: 2px solid #eee;
padding-bottom: 0.5rem;
}
h2 {
color: #444;
margin-top: 2rem;
}
a {
color: #0066cc;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.redirect-notice {
background: #f0f7ff;
border: 1px solid #cce0ff;
border-radius: 6px;
padding: 1rem;
margin-bottom: 2rem;
}
.versions-table {
width: 100%;
border-collapse: collapse;
margin: 1rem 0;
}
.versions-table th,
.versions-table td {
text-align: left;
padding: 0.75rem;
border-bottom: 1px solid #eee;
}
.versions-table th {
background: #f5f5f5;
font-weight: 600;
}
.package-versions {
display: none;
background: #fafafa;
border-radius: 6px;
padding: 1rem;
margin-top: 1rem;
}
.package-versions.loaded {
display: block;
}
.package-list {
list-style: none;
padding: 0;
margin: 0;
}
.package-list li {
padding: 0.25rem 0;
font-family: monospace;
font-size: 0.9rem;
}
.package-name {
color: #666;
}
.package-version {
color: #0066cc;
font-weight: 500;
}
@media (prefers-color-scheme: dark) {
body {
background: #1a1a1a;
color: #e0e0e0;
}
h1 {
color: #fff;
border-bottom-color: #333;
}
h2 {
color: #ccc;
}
a {
color: #66b3ff;
}
.redirect-notice {
background: #1a2a3a;
border-color: #2a4a6a;
}
.versions-table th {
background: #2a2a2a;
}
.versions-table td,
.versions-table th {
border-bottom-color: #333;
}
.package-versions {
background: #2a2a2a;
}
.package-name {
color: #999;
}
}
</style>
</head>
<body>
<h1>MCP TypeScript SDK</h1>

<div class="redirect-notice">
<p>Redirecting to <a href="{{ site.data.latest_version }}/">latest documentation ({{ site.data.latest_version }})</a>...</p>
</div>

<h2>Package Versions</h2>
<div id="package-versions" class="package-versions">
<p>Loading package versions...</p>
</div>

<h2>All Documentation Versions</h2>
<p>Select a version to view its API documentation:</p>
<ul id="versions-list">
<li><a href="{{ site.data.latest_version }}/">{{ site.data.latest_version }}</a> (latest)</li>
</ul>

<script>
// Redirect to latest version
setTimeout(function () {
window.location.href = '{{ site.data.latest_version }}/';
}, 1000);

// Load and display package versions from versions.json
fetch('{{ site.data.latest_version }}/versions.json')
.then(function (response) {
if (!response.ok) throw new Error('versions.json not found');
return response.json();
})
.then(function (data) {
var container = document.getElementById('package-versions');
var html = '<p>Packages included in the latest documentation:</p><ul class="package-list">';

for (var pkg in data.packages) {
html +=
'<li><span class="package-name">' +
pkg +
'</span>: <span class="package-version">' +
data.packages[pkg] +
'</span></li>';
}

html += '</ul>';
html +=
'<p style="font-size: 0.85rem; color: #666; margin-top: 1rem;">Generated from tag: ' +
data.generated_from_tag +
'</p>';

container.innerHTML = html;
container.classList.add('loaded');
})
.catch(function (err) {
// versions.json may not exist for older docs
document.getElementById('package-versions').style.display = 'none';
});
</script>
</body>
</html>
31 changes: 31 additions & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Source: https://github.com/anthropics/claude-code-action/blob/main/docs/code-review.md
name: Claude Code Review

on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]

jobs:
claude-review:
if: github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1

- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
plugin_marketplaces: "https://github.com/anthropics/claude-code.git"
plugins: "code-review@claude-code-plugins"
prompt: "/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}"
41 changes: 41 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Source: https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
name: Claude Code

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]

jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
use_commit_signing: true
additional_permissions: |
actions: read
Loading
Loading