Skip to content

Commit ea77ca4

Browse files
docs: Add TypeScript SDK reference documentation
## Summary Complete reference documentation for the TypeScript MCP Server SDK (arcade-mcp), providing feature parity with the Python SDK while using TypeScript-idiomatic patterns. ## New Files - `typescript/overview/` - MCPApp API, tool registration, Zod 4 schemas - `typescript/types/` - ToolContext, ContentItem, protocol types, schema utilities - `typescript/errors/` - Complete error hierarchy with constructor signatures - `typescript/middleware/` - MCP middleware and HTTP hooks via app.elysia - `typescript/server/` - Low-level MCPServer class for custom transports - `typescript/transports/` - stdio and HTTP transport modes - `typescript/settings/` - MCPSettings, environment variables, configuration ## Design Decisions ### Options Object Pattern TypeScript uses options objects for error constructors (vs Python positional args): ```typescript throw new ContextRequiredToolError('Message', { additionalPromptContent: 'Please specify...', // required developerMessage: 'debug info', // optional }); ``` ### HTTP Hooks via app.elysia Clean separation - MCPApp handles MCP, app.elysia handles HTTP: ```typescript app.elysia.onRequest(({ request }) => { ... }); ``` ### Runtime Tool Registration materializeTool() creates tool objects for runtime addition: ```typescript const tool = materializeTool({ name, input, handler }); await app.tools.add(tool); ``` ## Stack Bun 1.3.x + Elysia 1.3.x + Zod 4.x + TypeScript 5.9.x ## Related - Python SDK docs: /references/mcp/python/ - Depends on: #XX (Python error hierarchy improvements) - for consistent error docs
1 parent 090adb8 commit ea77ca4

File tree

9 files changed

+2657
-0
lines changed

9 files changed

+2657
-0
lines changed

app/en/references/mcp/_meta.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ const meta: MetaRecord = {
1111
python: {
1212
title: "Python",
1313
},
14+
typescript: {
15+
title: "TypeScript",
16+
},
1417
telemetry: {
1518
title: "Telemetry",
1619
},
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import type { MetaRecord } from "nextra";
2+
3+
const meta: MetaRecord = {
4+
"*": {
5+
theme: {
6+
breadcrumb: true,
7+
layout: "full",
8+
toc: true,
9+
copyPage: true,
10+
},
11+
},
12+
overview: {
13+
title: "Overview",
14+
},
15+
transports: {
16+
title: "Transports",
17+
},
18+
server: {
19+
title: "Server",
20+
},
21+
middleware: {
22+
title: "Middleware",
23+
},
24+
types: {
25+
title: "Types",
26+
},
27+
errors: {
28+
title: "Errors",
29+
},
30+
settings: {
31+
title: "Settings",
32+
},
33+
};
34+
35+
export default meta;

0 commit comments

Comments
 (0)