MCP Server Template 88c68a0c

MCPAI代理

提供方 masseater

AI代理 未标注 会话登录 社区 / 第三方 Claude DesktopClaude

一个基于TypeScript的MCP服务器模板,支持stdio和HTTP传输,提供可扩展的工具架构和生产就绪的最佳实践。

一句话选型结论

按资料字段整理

MCP Server Template 88c68a0c 属于AI代理类 MCP 服务器,传输方式未标注,会话登录,可直接接入 Claude Desktop、Claude,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类AI代理 传输方式未标注 鉴权会话登录 部署方式未标注
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

AI代理
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

MCP协议TypeScript本地部署服务器模板开发工具生产就绪

安装与配置

未标注 会话登录
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
给代理接外部能力

让代理在任务中途调用搜索、数据库等真实工具。

多步任务编排

把一串操作拆成步骤,由代理按顺序执行。

自动化重复流程

把固定流程交给代理跑,减少手工操作。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 已适配 Claude Desktop、Claude,换客户端不用重新研究配置。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 使用前要准备好会话登录对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
MCP Server Template 88c68a0c当前 未标注 未标注 未标注 无 2026-05-17
Filesystem 560c4363 13 未标注 本地部署 无 2026-05-17
Server Everything (everything) 11 stdio · 本地进程 本地部署 有 2026-05-17
Time 7365cb6d 2 SSE · 服务端推送 远程部署 有 2026-05-18
Everything Claude Code 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Openmemory 557e1585 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

AI代理
字段来自项目仓库与公开索引,中文说明由本站标注
提供方masseater上游标注的维护方 masseater
分类AI代理本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式会话登录远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

12.4 KB
来自项目仓库与上游目录的原文,未做删改

MCP Server Template

A production-ready template for building Model Context Protocol (MCP) servers with TypeScript. This template provides a solid foundation with support for both stdio and HTTP transports, extensible tool architecture, and best practices.

Features

  • ✅ Dual Transport Support: stdio (default) and HTTP transports
  • ✅ Type-Safe: Full TypeScript support with strict mode enabled
  • ✅ Extensible Architecture: Base classes for easy tool creation
  • ✅ Production-Ready: Logging, error handling, and configuration management
  • ✅ CI/CD: GitHub Actions for automated testing and npm publishing
  • ✅ Automated Dependency Updates: Dependabot configuration with auto-merge
  • ✅ Developer-Friendly: Hot reload, ESLint, and comprehensive tooling
  • ✅ Sample Tools: Echo and Ping tools as examples

Prerequisites

  • Node.js >= 22.10.0
  • pnpm >= 10.19.0

Quick Start

1. Use this template

Click "Use this template" on GitHub or clone this repository:```bash
git clone https://github.com/yourusername/mcp-server-template.git
cd mcp-server-template


### 2. Install dependencies```bash
pnpm install

3. Run in development mode```bash

stdio transport (default)

pnpm run dev

HTTP transport (with hot reload)

pnpm run dev:http


### 4. Build for production```bash
pnpm run build

5. Run in production```bash

stdio transport

pnpm run start:stdio

HTTP transport

pnpm run start:http


## Project Structure```
mcp-server-template/
├── src/
│   ├── server/
│   │   ├── mcp-server.ts       # Main MCP server implementation
│   │   └── tool-registry.ts    # Tool registration and management
│   ├── tools/
│   │   ├── base/
│   │   │   ├── base-tool.ts    # Base class for all tools
│   │   │   └── raw-tool.ts     # Base class for tools with raw option
│   │   ├── implementations/
│   │   │   ├── echo-tool.ts    # Example: Echo tool
│   │   │   └── ping-tool.ts    # Example: Ping tool
│   │   └── base-tool.ts        # Tool utilities
│   ├── types/
│   │   └── index.ts            # Type definitions
│   ├── config/
│   │   └── index.ts            # Configuration management
│   ├── utils/
│   │   └── logger.ts           # Logging utilities
│   └── index.ts                # Entry point
├── dist/                       # Compiled output (generated)
├── logs/                       # Log files (generated)
├── package.json
├── tsconfig.json
├── tsup.config.ts
└── README.md

Creating Your Own Tools

Basic Tool Example

Create a new file in src/tools/implementations/:```typescript
import { z } from "zod";
import { BaseTool } from "../base/base-tool.js";
import type { MCPToolResponse } from "../../types/index.js";

type MyToolArgs = {
input: string;
};

export class MyTool extends BaseTool<MyToolArgs> {
readonly name = "my_tool";
readonly description = "Description of what my tool does";

getInputSchema() {
return z.object({
input: z.string().describe("Input parameter description"),
});
}

async execute(args: MyToolArgs): Promise<MCPToolResponse<YourDataType>> {
// Your tool logic here
const result = await someOperation(args.input);

return {
  success: true,
  message: &quot;Operation completed successfully&quot;,
  data: result,
};

}
}


### Register Your Tool

Add your tool to `src/server/tool-registry.ts`:```typescript
import { MyTool } from &quot;../tools/implementations/my-tool.js&quot;;

