Skip to content

Commit 63ade30

Browse files
Include docs/ markdown files in TypeDoc API documentation
- Add `projectDocuments` option to `typedoc.json` to include `docs/*.md` - Prefix `docs/*.md` filenames with indexes to control sidebar ordering - Convert relative links to absolute GitHub URLs so they work in the generated documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent a686e74 commit 63ade30

File tree

6 files changed

+107
-90
lines changed

6 files changed

+107
-90
lines changed

docs/server.md renamed to docs/01-server.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: Server
3+
---
4+
15
## Server overview
26

37
This SDK lets you build MCP servers in TypeScript and connect them to different transports. For most use cases you will use `McpServer` from `@modelcontextprotocol/sdk/server/mcp.js` and choose one of:
@@ -8,11 +12,11 @@ This SDK lets you build MCP servers in TypeScript and connect them to different
812

913
For a complete, runnable example server, see:
1014

11-
- [`simpleStreamableHttp.ts`](../src/examples/server/simpleStreamableHttp.ts) – feature‑rich Streamable HTTP server
12-
- [`jsonResponseStreamableHttp.ts`](../src/examples/server/jsonResponseStreamableHttp.ts) – Streamable HTTP with JSON response mode
13-
- [`simpleStatelessStreamableHttp.ts`](../src/examples/server/simpleStatelessStreamableHttp.ts) – stateless Streamable HTTP server
14-
- [`simpleSseServer.ts`](../src/examples/server/simpleSseServer.ts) – deprecated HTTP+SSE transport
15-
- [`sseAndStreamableHttpCompatibleServer.ts`](../src/examples/server/sseAndStreamableHttpCompatibleServer.ts) – backwards‑compatible server for old and new clients
15+
- [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/simpleStreamableHttp.ts) – feature‑rich Streamable HTTP server
16+
- [`jsonResponseStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/jsonResponseStreamableHttp.ts) – Streamable HTTP with JSON response mode
17+
- [`simpleStatelessStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/simpleStatelessStreamableHttp.ts) – stateless Streamable HTTP server
18+
- [`simpleSseServer.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/simpleSseServer.ts) – deprecated HTTP+SSE transport
19+
- [`sseAndStreamableHttpCompatibleServer.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/sseAndStreamableHttpCompatibleServer.ts) – backwards‑compatible server for old and new clients
1620

1721
## Transports
1822

@@ -27,9 +31,9 @@ Streamable HTTP is the modern, fully featured transport. It supports:
2731

2832
Key examples:
2933

30-
- [`simpleStreamableHttp.ts`](../src/examples/server/simpleStreamableHttp.ts) – sessions, logging, tasks, elicitation, auth hooks
31-
- [`jsonResponseStreamableHttp.ts`](../src/examples/server/jsonResponseStreamableHttp.ts)`enableJsonResponse: true`, no SSE
32-
- [`standaloneSseWithGetStreamableHttp.ts`](../src/examples/server/standaloneSseWithGetStreamableHttp.ts) – notifications with Streamable HTTP GET + SSE
34+
- [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/simpleStreamableHttp.ts) – sessions, logging, tasks, elicitation, auth hooks
35+
- [`jsonResponseStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/jsonResponseStreamableHttp.ts)`enableJsonResponse: true`, no SSE
36+
- [`standaloneSseWithGetStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/standaloneSseWithGetStreamableHttp.ts) – notifications with Streamable HTTP GET + SSE
3337

3438
See the MCP spec for full transport details: `https://modelcontextprotocol.io/specification/2025-11-25/basic/transports`
3539

@@ -42,24 +46,24 @@ Streamable HTTP can run:
4246

4347
Examples:
4448

45-
- Stateless Streamable HTTP: [`simpleStatelessStreamableHttp.ts`](../src/examples/server/simpleStatelessStreamableHttp.ts)
46-
- Stateful with resumability: [`simpleStreamableHttp.ts`](../src/examples/server/simpleStreamableHttp.ts)
49+
- Stateless Streamable HTTP: [`simpleStatelessStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/simpleStatelessStreamableHttp.ts)
50+
- Stateful with resumability: [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/simpleStreamableHttp.ts)
4751

4852
### Deprecated HTTP + SSE
4953

5054
The older HTTP+SSE transport (protocol version 2024‑11‑05) is supported only for backwards compatibility. New implementations should prefer Streamable HTTP.
5155

5256
Examples:
5357

54-
- Legacy SSE server: [`simpleSseServer.ts`](../src/examples/server/simpleSseServer.ts)
58+
- Legacy SSE server: [`simpleSseServer.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/simpleSseServer.ts)
5559
- Backwards‑compatible server (Streamable HTTP + SSE):
56-
[`sseAndStreamableHttpCompatibleServer.ts`](../src/examples/server/sseAndStreamableHttpCompatibleServer.ts)
60+
[`sseAndStreamableHttpCompatibleServer.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/sseAndStreamableHttpCompatibleServer.ts)
5761

5862
## Running your server
5963

6064
For a minimal “getting started” experience:
6165

62-
1. Start from [`simpleStreamableHttp.ts`](../src/examples/server/simpleStreamableHttp.ts).
66+
1. Start from [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/simpleStreamableHttp.ts).
6367
2. Remove features you do not need (tasks, advanced logging, OAuth, etc.).
6468
3. Register your own tools, resources and prompts.
6569

@@ -125,8 +129,8 @@ server.registerTool(
125129

126130
This snippet is illustrative only; for runnable servers that expose tools, see:
127131

128-
- [`simpleStreamableHttp.ts`](../src/examples/server/simpleStreamableHttp.ts)
129-
- [`toolWithSampleServer.ts`](../src/examples/server/toolWithSampleServer.ts)
132+
- [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/simpleStreamableHttp.ts)
133+
- [`toolWithSampleServer.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/toolWithSampleServer.ts)
130134

