
一个用于构建模型上下文协议(MCP)服务器的简易 TypeScript 起始模板。
概览
一个简约的、生产准备的 TypeScript 起始模板,用于构建模型上下文协议(MCP)服务器。 模型上下文协议(MCP)是一种开放协议,规范了人工智能应用如何连接数据源和工具。可以把它看作“USB-C的人工智能”——一个通用标准,允许任何人工智能模型通过一致的界面连接任何数据源或工具。 这个入门模板提供了:- ✅ 快速引导你 - ✅ 工具、资源和提示 - ✅ 严格输入 - ✅ 根据你的项目调整 - ✅ (回声工具)来演示模式 无论你是在构建数据库、API、文件系统还是定制业务工具的集成,这个模板都能帮助你创建可被任何兼容MCP客户端(如Claude Desktop、IDE或自定义应用)使用的MCP服务器。
概述(AI 翻译)
一个简约的、生产准备的 TypeScript 起始模板,用于构建模型上下文协议(MCP)服务器。
🎯 动机
模型上下文协议(MCP)是一种开放协议,规范了人工智能应用如何连接数据源和工具。可以把它看作“USB-C的人工智能”——一个通用标准,允许任何人工智能模型通过一致的界面连接任何数据源或工具。
这个入门模板提供了:
- ✅ 简约模板帮助你快速入门
- ✅ 工具、资源和提示词的自动加载架构
- ✅ TypeScript 最佳实践 严格类型
- ✅ 可随项目扩展的生产准备结构
- ✅ 工作示例(回声工具)用于演示模式
无论你是在构建数据库、API、文件系统还是定制业务工具的集成,这个模板都能帮助你创建可被任何兼容MCP客户端(如Claude Desktop、IDE或自定义应用)使用的MCP服务器。
📋 目录
- 特色
- 先决条件
- 安装
- 快速入门
- 交通方式
- Stdio模式
- HTTP 模式
- 环境变量
- 配置示例
- Docker 支持
- 项目结构
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MCP Server Starter (TypeScript)
🎯 Motivation
The Model Context Protocol (MCP) is an open protocol that standardizes how AI applications connect to data sources and tools. Think of it as “USB-C for AI” - a universal standard that allows any AI model to connect with any data source or tool through a consistent interface.
graph LR
A[AI] |MCP| B[Server]
B C[Tools]
B D[Resources]
This starter template provides:
- ✅ Minimal boilerplate to get you started quickly
- ✅ Auto-loading architecture for tools, resources, and prompts
- ✅ TypeScript best practices with strict typing
- ✅ Production-ready structure that scales with your project
- ✅ Working example (echo tool) to demonstrate the pattern
Whether you’re building integrations for databases, APIs, file systems, or custom business tools, this template helps you create MCP servers that can be used by any MCP-compatible client (like Claude Desktop, IDEs, or custom applications).
📋 Table of Contents
- Features
- Prerequisites
- Installation
- Quick Start
- Transport Modes
- Docker Support
- Project Structure
- Development Guide
- Testing with MCP Inspector
- Configuration
- Commands
- Integration
- Contributing
- License
✨ Features
- 🚀 Auto-loading Module System - Drop new tools, resources, or prompts into their directories and they’re automatically registered
- 🛠️ TypeScript First - Full type safety with strict TypeScript configuration
- 📦 Minimal Dependencies - Only essential packages included
- 🧪 Built-in Testing - Uses Node.js native test runner
- 🔍 MCP Inspector Support - Test your server with the official MCP Inspector
- 📝 Extensible Architecture - Clear patterns for adding new capabilities
安装
docker run -p 3000:3000 ghcr.io/alexanderopalic/mcp-server-starter-ts:latest配置
{
"mcpServers": {
"mcp-server-starter": {
"command": "node",
"args": ["/path/to/mcp-server-starter/build/index.js"]
}
}
}