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
│ ├── server.ts # FastMCP server definition template
25
33
│ ├── index.ts # Barrel export + getIndexTemplate
26
34
│ ├── readme.ts # README.md template
27
-
│ ├── auth.ts # OAuth authentication template
28
-
│ └── templates.test.ts # Tests for stateful template
35
+
│ └── templates.test.ts
29
36
├── dist/ # Compiled output (generated)
30
37
├── docs/
31
38
│ └── oauth-setup.md # OAuth setup guide for various providers
@@ -66,11 +73,23 @@ npm run format:check
66
73
npm publish --access public
67
74
```
68
75
76
+
## Frameworks
77
+
78
+
### Official MCP SDK (default)
79
+
80
+
Uses the official `@modelcontextprotocol/sdk` package with Express.js for full control.
81
+
82
+
### FastMCP
83
+
84
+
Uses [FastMCP](https://github.com/punkpeye/fastmcp), a TypeScript framework built on top of the official SDK that provides a simpler, more intuitive API.
85
+
69
86
## Templates
70
87
71
-
### streamable-http (stateless, default)
88
+
### SDK Templates
89
+
90
+
#### sdk/stateless
72
91
73
-
A stateless streamable HTTP MCP server. Each request creates a new transport and server instance.
92
+
A stateless streamable HTTP MCP server using the official SDK. Each request creates a new transport and server instance.
74
93
75
94
Features:
76
95
- Express.js with `StreamableHTTPServerTransport`
@@ -81,9 +100,9 @@ Features:
81
100
- TypeScript configuration
82
101
- Environment variable support for PORT
83
102
84
-
###stateful-streamable-http
103
+
#### sdk/stateful
85
104
86
-
A stateful streamable HTTP MCP server with session management.
105
+
A stateful streamable HTTP MCP server with session management using the official SDK.
87
106
88
107
Features:
89
108
- Session tracking via `mcp-session-id` header
@@ -94,7 +113,7 @@ Features:
94
113
- Graceful shutdown with transport cleanup
95
114
-**Optional OAuth authentication** (enabled via CLI prompt)
96
115
97
-
#### OAuth Option
116
+
#####OAuth Option
98
117
99
118
When OAuth is enabled for the stateful template:
100
119
- Generates `src/auth.ts` with JWKS/JWT-based OAuth middleware
@@ -105,17 +124,26 @@ When OAuth is enabled for the stateful template:
105
124
- Server startup validation ensures OAuth provider is reachable
106
125
- See [docs/oauth-setup.md](docs/oauth-setup.md) for provider-specific setup instructions
107
126
108
-
Generated project structure (same for both templates, +auth.ts when OAuth enabled):
127
+
### FastMCP Templates
128
+
129
+
A single template that supports both stateless and stateful modes via the `stateless` configuration option. Uses the FastMCP framework for simpler server setup.
130
+
131
+
Features:
132
+
- Declarative tool/prompt/resource registration
133
+
- Built-in HTTP server (no Express setup required)
134
+
- Supports both stateless and stateful modes via config
135
+
- Example prompt, tool, and resource
136
+
137
+
Generated project structure (same for all templates, +auth.ts when OAuth enabled for SDK stateful):
109
138
```
110
139
{project-name}/
111
140
├── src/
112
141
│ ├── server.ts # MCP server with tools/prompts/resources
113
-
│ ├── index.ts # Express app and transport setup
114
-
│ └── auth.ts # OAuth middleware (only when OAuth enabled)
-**MCP Inspector** — built-in debugging with `npm run inspect`
18
19
19
-
## Templates
20
+
## Frameworks
21
+
22
+
| Framework | Description |
23
+
|-----------|-------------|
24
+
|**Official MCP SDK** (default) | Full control with Express.js, supports OAuth |
25
+
|**FastMCP**| Simpler API with less boilerplate |
26
+
27
+
### FastMCP
28
+
29
+
[FastMCP](https://github.com/punkpeye/fastmcp) is a TypeScript framework built on top of the official MCP SDK that provides a simpler, more intuitive API for building MCP servers.
30
+
31
+
```typescript
32
+
import { FastMCP } from"fastmcp";
33
+
import { z } from"zod";
34
+
35
+
const server =newFastMCP({ name: "My Server", version: "1.0.0" });
0 commit comments