Commit ea77ca4
committed
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 docs1 parent 090adb8 commit ea77ca4
9 files changed
+2657
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
0 commit comments