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
Copy file name to clipboardExpand all lines: README.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -189,7 +189,28 @@ server.registerTool(
189
189
);
190
190
```
191
191
192
-
## Enable Authentication (Optional)
192
+
## Authentication Modes
193
+
194
+
This template supports two modes of operation:
195
+
196
+
-**Authentication Disabled** (`ENABLE_AUTH=false` or omitted):
197
+
- No authentication required for MCP server
198
+
199
+
-**Authentication Enabled** (`ENABLE_AUTH=true`):
200
+
- OAuth 2.1 authentication and token validation enforced for all MCP server endpoints
201
+
- Suitable for secure, self-contained deployments or production servers without gateway infrastructure
202
+
203
+
Switch between modes by setting the `ENABLE_AUTH` environment variable in your `.env` file.
204
+
205
+
---
206
+
207
+
### Gateways & Proxies for MCP Security
208
+
209
+
You can deploy MCP servers behind API gateways, identity-aware proxies (IAP), or AI Gateways, recommended by the [MCP Security Best Practices](https://modelcontextprotocol.org/docs/security#mcp-proxy).
210
+
211
+
-**Pomerium**: Full MCP support, including OAuth/OIDC authentication, fine-grained access policies, not just for the server but also for at the tool level, and session management. You can run your MCP server with authentication disabled (`ENABLE_AUTH=false`) and let Pomerium handle all security. See: [Pomerium MCP Capabilities](https://docs.pomerium.com/docs/capabilities/mcp).
212
+
213
+
Have a gateway suggestion? [Create an issue](https://github.com/nickytonline/mcp-typescript-template/issues) to help expand this list!
193
214
194
215
When you need OAuth 2.1 authentication with token validation, it's just a few config lines away:
195
216
@@ -218,7 +239,6 @@ Your MCP server now requires valid OAuth tokens for all API requests.
218
239
219
240
- Public MCP servers
220
241
- Gateway-protected deployments (Pomerium, nginx with auth, etc.)
221
-
- Development and testing
222
242
- Internal corporate networks with perimeter security
0 commit comments