{
  "markdown": "# Enterprise MCP Server Template 🚀\n\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue.svg)](https://www.typescriptlang.org/)\n[![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org/)\n[![Model Context Protocol](https://img.shields.io/badge/MCP-1.4.1-purple.svg)](https://modelcontextprotocol.io/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA 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.\n\n## 📖 About\n\nThe **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.\n\n### Key Features\n- **Strict TypeScript**: Modern ECMAScript targets with rigorous type safety.\n- **Zod Validation**: Runtime schema validation for tool inputs and environment variables, ensuring your server never crashes from malformed AI payloads.\n- **Fast Bundling (esbuild)**: Compiles the entire server into a single, optimized executable (`dist/index.js`), eliminating the need to deploy `node_modules`.\n- **Safe Structured Logging**: Pre-configured `pino` logger writing safely to `stderr`, preserving the integrity of the `stdout` JSON-RPC transport required by MCP.\n- **Modular Architecture**: Clean separation of Tools, Resources, Prompts, and Services.\n- **Vitest Integration**: Blazing fast unit testing out of the box.\n\n## 🚀 Getting Started\n\n### 1. Installation\n\nClone the repository and install dependencies:\n\n```bash\ngit clone https://github.com/qmmughal/mcp-server-template.git\ncd mcp-server-template\nnpm install\n```\n\n### 2. Configuration\n\nCopy the example environment file and configure your variables:\n\n```bash\ncp .env.example .env\n```\n\n### 3. Development Workflow\n\nStart the server in watch mode for local development:\n```bash\nnpm run dev\n```\n\nRun the test suite:\n```bash\nnpm test\n```\n\nVerify typings:\n```bash\nnpm run typecheck\n```\n\n### 4. Production Build\n\nBundle the server into a single, optimized executable:\n```bash\nnpm run build\n```\n*The output will be generated at `dist/index.js`.*\n\n## 🔌 Connecting to an MCP Client\n\n### Claude Desktop\nTo 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):\n\n```json\n{\n  \"mcpServers\": {\n    \"enterprise-template-server\": {\n      \"command\": \"node\",\n      \"args\": [\"/absolute/path/to/mcp-server-template/dist/index.js\"],\n      \"env\": {\n        \"LOG_LEVEL\": \"info\",\n        \"EXAMPLE_API_KEY\": \"your_api_key_here\"\n      }\n    }\n  }\n}\n```\n\n### Cursor\nIn Cursor, navigate to **Settings -> Features -> MCP** and add a new MCP server:\n- **Type**: `command`\n- **Command**: `node /absolute/path/to/mcp-server-template/dist/index.js`\n\n## 🏗️ Architecture Overview\n\n- `src/index.ts`: Application entrypoint, capability registration, and stdio connection setup.\n- `src/tools/`: Definitions and JSON schemas for MCP Tools (actions the AI can take).\n- `src/resources/`: Dynamic resources via URI templating (data the AI can read).\n- `src/prompts/`: Reusable agent prompt templates.\n- `src/services/`: Core business logic, keeping protocol handlers thin and testable.\n- `src/utils/errors.ts`: Standardized error handling aligned with MCP error codes.\n\n## 📦 Publishing & Registry\n\n`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:\n\n```bash\ngit tag v1.0.0\ngit push origin v1.0.0\n```\n\nThe 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.\n\n## 🤝 Contributing\nContributions, issues, and feature requests are welcome! Feel free to check the issues page.\n\n## 📝 License\nThis project is [MIT](LICENSE) licensed.\n",
  "bytes": 4407,
  "sha": "1cf519db9ec6b5b16ec54af2afde535a22c130a097412e70810b561a3b750ef9",
  "repo_slug": "qmmughal/mcp-server-template",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_qmmughal_mcp_server_template_fbaf3ec6/readme"
}