Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
600d148
feat: add scaffolding for TS Tasks SDK
LucaButBoring Sep 4, 2026
75e56f9
feat(core): implement task protocol wire layers
LucaButBoring Sep 4, 2026
088d7aa
feat(client): add task-enabled session foundation
LucaButBoring Sep 5, 2026
2e60c06
chore: format ext-tasks with Prettier
LucaButBoring Sep 5, 2026
5b181b9
feat(client): implement task execution lifecycle
LucaButBoring Sep 5, 2026
7030cc9
chore: add ESLint checks
LucaButBoring Sep 5, 2026
ed3ef94
feat(client): implement task input exchange
LucaButBoring Sep 5, 2026
e15ec5d
feat(client): add task resume and Client adapter
LucaButBoring Sep 5, 2026
ca88862
refactor: modularize and harden ext-tasks SDK
LucaButBoring Sep 5, 2026
241f27d
fix: prevent stale SDK artifacts in package
LucaButBoring Sep 5, 2026
00e0fb7
fix: require built client artifact in tarball
LucaButBoring Sep 5, 2026
8757d5f
refactor: consolidate codec helpers and require JSDoc
LucaButBoring Sep 5, 2026
02ce4ce
refactor: consolidate complete codec helpers
LucaButBoring Sep 5, 2026
2c7e9e6
feat: adopt Zod-first task schemas
LucaButBoring Sep 5, 2026
8392dfb
chore: enable strict TypeScript linting
LucaButBoring Sep 6, 2026
130318c
chore: validate all pushes and pull requests
LucaButBoring Sep 6, 2026
dc94c50
refactor: clarify task routing and lifecycle flows
LucaButBoring Sep 6, 2026
de04cd8
chore: clarify task execution state flows
LucaButBoring Sep 6, 2026
dc3ce0f
chore: simplify deferred value flows
LucaButBoring Sep 6, 2026
00dde12
feat: harden task client integration
LucaButBoring Sep 7, 2026
1c3da43
feat: add generation-neutral task sessions
LucaButBoring Sep 9, 2026
0c239c0
feat: preserve request timeouts across task sessions
LucaButBoring Sep 9, 2026
fa6bad1
feat: simplify interfaces and add docs
LucaButBoring Sep 9, 2026
f0b8060
fix(ci): don't use offline install
LucaButBoring Sep 9, 2026
ece665a
fix: address Copilot comments
LucaButBoring Sep 10, 2026
03e2089
fix: address Copilot comments
LucaButBoring Sep 10, 2026
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
51 changes: 42 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,52 @@ name: CI

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

permissions:
contents: read

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

jobs:
check-schema:
validate:
name: Validate repository
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "24"
cache: npm
- name: Install dependencies
run: npm ci
- name: Check schemas, package, and packed consumers
run: npm run check
- name: Build documentation
run: npm run docs:build