131135
#### ResourceLink outputs
132136

@@ -157,7 +161,7 @@ server.registerResource(
157161

158162
Dynamic resources use `ResourceTemplate` and can support completions on path parameters. For full runnable examples of resources:
159163

160-
- [`simpleStreamableHttp.ts`](../src/examples/server/simpleStreamableHttp.ts)
164+
- [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/simpleStreamableHttp.ts)
161165

162166
### Prompts
163167

@@ -189,13 +193,13 @@ server.registerPrompt(
189193

190194
For prompts integrated into a full server, see:
191195

192-
- [`simpleStreamableHttp.ts`](../src/examples/server/simpleStreamableHttp.ts)
196+
- [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/simpleStreamableHttp.ts)
193197

194198
### Completions
195199

196200
Both prompts and resources can support argument completions. On the client side, you use `client.complete()` with a reference to the prompt or resource and the partially‑typed argument.
197201

198-
See the MCP spec sections on prompts and resources for complete details, and [`simpleStreamableHttp.ts`](../src/examples/client/simpleStreamableHttp.ts) for client‑side usage patterns.
202+
See the MCP spec sections on prompts and resources for complete details, and [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/simpleStreamableHttp.ts) for client‑side usage patterns.
199203

200204
### Display names and metadata
201205

@@ -205,21 +209,21 @@ Tools, resources and prompts support a `title` field for human‑readable names.
205209

206210
## Multi‑node deployment patterns
207211

208-
The SDK supports multi‑node deployments using Streamable HTTP. The high‑level patterns are documented in [`README.md`](../src/examples/README.md):
212+
The SDK supports multi‑node deployments using Streamable HTTP. The high‑level patterns are documented in [`README.md`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/README.md):
209213

210214
- Stateless mode (any node can handle any request)
211215
- Persistent storage mode (shared database for session state)
212216
- Local state with message routing (message queue + pub/sub)
213217

214-
Those deployment diagrams are kept in [`README.md`](../src/examples/README.md) so the examples and documentation stay aligned.
218+
Those deployment diagrams are kept in [`README.md`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/README.md) so the examples and documentation stay aligned.
215219

216220
## Backwards compatibility
217221

218222
To handle both modern and legacy clients:
219223

220224
- Run a backwards‑compatible server:
221-
- [`sseAndStreamableHttpCompatibleServer.ts`](../src/examples/server/sseAndStreamableHttpCompatibleServer.ts)
225+
- [`sseAndStreamableHttpCompatibleServer.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/sseAndStreamableHttpCompatibleServer.ts)
222226
- Use a client that falls back from Streamable HTTP to SSE:
223-
- [`streamableHttpWithSseFallbackClient.ts`](../src/examples/client/streamableHttpWithSseFallbackClient.ts)
227+
- [`streamableHttpWithSseFallbackClient.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/streamableHttpWithSseFallbackClient.ts)
224228

225229
For the detailed protocol rules, see the “Backwards compatibility” section of the MCP spec.

docs/02-client.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: Client
3+
---
4+
5+
## Client overview
6+
7+
The SDK provides a high-level `Client` class that connects to MCP servers over different transports:
8+
9+
- `StdioClientTransport` – for local processes you spawn.
10+
- `StreamableHTTPClientTransport` – for remote HTTP servers.
11+
- `SSEClientTransport` – for legacy HTTP+SSE servers (deprecated).
12+
13+
Runnable client examples live under:
14+
15+
- [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/simpleStreamableHttp.ts)
16+
- [`streamableHttpWithSseFallbackClient.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/streamableHttpWithSseFallbackClient.ts)
17+
- [`ssePollingClient.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/ssePollingClient.ts)
18+
- [`multipleClientsParallel.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/multipleClientsParallel.ts)
19+
- [`parallelToolCallsClient.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/parallelToolCallsClient.ts)
20+
21+
## Connecting and basic operations
22+
23+
A typical flow:
24+
25+
1. Construct a `Client` with name, version and capabilities.
26+
2. Create a transport and call `client.connect(transport)`.
27+
3. Use high-level helpers:
28+
- `listTools`, `callTool`
29+
- `listPrompts`, `getPrompt`
30+
- `listResources`, `readResource`
31+
32+
See [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/simpleStreamableHttp.ts) for an interactive CLI client that exercises these methods and shows how to handle notifications, elicitation and tasks.
33+
34+
## Transports and backwards compatibility
35+
36+
To support both modern Streamable HTTP and legacy SSE servers, use a client that:
37+
38+
1. Tries `StreamableHTTPClientTransport`.
39+
2. Falls back to `SSEClientTransport` on a 4xx response.
40+
41+
Runnable example:
42+
43+
- [`streamableHttpWithSseFallbackClient.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/streamableHttpWithSseFallbackClient.ts)
44+
45+
## OAuth client authentication helpers
46+
47+
For OAuth-secured MCP servers, the client `auth` module exposes:
48+
49+
- `ClientCredentialsProvider`
50+
- `PrivateKeyJwtProvider`
51+
- `StaticPrivateKeyJwtProvider`
52+
53+
Examples:
54+
55+
- [`simpleOAuthClient.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/simpleOAuthClient.ts)
56+
- [`simpleOAuthClientProvider.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/simpleOAuthClientProvider.ts)
57+
- [`simpleClientCredentials.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/simpleClientCredentials.ts)
58+
- Server-side auth demo: [`demoInMemoryOAuthProvider.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/demoInMemoryOAuthProvider.ts) (tests live under `test/examples/server/demoInMemoryOAuthProvider.test.ts`)
59+
60+
These examples show how to:
61+
62+
- Perform dynamic client registration if needed.
63+
- Acquire access tokens.
64+
- Attach OAuth credentials to Streamable HTTP requests.
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
---
2+
title: Capabilities
3+
---
4+
15
## Sampling
26

37
MCP servers can request LLM completions from connected clients that support the sampling capability. This lets your tools offload summarisation or generation to the client’s model.
48

59
For a runnable server that combines tools, logging and tasks, see:
610

7-
- [`toolWithSampleServer.ts`](../src/examples/server/toolWithSampleServer.ts)
11+
- [`toolWithSampleServer.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/toolWithSampleServer.ts)
812

913
In practice you will:
1014

@@ -22,8 +26,8 @@ Form elicitation lets a tool ask the user for additional, **non‑sensitive** in
2226

2327
Runnable example:
2428

25-
- Server: [`elicitationFormExample.ts`](../src/examples/server/elicitationFormExample.ts)
26-
- Client‑side handling: [`simpleStreamableHttp.ts`](../src/examples/client/simpleStreamableHttp.ts)
29+
- Server: [`elicitationFormExample.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/elicitationFormExample.ts)
30+
- Client‑side handling: [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/simpleStreamableHttp.ts)
2731

2832
The `simpleStreamableHttp` server also includes a `collect-user-info` tool that demonstrates how to drive elicitation from a tool and handle the response.
2933

@@ -33,8 +37,8 @@ URL elicitation is designed for sensitive data and secure web‑based flows (e.g
3337

3438
Runnable example:
3539

36-
- Server: [`elicitationUrlExample.ts`](../src/examples/server/elicitationUrlExample.ts)
37-
- Client: [`elicitationUrlExample.ts`](../src/examples/client/elicitationUrlExample.ts)
40+
- Server: [`elicitationUrlExample.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/elicitationUrlExample.ts)
41+
- Client: [`elicitationUrlExample.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/elicitationUrlExample.ts)
3842

3943
Key points:
4044

@@ -62,7 +66,7 @@ On the server you will:
6266

6367
For a runnable example that uses the in-memory store shipped with the SDK, see:
6468

65-
- [`toolWithSampleServer.ts`](../src/examples/server/toolWithSampleServer.ts)
69+
- [`toolWithSampleServer.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/toolWithSampleServer.ts)
6670
- `src/experimental/tasks/stores/in-memory.ts`
6771

6872
### Client-side usage
@@ -74,7 +78,7 @@ On the client, you use:
7478

7579
The interactive client in:
7680

77-
- [`simpleStreamableHttp.ts`](../src/examples/client/simpleStreamableHttp.ts)
81+
- [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/client/simpleStreamableHttp.ts)
7882

7983
includes commands to demonstrate calling tools that support tasks and handling their lifecycle.
8084

docs/faq.md renamed to docs/04-faq.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: FAQ
3+
---
4+
15
## FAQ
26

37
<details>

docs/client.md

Lines changed: 0 additions & 60 deletions
This file was deleted.

typedoc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"$schema": "https://typedoc.org/schema.json",
33
"entryPoints": ["src"],
44
"entryPointStrategy": "expand",
5-
"exclude": ["**/*.test.ts", "**/__*__/**", "**/examples/**", "**/integration-tests/**", "**/spec.types.ts", "**/zodTestMatrix.ts"]
5+
"exclude": ["**/*.test.ts", "**/__*__/**", "**/examples/**", "**/integration-tests/**", "**/spec.types.ts", "**/zodTestMatrix.ts"],
6+
"projectDocuments": ["docs/*.md"]
67
}

0 commit comments

Comments
 (0)