// Add to Tool type
type Tool = EchoTool | PingTool | MyTool;

// Add to tools array in initialize()
const tools: Tool[] = [
  new EchoTool(context),
  new PingTool(context),
  new MyTool(context), // Add your tool
];

Available Scripts```bash

Development

pnpm run dev # Start with stdio transport (hot reload)
pnpm run dev:http # Start with HTTP transport (hot reload)

Production

pnpm run build # Build for production
pnpm run start:stdio # Run built server with stdio
pnpm run start:http # Run built server with HTTP

Code Quality

pnpm run type-check # Run TypeScript type checking
pnpm run lint # Run ESLint
pnpm run lint:fix # Fix ESLint errors automatically

Testing

pnpm run test # Run tests once
pnpm run test:watch # Run tests in watch mode
pnpm run test:coverage # Run tests with coverage

Maintenance

pnpm run clean # Remove dist directory
pnpm run knip # Detect unused files/dependencies
pnpm run knip:fix # Auto-fix knip issues


## Configuration

Configuration is managed through environment variables and can be extended in `src/config/index.ts`:```typescript
export type ServerConfig = {
  server: {
    name: string;
    version: string;
  };
  mcp: {
    maxResponseSize: number;
    defaultPageSize: number;
  };
  logging: {
    level: string;
    enableDebugConsole: boolean;
  };
}

Environment Variables

  • LOG_LEVEL: Logging level (error · warn · info · debug, default: info)
  • DEBUG: Enable debug console output (true|false, default: false)
  • PORT: HTTP server port (default: 3000)

Transport Modes

stdio Transport (Default)

Used for direct integration with MCP clients like Claude Desktop:```bash
pnpm run dev # Development
pnpm run start:stdio # Production


### HTTP Transport

Used for HTTP-based clients or debugging:```bash
pnpm run dev:http     # Development (port 3000)
pnpm run start:http   # Production (port 3000)

Endpoints:
- GET /health - Health check endpoint
- POST /mcp - MCP Streamable HTTP endpoint

Architecture

Tool System

The template uses a Template Method Pattern for tools:

  1. BaseTool: Abstract base class for all tools
    - Handles error catching and response formatting
    - Provides consistent tool definition interface

  2. RawTool: Extended base for tools with raw option
    - Supports minimal vs full response modes
    - Automatically handles raw parameter extraction

Error Handling

All tools automatically:
- Catch and log errors
- Return user-friendly error messages
- Set isError: true flag for error responses
- Never expose sensitive information

Example Tools

Echo Tool

Simple tool that echoes back the input message:```bash

Test with HTTP transport

curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{
"method": "tools/call",
"params": {
"name": "echo",
"arguments": {
"message": "Hello, MCP!"
}
}
}'


### Ping Tool

Health check tool that returns server status:```bash
curl -X POST http://localhost:3000/mcp \
  -H &quot;Content-Type: application/json&quot; \
  -d &#x27;{
    &quot;method&quot;: &quot;tools/call&quot;,
    &quot;params&quot;: {
      &quot;name&quot;: &quot;ping&quot;,
      &quot;arguments&quot;: {}
    }
  }&#x27;

Logging

Logs are written to:
- logs/mcp-server-{timestamp}.log (always)
- Console output (HTTP transport only)

Log levels: error, warn, info, debug

Best Practices

  1. Tool Naming: Use snake_case for tool names
  2. Descriptions: Write clear, concise tool descriptions
  3. Input Validation: Always use Zod schemas for input validation
  4. Error Messages: Return user-friendly error messages
  5. Response Format: Use MCPToolResponse for consistent responses
  6. Context: Add shared resources to ToolContext type

Extending the Template

Adding API Clients

  1. Create client in src/clients/
  2. Add to ToolContext type in src/tools/base-tool.ts
  3. Initialize in src/server/tool-registry.ts
  4. Use in your tools via this.context

Adding Response Formatters

  1. Create formatter in src/formatters/
  2. Add to context or import directly in tools
  3. Use RawTool base class for tools needing optimization

Publishing to npm

This template includes GitHub Actions workflows for automated publishing to npm.

