You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/01-server.md
+27-23Lines changed: 27 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,7 @@
1
+
---
2
+
title: Server
3
+
---
4
+
1
5
## Server overview
2
6
3
7
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
8
12
9
13
For a complete, runnable example server, see:
10
14
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
16
20
17
21
## Transports
18
22
@@ -27,9 +31,9 @@ Streamable HTTP is the modern, fully featured transport. It supports:
-[`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
-[`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
33
37
34
38
See the MCP spec for full transport details: `https://modelcontextprotocol.io/specification/2025-11-25/basic/transports`
- Stateful with resumability: [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/examples/server/simpleStreamableHttp.ts)
47
51
48
52
### Deprecated HTTP + SSE
49
53
50
54
The older HTTP+SSE transport (protocol version 2024‑11‑05) is supported only for backwards compatibility. New implementations should prefer Streamable HTTP.
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).
63
67
2. Remove features you do not need (tasks, advanced logging, OAuth, etc.).
64
68
3. Register your own tools, resources and prompts.
65
69
@@ -125,8 +129,8 @@ server.registerTool(
125
129
126
130
This snippet is illustrative only; for runnable servers that expose tools, see:
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.
197
201
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.
199
203
200
204
### Display names and metadata
201
205
@@ -205,21 +209,21 @@ Tools, resources and prompts support a `title` field for human‑readable names.
205
209
206
210
## Multi‑node deployment patterns
207
211
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):
209
213
210
214
- Stateless mode (any node can handle any request)
211
215
- Persistent storage mode (shared database for session state)
212
216
- Local state with message routing (message queue + pub/sub)
213
217
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.
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.
- 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.
Copy file name to clipboardExpand all lines: docs/03-capabilities.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,14 @@
1
+
---
2
+
title: Capabilities
3
+
---
4
+
1
5
## Sampling
2
6
3
7
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.
4
8
5
9
For a runnable server that combines tools, logging and tasks, see:
The `simpleStreamableHttp` server also includes a `collect-user-info` tool that demonstrates how to drive elicitation from a tool and handle the response.
29
33
@@ -33,8 +37,8 @@ URL elicitation is designed for sensitive data and secure web‑based flows (e.g
0 commit comments