Skip to content

Commit 81a8288

Browse files
docs: v2 follow-up improvements
- Add v2 development notice at top of README - Fix npm badge URLs (add missing %2F encoding) - Update CONTRIBUTING.md for pnpm/corepack workflow - Document branch strategy (main vs v1.x) - Move InMemoryEventStore from server exports to test-helpers
1 parent 71ae3ac commit 81a8288

File tree

6 files changed

+47
-16
lines changed

6 files changed

+47
-16
lines changed

CONTRIBUTING.md

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,40 @@
22

33
We welcome contributions to the Model Context Protocol TypeScript SDK! This document outlines the process for contributing to the project.
44

5+
## Branches
6+
7+
This repository has two main branches:
8+
9+
- **`main`** – v2 of the SDK (currently in development). This is a monorepo with split packages.
10+
- **`v1.x`** – stable v1 release. Bug fixes and patches for v1 should target this branch.
11+
12+
**Which branch should I use as a base?**
13+
14+
- For **new features** or **v2-related work**: base your PR on `main`
15+
- For **v1 bug fixes** or **patches**: base your PR on `v1.x`
16+
517
## Getting Started
618

19+
This project uses [pnpm](https://pnpm.io/) as its package manager. If you don't have pnpm installed, enable it via [corepack](https://nodejs.org/api/corepack.html) (included with Node.js 16.9+):
20+
21+
```bash
22+
corepack enable
23+
```
24+
25+
Then:
26+
727
1. Fork the repository
828
2. Clone your fork: `git clone https://github.com/YOUR-USERNAME/typescript-sdk.git`
9-
3. Install dependencies: `npm install`
10-
4. Build the project: `npm run build`
11-
5. Run tests: `npm test`
29+
3. Install dependencies: `pnpm install`
30+
4. Build the project: `pnpm build:all`
31+
5. Run tests: `pnpm test:all`
1232

1333
## Development Process
1434

15-
1. Create a new branch for your changes
35+
1. Create a new branch for your changes (based on `main` or `v1.x` as appropriate)
1636
2. Make your changes
17-
3. Run `npm run lint` to ensure code style compliance
18-
4. Run `npm test` to verify all tests pass
37+
3. Run `pnpm lint:all` to ensure code style compliance
38+
4. Run `pnpm test:all` to verify all tests pass
1939
5. Submit a pull request
2040

2141
## Pull Request Guidelines
@@ -28,8 +48,17 @@ We welcome contributions to the Model Context Protocol TypeScript SDK! This docu
2848

2949
## Running Examples
3050

31-
- Start the server: `npm run server`
32-
- Run the client: `npm run client`
51+
See [`examples/server/README.md`](examples/server/README.md) and [`examples/client/README.md`](examples/client/README.md) for a full list of runnable examples.
52+
53+
Quick start:
54+
55+
```bash
56+
# Run a server example
57+
pnpm --filter @modelcontextprotocol/examples-server exec tsx src/simpleStreamableHttp.ts
58+
59+
# Run a client example (in another terminal)
60+
pnpm --filter @modelcontextprotocol/examples-client exec tsx src/simpleStreamableHttp.ts
61+
```
3362

3463
## Code of Conduct
3564

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# MCP TypeScript SDK
22

3-
![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%server) ![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%client) ![MIT licensed](https://img.shields.io/npm/l/%40modelcontextprotocol%server)
3+
> [!IMPORTANT]
4+
> **This is the `main` branch which contains v2 of the SDK (currently in development).**
5+
>
6+
> For the stable v1 release, see the [`v1.x` branch](https://github.com/modelcontextprotocol/typescript-sdk/tree/v1.x) and its documentation.
7+
8+
![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%2Fserver) ![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%2Fclient) ![MIT licensed](https://img.shields.io/npm/l/%40modelcontextprotocol%2Fserver)
49

510
<details>
611
<summary>Table of Contents</summary>

packages/server/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export * from './server/completable.js';
22
export * from './server/express.js';
3-
export * from './server/inMemoryEventStore.js';
43
export * from './server/mcp.js';
54
export * from './server/server.js';
65
export * from './server/sse.js';

packages/server/src/server/inMemoryEventStore.ts renamed to test/helpers/src/helpers/inMemoryEventStore.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import type { JSONRPCMessage } from '@modelcontextprotocol/core';
2-
3-
import type { EventStore } from './webStandardStreamableHttp.js';
1+
import type { EventStore, JSONRPCMessage } from '@modelcontextprotocol/server';
42

53
/**
6-
* Simple in-memory implementation of the EventStore interface for resumability
4+
* Simple in-memory implementation of the EventStore interface for resumability.
75
* This is primarily intended for examples and testing, not for production use
86
* where a persistent storage solution would be more appropriate.
97
*/

test/helpers/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export * from './fixtures/zodTestMatrix.js';
22
export * from './helpers/http.js';
3+
export * from './helpers/inMemoryEventStore.js';
34
export * from './helpers/oauth.js';
45
export * from './helpers/tasks.js';

test/integration/test/taskResumability.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ import { createServer, type Server } from 'node:http';
44
import { Client, StreamableHTTPClientTransport } from '@modelcontextprotocol/client';
55
import {
66
CallToolResultSchema,
7-
InMemoryEventStore,
87
LoggingMessageNotificationSchema,
98
McpServer,
109
StreamableHTTPServerTransport
1110
} from '@modelcontextprotocol/server';
1211
import type { ZodMatrixEntry } from '@modelcontextprotocol/test-helpers';
13-
import { listenOnRandomPort, zodTestMatrix } from '@modelcontextprotocol/test-helpers';
12+
import { InMemoryEventStore, listenOnRandomPort, zodTestMatrix } from '@modelcontextprotocol/test-helpers';
1413

1514
describe.each(zodTestMatrix)('$zodVersionLabel', (entry: ZodMatrixEntry) => {
1615
const { z } = entry;

0 commit comments

Comments
 (0)