peer-range:
name: Peer range (${{ matrix.client-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
client-version: ["2.0.0", "2"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "24"
- run: npm ci
- run: npm run check:schema:ts
- run: npm run check:schema:json
- run: npm run docs:build
cache: npm
- name: Install dependencies
run: npm ci
- name: Build package
run: npm run build:package
- name: Check packed package against client peer endpoint
run: npm run check:peer-range -- ${{ matrix.client-version }}
7 changes: 4 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@ concurrency:

jobs:
build:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
cache: npm
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Install dependencies
run: npm ci
- name: Validate repository
run: npm run check
- name: Build with VitePress
run: npm run docs:build
- name: Upload artifact
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules/
.claude/
.jj/
*.tsbuildinfo
*.tgz
dist/
schema/**/generated/
.vitepress/cache
Expand Down
53 changes: 51 additions & 2 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,61 @@ export default withMermaid(
outline: [2, 3],

nav: [
{ text: "SDK", link: "/typescript/" },
{ text: "SEPs", link: "/seps/2663-tasks-extension" },
{ text: "Specification", link: "/specification/2026-07-28/tasks" },
],

sidebar: {
"specification/": [
"/typescript/": [
{
text: "Introduction",
items: [
{ text: "Getting started", link: "/typescript/" },
{
text: "Call your first tool",
link: "/typescript/getting-started",
},
{
text: "Migrate from the base SDK",
link: "/typescript/migrating-from-the-sdk",
},
],
},
{
text: "Clients",
items: [
{
text: "Observe and control execution",
link: "/typescript/client/execution",
},
{
text: "Handle input and recover tasks",
link: "/typescript/client/input-and-recovery",
},
{
text: "[2025-11-25] Receive sampling and elicitation requests",
link: "/typescript/receiver",
},
],
},
{
text: "Advanced",
items: [
{
text: "Integrate adapters and schemas",
link: "/typescript/adapters-and-schemas",
},
],
},
{
text: "Help",
items: [
{ text: "Troubleshooting", link: "/typescript/troubleshooting" },
],
},
],
"/specification/": [
{
text: "Specification",
items: [
Expand All @@ -29,7 +78,7 @@ export default withMermaid(
],
},
],
"seps/": [
"/seps/": [
{
text: "SEPs",
items: [
Expand Down
40 changes: 29 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# MCP Tasks Extension
This repository contains the official [Model Context Protocol](https://modelcontextprotocol.io) Tasks extension (`io.modelcontextprotocol/tasks`), based on [SEP-2663](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2663).

## Overview
This repository contains the official [Model Context Protocol](https://modelcontextprotocol.io) Tasks extension (`io.modelcontextprotocol/tasks`), based on [SEP-2663](https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2663).

This extension defines the **Tasks** primitive for the Model Context Protocol (MCP). Tasks are durable state machines that carry information about the underlying execution state of a request, enabling requestor polling and deferred result retrieval. Each task is uniquely identifiable by a receiver-generated **task ID**.
## Why Tasks?

Tasks are useful for:
Some MCP requests finish quickly. Others run for minutes, wait for human input, or need to survive a disconnected client. The Tasks extension lets a receiver return a durable task handle so the requester can follow progress and retrieve the result later.

- Representing expensive computations and batch processing requests
- Integrating seamlessly with external job/workflow APIs
- Enabling call-now, fetch-later execution patterns
Use Tasks for long computations, approval workflows, external job systems, and call-now/fetch-later APIs.

**Extension Identifier:** `io.modelcontextprotocol/tasks`

## Use it from TypeScript

The `@modelcontextprotocol/ext-tasks` package provides generation-agnostic requester lifecycle APIs and 2025-11-25 Tasks receiver support. Start with the [TypeScript package guide](https://modelcontextprotocol.github.io/ext-tasks/typescript/) or [call your first task-enabled tool](https://modelcontextprotocol.github.io/ext-tasks/typescript/getting-started.html).

## Schemas

| Version | Status | TypeScript | JSON Schema |
| --- | --- | --- | --- |
| `2026-07-28` | Stable | [`schema.ts`](schema/2026-07-28/schema.ts) | [`schema.json`](schema/2026-07-28/schema.json) |
| `draft` | Development | [`schema.ts`](schema/draft/schema.ts) | [`schema.json`](schema/draft/schema.json) |
| Version | Status | TypeScript | JSON Schema |
| ------------ | ----------- | ------------------------------------------ | ---------------------------------------------- |
| `2026-07-28` | Stable | [`schema.ts`](schema/2026-07-28/schema.ts) | [`schema.json`](schema/2026-07-28/schema.json) |
| `draft` | Development | [`schema.ts`](schema/draft/schema.ts) | [`schema.json`](schema/draft/schema.json) |

Released schema directories are immutable snapshots with version-specific JSON Schema identifiers. Development and schema generation target `schema/draft/` only. To create a release snapshot from the current draft:

Expand All @@ -28,6 +29,23 @@ npm run snapshot:schema -- YYYY-MM-DD

## Development

### SDK Package

The redistributable package lives in `packages/ext-tasks` and publishes as `@modelcontextprotocol/ext-tasks`.

```bash
# Run schema, package, and packed-consumer checks
npm run check

# Run the package tests in watch mode
npm run test:watch

# Create the publishable tarball
npm run pack:package
```

The package intentionally has no root export. Consumers import `/client`, `/receiver`, `/core`, `/core/v1`, or `/core/v2`; the guide explains which entry point owns each workflow.

### Schema Generation

The draft JSON Schema is auto-generated from the TypeScript type definitions using [ts-to-zod](https://github.com/fabien0102/ts-to-zod) and Zod's `toJSONSchema()`. Do not hand-edit `schema.json` or `generated/schema.ts`.
Expand Down
Loading
Loading