Setup

  1. Create npm account and get access token:
    - Go to https://www.npmjs.com/
    - Create an account or sign in
    - Generate an access token: Settings → Access Tokens → Generate New Token (Automation)

  2. Add npm token to GitHub secrets:
    - Go to your GitHub repository → Settings → Secrets and variables → Actions
    - Click "New repository secret"
    - Name: NPM_TOKEN
    - Value: Your npm access token

  3. Update package.json:json { &quot;name&quot;: &quot;your-package-name&quot;, &quot;version&quot;: &quot;0.1.0&quot;, &quot;author&quot;: &quot;Your Name&quot;, &quot;repository&quot;: { &quot;type&quot;: &quot;git&quot;, &quot;url&quot;: &quot;https://github.com/yourusername/your-repo.git&quot; } }

Publishing a New Version

The template includes two GitHub Actions workflows:

1. CI Workflow (.github/workflows/ci.yml)

Automatically runs on every push and pull request:
- Runs linter (ESLint)
- Runs type checking
- Runs tests
- Runs knip (unused code detection)
- Builds the project

2. Publish Workflow (.github/workflows/publish.yml)

Manual workflow for publishing to npm:

  1. Go to your GitHub repository → Actions tab
  2. Select "Publish to npm" workflow
  3. Click "Run workflow"
  4. Enter the version number (e.g., 1.0.1, 1.1.0, 2.0.0)
  5. Click "Run workflow"

The workflow will:
- ✅ Run all tests
- ✅ Run linter
- ✅ Run type check
- ✅ Update version in package.json
- ✅ Build the project
- ✅ Publish to npm
- ✅ Create git tag and commit
- ✅ Push tag to GitHub

Manual Publishing (Alternative)

You can also publish manually:```bash

Login to npm

npm login

Update version

npm version patch # or minor, major

Build

pnpm run build

Publish

npm publish

Push git tag

git push origin main --tags


### Version Guidelines

Follow Semantic Versioning:
- **MAJOR** (1.0.0 → 2.0.0): Breaking changes
- **MINOR** (1.0.0 → 1.1.0): New features (backward compatible)
- **PATCH** (1.0.0 → 1.0.1): Bug fixes (backward compatible)

## Dependency Management

This template includes automated dependency management with Dependabot.

### Dependabot Configuration

The `.github/dependabot.yml` configuration:

1. **npm Dependencies** (Weekly updates on Mondays):
   - **All updates grouped into a single PR** (major, minor, patch)
   - Creates one consolidated PR per week for npm dependencies
   - Reduces PR noise while keeping dependencies up-to-date

2. **GitHub Actions** (Weekly updates on Mondays):
   - Keeps workflow actions up to date
   - Groups all action updates together

3. **Auto-merge** (Optional):
   - Minor and patch updates can auto-merge after CI passes
   - Major updates require manual review (with warning comment)
   - Configured via `.github/workflows/dependabot-auto-merge.yml`

### How It Works

1. **Automated PRs**: Dependabot creates PRs every Monday at 9:00 AM (Asia/Tokyo)
   - 1 PR for all npm dependencies (major + minor + patch)
   - 1 PR for GitHub Actions updates
2. **CI Validation**: All PRs run through CI workflow (lint, test, build)
3. **Auto-merge** (Optional):
   - Minor/patch updates merge automatically after CI passes
   - Major updates get a warning comment and require manual review
4. **Review Changes**: Check the PR diff and test results before merging major updates

### Customization

Edit `.github/dependabot.yml` to customize:

**Change update schedule:**```yaml
schedule:
  interval: &quot;weekly&quot;  # Can be: daily, weekly, monthly
  day: &quot;monday&quot;       # Day of the week
  time: &quot;09:00&quot;       # Time of day
  timezone: &quot;Asia/Tokyo&quot;

Update reviewers/assignees:```yaml
reviewers:
- "your-github-username"
assignees:
- "your-github-username"


**Separate major/minor/patch updates (if preferred):**

If you want major updates in separate PRs, modify the `groups` section:```yaml
groups:
  dependencies:
    patterns:
      - &quot;*&quot;
    update-types:
      - &quot;minor&quot;
      - &quot;patch&quot;
  # Add another package-ecosystem entry for major updates

Disable Auto-merge

If you prefer manual merging, delete .github/workflows/dependabot-auto-merge.yml:bash rm .github/workflows/dependabot-auto-merge.yml git add .github/workflows/dependabot-auto-merge.yml git commit -m &quot;chore: disable dependabot auto-merge&quot; git push

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Resources

  • Model Context Protocol Documentation
  • MCP TypeScript SDK
  • Zod Documentation

Support

For issues and questions:
- GitHub Issues: https://github.com/yourusername/mcp-server-template/issues
- MCP Discord: https://discord.gg/modelcontextprotocol


Built with ❤️ using TypeScript and the Model Context Protocol

常见问题

6 问
答案由本站依据条目字段整理,不引用上游原文
MCP Server Template 88c68a0c 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

MCP Server Template 88c68a0c 怎么在 Claude Desktop、Claude 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

MCP Server Template 88c68a0c 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

MCP Server Template 88c68a0c 需要 API Key 吗?

资料标注需要会话登录认证,使用前准备好对应凭据,并按最小权限配置。

MCP Server Template 88c68a0c 支持哪些客户端?

资料标注支持 Claude Desktop、Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

MCP Server Template 88c68a0c 能提供哪些能力?

资料显示能力标签包括 服务器模板、开发工具、TypeScript、Claude、生产就绪。具体工具清单以官方文档为准。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。