
onamfc/mcp-starter-template-ts
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
TypeScript starter template for building Model Context Protocol (MCP) servers, designed to help developers create secure and robust AI-agent-compatible services.
개요
A comprehensive starter template for building Model Context Protocol (MCP) servers with TypeScript. This template provides a solid foundation for developers of all skill levels to quickly bootstrap production-ready MCP projects. - : Complete type safety with comprehensive type definitions - : Robust error handling, logging, and validation - : Clean separation of concerns following SOLID principles - : Unit tests with Jest and high coverage standards - : Containerization for easy deployment - : GitHub Actions workflows included - : Extensive documentation and debugging tools - : Input validation and secure file operations - : Built-in health checks and metrics - Node.js 18.0.0 or higher - npm 8.0.0 or higher (or yarn/pnpm equivalent) This will start the server with automatic restarts when you modify source files. The server can be configured through environment variables. Create a .
README
원문 README의 일부입니다. 원문 보기.
MCP Starter Template
A comprehensive starter template for building Model Context Protocol (MCP) servers with TypeScript. This template provides a solid foundation for developers of all skill levels to quickly bootstrap production-ready MCP projects.
Features
- TypeScript First: Complete type safety with comprehensive type definitions
- Production Ready: Robust error handling, logging, and validation
- Modular Architecture: Clean separation of concerns following SOLID principles
- Comprehensive Testing: Unit tests with Jest and high coverage standards
- Docker Support: Containerization for easy deployment
- CI/CD Ready: GitHub Actions workflows included
- Developer Friendly: Extensive documentation and debugging tools
- Security Focused: Input validation and secure file operations
- Health Monitoring: Built-in health checks and metrics
Quick Start
Prerequisites
- Node.js 18.0.0 or higher
- npm 8.0.0 or higher (or yarn/pnpm equivalent)
Installation
Choose your preferred package manager:
Using npm:
git clone https://github.com/onamfc/mcp-starter-template-ts.git
cd mcp-starter-template-ts
npm install
npm run build
npm start
Using yarn:
git clone https://github.com/onamfc/mcp-starter-template-ts.git
cd mcp-starter-template-ts
yarn install
yarn build
yarn start
Using pnpm:
git clone https://github.com/onamfc/mcp-starter-template-ts.git
cd mcp-starter-template-ts
pnpm install
pnpm build
pnpm start
Development Mode
For development with hot reloading:
npm run dev
This will start the server with automatic restarts when you modify source files.
Project Structure
src/
├── server.ts # Main MCP server implementation
├── types/ # TypeScript type definitions
│ └── index.ts
├── tools/ # MCP tools implementation
│ ├── setup.ts # Tool registration and management
│ ├── calculator.ts # Mathematical calculations
│ ├── filesystem.ts # File system operations
│ ├── text-processing.ts # Text manipulation and analysis
│ └── weather.ts # Weather information (mock)
├── resources/ # MCP resources implementation
│ ├── setup.ts # Resource registration and management
│ ├── config.ts # Configuration access
│ ├── docs.ts # Documentation resource
│ └── logs.ts # Logs access
├── utils/ # Utility functions
│ ├── config.ts # Configuration management
│ ├── logger.ts # Structured logging
│ ├── validation.ts # Input validation
│ ├── errors.ts # Error handling
│ └── health.ts # Health check utilities
└── __tests__/ # Test files
├── server.test.ts
├── tools/
└── utils/
Configuration
The server can be configured through environment variables. Create a .env file in the project root:
설치
docker run -p 3000:3000 mcp-server