SM

stevenstavrakis/mcp-starter-template

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

47 stars 13 forks 质量 56 趋势 0MIT

stevenstavrakis/mcp-starter-template 是从 https://github.com/stevenstavrakis/mcp-starter-template. 导入的一个 MCP 服务器候选。

概览

stevenstavrakis/mcp-starter-template 是从 https://github.com/stevenstavrakis/mcp-starter-template. 导入的一个 MCP 服务器候选。

概述(AI 翻译)

一个用于使用 TypeScript 构建模型上下文协议(MCP)服务器的生产准备入门模板。

🚀 快速启动

  1. 克隆仓库
  2. 安装依赖:

✨ 主要特色

  • Bun 用于快速测试和开发
  • 用于衬絮和格式化的生物群落
  • 带标准版本的自动化版本管理
  • 简洁、易于维护的项目结构

📂 项目结构

⚙️ 配置

创造新工具

该项目包含一个脚本,帮助创建新的MCP工具:

这将:

  1. 在src/tools/ 下创建一个新的工具目录。
  2. 生成基本工具结构,包括:
  • index.ts(主要实现)
  • schema.ts(工具参数的JSON模式)
  • test.ts(测试文件)
  1. 更新工具索引文件以导出新工具

示例:

🛠️ 发展

  • 运行测试:bun test
  • 格式代码:bun run format
  • lint code: bun run lint
  • 构建项目:bun run build

要将你的开发MCP服务器添加到Claude Desktop:

  1. 建设项目:

  2. 添加到你的Claude桌面配置中:

📜 版本管理

本项目使用标准版本进行自动化版本管理。运行 bun run release 以创建新版本。

本页由 AI 翻译,技术细节请以原文为准。

README

MCP Server Starter

A production-ready starter template for building Model Context Protocol (MCP) servers with TypeScript.

🚀 Quick Start

  1. Clone the repository
  2. Install dependencies:
    bun install
    

✨ Key Features

  • Bun for fast testing and development
  • Biome for linting and formatting
  • Automated version management with standard-version
  • Clean, maintainable project structure

📂 Project Structure

mcp-starter/
├── src/
│   ├── tools/          # MCP tools implementation
│   ├── utils/          # Shared utilities
│   ├── main.ts         # Server entry point
│   └── types.ts        # Shared type definitions
├── tests/              # Test files
├── biome.json          # Linting configuration
├── tsconfig.json       # TypeScript configuration
└── package.json        # Project dependencies

⚙️ Configuration

Creating New Tools

The project includes a script to help create new MCP tools:

bun run scripts/create-tool.ts 

This will:

  1. Create a new tool directory under src/tools/
  2. Generate the basic tool structure including:
    • index.ts (main implementation)
    • schema.ts (JSON schema for tool parameters)
    • test.ts (test file)
  3. Update the tools index file to export the new tool

Example:

bun run scripts/create-tool.ts weather

🛠️ Development

  • Run tests: bun test
  • Format code: bun run format
  • Lint code: bun run lint
  • Build project: bun run build

To add your development MCP server to Claude Desktop:

  1. Build the project:
    bun run build
    
  2. Add to your Claude Desktop config:
    // You only need the argument if you need to pass arguments to your server
    {
      "mcpServers": {
        "your-server-name": {
          "command": "node",
          "args": ["/path/to/your/project/dist/main.js", "some_argument"]
        }
      }
    }
    

📜 Version Management

This project uses standard-version for automated version management. Run bun run release to create a new version.

Commit Message Format

  • feat: New feature (bumps minor version)
  • fix: Bug fix (bumps patch version)
  • BREAKING CHANGE: Breaking change (bumps major version)

📦 Publishing to npm

  1. Ensure you’re logged in to npm:
    npm login
    
  2. Build the project:
    bun run build
    
  3. Publish the package:
    npm publish
    

Remember to update the version number using bun run release before publishing new versions.

Installing from npm (after publishing)

Add to your Claude Desktop config:

// You only need the argument if you need to pass arguments to your server
{
  "mcpServers": {
    "your-server-name": {
      "command": "npx",
      "args": ["-y", "your-package-name", "some_argument"]
    }
  }
}
在 GitHub 查看完整 README

安装

npx -y your-package-name some_argument
新手?先看 mcpskill.org 教程 →

配置

// You only need the argument if you need to pass arguments to your server { "mcpServers": { "your-server-name": { "command": "node", "args": ["/path/to/your/project/dist/main.js", "some_argument"] } } }