Skip to main content
ClaudeWave
qmmughal avatar
qmmughal

mcp-server-template

Ver en GitHub

Enterprise-grade TypeScript template for Model Context Protocol MCP servers with esbuild, zod, vitest, and pino.

MCP ServersRegistry oficial4 estrellas1 forksTypeScriptMITActualizado today
Install in Claude Code / Claude Desktop
Method: Manual
Claude Code CLI
git clone https://github.com/qmmughal/mcp-server-template
claude_desktop_config.json (Claude Desktop)
{
  "mcpServers": {
    "template": {
      "command": "node",
      "args": ["/path/to/mcp-server-template/dist/index.js"]
    }
  }
}
1. Run the command above in your terminal (Claude Code), or paste the JSON config into claude_desktop_config.json (Claude Desktop).
2. Replace any <placeholder> values with your API keys or paths.
3. Restart Claude. The MCP server and its tools appear automatically.
💡 Clone https://github.com/qmmughal/mcp-server-template and follow its README for install instructions.
Casos de uso

Resumen de MCP Servers

# Enterprise MCP Server Template 🚀

[![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue.svg)](https://www.typescriptlang.org/)
[![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org/)
[![Model Context Protocol](https://img.shields.io/badge/MCP-1.4.1-purple.svg)](https://modelcontextprotocol.io/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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.
aienterprisellmmcpmodel-context-protocolnodejstemplatetypescript

Lo que la gente pregunta sobre mcp-server-template

¿Qué es qmmughal/mcp-server-template?

+

qmmughal/mcp-server-template es mcp servers para el ecosistema de Claude AI. Enterprise-grade TypeScript template for Model Context Protocol MCP servers with esbuild, zod, vitest, and pino. Tiene 4 estrellas en GitHub y se actualizó por última vez today.

¿Cómo se instala mcp-server-template?

+

Puedes instalar mcp-server-template clonando el repositorio (https://github.com/qmmughal/mcp-server-template) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.

¿Es seguro usar qmmughal/mcp-server-template?

+

qmmughal/mcp-server-template aún no ha sido auditado por nuestro agente de seguridad. Revisa el repositorio original en GitHub antes de usarlo en producción.

¿Quién mantiene qmmughal/mcp-server-template?

+

qmmughal/mcp-server-template es mantenido por qmmughal. La última actividad registrada en GitHub es de today, con 0 issues abiertos.

¿Hay alternativas a mcp-server-template?

+

Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.

Despliega mcp-server-template en tu cloud

Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.

¿Mantienes este repo? Añade un badge a tu README

Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.

Featured on ClaudeWave: qmmughal/mcp-server-template
[![Featured on ClaudeWave](https://claudewave.com/api/badge/qmmughal-mcp-server-template)](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>

Más MCP Servers

Alternativas a mcp-server-template