Enterprise-grade TypeScript template for Model Context Protocol MCP servers with esbuild, zod, vitest, and pino.
git clone https://github.com/qmmughal/mcp-server-template{
"mcpServers": {
"template": {
"command": "node",
"args": ["/path/to/mcp-server-template/dist/index.js"]
}
}
}MCP Servers overview
# Enterprise MCP Server Template 🚀
[](https://www.typescriptlang.org/)
[](https://nodejs.org/)
[](https://modelcontextprotocol.io/)
[](https://opensource.org/licenses/MIT)
A production-ready, enterprise-grade template for building **Model Context Protocol (MCP)** servers in TypeScript and Node.js. Designed for scalability, type safety, and seamless integration with AI agents like Claude Desktop and Cursor.
## 📖 About
The **Model Context Protocol (MCP)** standardizes how AI models interact with local and remote resources. This template provides a robust foundation for building your own custom MCP servers, eliminating boilerplate and enforcing best practices.
### Key Features
- **Strict TypeScript**: Modern ECMAScript targets with rigorous type safety.
- **Zod Validation**: Runtime schema validation for tool inputs and environment variables, ensuring your server never crashes from malformed AI payloads.
- **Fast Bundling (esbuild)**: Compiles the entire server into a single, optimized executable (`dist/index.js`), eliminating the need to deploy `node_modules`.
- **Safe Structured Logging**: Pre-configured `pino` logger writing safely to `stderr`, preserving the integrity of the `stdout` JSON-RPC transport required by MCP.
- **Modular Architecture**: Clean separation of Tools, Resources, Prompts, and Services.
- **Vitest Integration**: Blazing fast unit testing out of the box.
## 🚀 Getting Started
### 1. Installation
Clone the repository and install dependencies:
```bash
git clone https://github.com/qmmughal/mcp-server-template.git
cd mcp-server-template
npm install
```
### 2. Configuration
Copy the example environment file and configure your variables:
```bash
cp .env.example .env
```
### 3. Development Workflow
Start the server in watch mode for local development:
```bash
npm run dev
```
Run the test suite:
```bash
npm test
```
Verify typings:
```bash
npm run typecheck
```
### 4. Production Build
Bundle the server into a single, optimized executable:
```bash
npm run build
```
*The output will be generated at `dist/index.js`.*
## 🔌 Connecting to an MCP Client
### Claude Desktop
To connect this server to the Claude Desktop app, edit your Claude configuration file (usually found at `%APPDATA%\Claude\claude_desktop_config.json` on Windows or `~/Library/Application Support/Claude/claude_desktop_config.json` on Mac):
```json
{
"mcpServers": {
"enterprise-template-server": {
"command": "node",
"args": ["/absolute/path/to/mcp-server-template/dist/index.js"],
"env": {
"LOG_LEVEL": "info",
"EXAMPLE_API_KEY": "your_api_key_here"
}
}
}
}
```
### Cursor
In Cursor, navigate to **Settings -> Features -> MCP** and add a new MCP server:
- **Type**: `command`
- **Command**: `node /absolute/path/to/mcp-server-template/dist/index.js`
## 🏗️ Architecture Overview
- `src/index.ts`: Application entrypoint, capability registration, and stdio connection setup.
- `src/tools/`: Definitions and JSON schemas for MCP Tools (actions the AI can take).
- `src/resources/`: Dynamic resources via URI templating (data the AI can read).
- `src/prompts/`: Reusable agent prompt templates.
- `src/services/`: Core business logic, keeping protocol handlers thin and testable.
- `src/utils/errors.ts`: Standardized error handling aligned with MCP error codes.
## 📦 Publishing & Registry
`package.json` is publish-ready (scoped name `@qmmughal/mcp-server-template`, license, repository, keywords), and `server.json` + `.github/workflows/publish-mcp.yml` are wired up to publish to both **npm** and the **[MCP Registry](https://modelcontextprotocol.io/registry)** automatically whenever a `v*` tag is pushed:
```bash
git tag v1.0.0
git push origin v1.0.0
```
The workflow needs one repo secret before it can run: `NPM_TOKEN` (an npm automation token with publish rights to the `@qmmughal` scope). MCP Registry auth uses GitHub OIDC, so no extra secret is needed there.
## 🤝 Contributing
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
## 📝 License
This project is [MIT](LICENSE) licensed.
What people ask about mcp-server-template
What is qmmughal/mcp-server-template?
+
qmmughal/mcp-server-template is mcp servers for the Claude AI ecosystem. Enterprise-grade TypeScript template for Model Context Protocol MCP servers with esbuild, zod, vitest, and pino. It has 4 GitHub stars and was last updated today.
How do I install mcp-server-template?
+
You can install mcp-server-template by cloning the repository (https://github.com/qmmughal/mcp-server-template) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is qmmughal/mcp-server-template safe to use?
+
qmmughal/mcp-server-template has not been audited yet by our security agent. Review the original repository on GitHub before using it in production.
Who maintains qmmughal/mcp-server-template?
+
qmmughal/mcp-server-template is maintained by qmmughal. The last recorded GitHub activity is from today, with 0 open issues.
Are there alternatives to mcp-server-template?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy mcp-server-template to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/qmmughal-mcp-server-template)<a href="https://claudewave.com/repo/qmmughal-mcp-server-template"><img src="https://claudewave.com/api/badge/qmmughal-mcp-server-template" alt="Featured on ClaudeWave: qmmughal/mcp-server-template" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
The fastest path to AI-powered full stack observability, even for lean teams.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!