A TypeScript starter template for building Model Context Protocol (MCP) servers. Provides project structure, code generators, and conventions so you can focus on building tools, resources, and prompts.
- ⚙️ TypeScript-first setup
- 🧩 Stdio-based MCP server
- 🛠 Generators for tools, prompts, and resources
- 🧹 Linting, formatting and type checking out of the box
- 📁 Clear, MCP-aligned project structure
The Model Context Protocol is an open standard that enables LLM applications to connect to external data sources and tools. MCP servers expose three primitives:
- Tools — Actions the LLM can execute (e.g., query a database, call an API)
- Resources — Read-only data the LLM can access (e.g., database schema, config files)
- Prompts — Reusable templates with arguments (e.g., "design a table for X")
| Category | Technology |
|---|---|
| Runtime | Node.js |
| Language | TypeScript (strict mode) |
| Linting & Formatting | Biome |
| Schema Validation | Zod |
| MCP SDK | @modelcontextprotocol/sdk |
nvm use # Use the correct Node version
npm install # Install dependencies
npm run build # Build the projectThe compiled server will be available at dist/server.js.
src/
├── server.ts # Server entry point
├── lib/ # Shared utilities
├── prompts/ # MCP prompt definitions
├── resources/ # MCP resource definitions
└── tools/ # MCP tool implementations
The template includes working examples to demonstrate patterns:
| Prompt | Description |
|---|---|
design-table |
Takes a data description and generates PostgreSQL table design with example usage patterns |
| Resource | URI | Description |
|---|---|---|
| Schema | postgres://schema |
Returns complete database schema with tables, columns, types, and constraints |
| Stats | postgres://stats |
Returns database statistics: version, size, connections, and uptime |
| Tool | Description |
|---|---|
sql-query-executor |
Execute SQL queries against a PostgreSQL database |
Scaffold new MCP components:
npm run generate # Show all generator options
npm run generate:prompt # Create a new prompt
npm run generate:resource # Create a new resource
npm run generate:tool # Create a new toolGenerators create the file and auto-register it with the server.
| Command | Description |
|---|---|
npm run build |
Compile TypeScript to dist/ |
npm run lint |
Check for linting and type errors |
npm run lint:fix |
Auto-fix linting issues |
npm run format |
Format code with Biome |
npm run generate |
Scaffold new MCP components |
npm run generate:prompt |
Scaffold a new prompt |
npm run generate:resource |
Scaffold a new resource |
npm run generate:tool |
Scaffold a new tool |
Some MCP features require specific client support. As of January 2026, most clients do not support:
- Elicitation — Interactive input requests from the server to the user
- Sampling — Server-initiated LLM completions
Check the MCP Clients documentation to see which features your client supports. As these features gain wider support, the examples in this template will be updated to demonstrate more advanced use cases.
MIT