Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@modelcontextprotocol/server': patch
---

add application/json header for notifications
reverting application/json in notifications
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:
- '_*'
175 changes: 175 additions & 0 deletions .github/pages/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
---
# 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>
82 changes: 41 additions & 41 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
name: Conformance Tests

on:
push:
branches: [main]
pull_request:
workflow_dispatch:
push:
branches: [main]
pull_request:
workflow_dispatch:

concurrency:
group: conformance-${{ github.ref }}
cancel-in-progress: true
group: conformance-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
contents: read

jobs:
client-conformance:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- run: pnpm install
- run: pnpm run build:all
- run: pnpm run test:conformance:client:all
client-conformance:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- run: pnpm install
- run: pnpm run build:all
- run: pnpm run test:conformance:client:all

server-conformance:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- run: pnpm install
- run: pnpm run build:all
- run: pnpm run test:conformance:server
server-conformance:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- run: pnpm install
- run: pnpm run build:all
- run: pnpm run test:conformance:server
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,42 @@ jobs:
- run: pnpm publish --provenance --access public ${{ steps.npm-tag.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# Generates API documentation for GitHub Pages on any release
# Supports both simple tags (v1.2.3) and package-scoped tags (@scope/package@1.2.3)
publish-gh-pages:
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs: [publish]

permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: pnpm install

- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Generate documentation
run: ./scripts/generate-gh-pages.sh "${{ github.ref_name }}"

- name: Push to gh-pages
run: git push origin gh-pages
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ This repository has two main branches:

Small PRs get reviewed fast. Large PRs sit in the queue.

We can review a few dozen lines in a few minutes. But a PR touching hundreds of lines across many files takes real effort to verify—and things inevitably slip through. If your change is big, break it into a stack of smaller PRs or get clear alignment from a maintainer on your approach in an issue before submitting a large PR.
We can review a few dozen lines in a few minutes. But a PR touching hundreds of lines across many files takes real effort to verify—and things inevitably slip through. If your change is big, break it into a stack of smaller PRs or get clear alignment from a maintainer on your
approach in an issue before submitting a large PR.

### What Gets Rejected

Expand Down Expand Up @@ -183,6 +184,4 @@ Please review our [Security Policy](SECURITY.md) for reporting security vulnerab

### License

By contributing, you agree that your code contributions will be licensed under
the Apache License 2.0. Documentation contributions (excluding specifications)
are licensed under CC-BY 4.0. See the [LICENSE](LICENSE) file for details.
By contributing, you agree that your code contributions will be licensed under the Apache License 2.0. Documentation contributions (excluding specifications) are licensed under CC-BY 4.0. See the [LICENSE](LICENSE) file for details.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# MCP TypeScript SDK

> [!IMPORTANT]
> **This is the `main` branch which contains v2 of the SDK (currently in development, pre-alpha).**
> [!IMPORTANT] **This is the `main` branch which contains v2 of the SDK (currently in development, pre-alpha).**
>
> We anticipate a stable v2 release in Q1 2026. Until then, **v1.x remains the recommended version** for production use. v1.x will continue to receive bug fixes and security updates for at least 6 months after v2 ships to give people time to upgrade.
>
Expand Down Expand Up @@ -133,6 +132,7 @@ Next steps:
- [docs/capabilities.md](docs/capabilities.md) – sampling, elicitation (form and URL), and experimental task-based execution.
- [docs/faq.md](docs/faq.md) – environment and troubleshooting FAQs (including Node.js Web Crypto support).
- External references:
- [SDK API documentation](https://modelcontextprotocol.github.io/typescript-sdk/)
- [Model Context Protocol documentation](https://modelcontextprotocol.io)
- [MCP Specification](https://spec.modelcontextprotocol.io)
- [Example Servers](https://github.com/modelcontextprotocol/servers)
Expand Down
Loading
Loading