MCP服务器脚手架

一个基于Model Context Protocol的MCP服务器模板,提供字符串反转、字数统计和服务健康检查等开发辅助工具。

  • by Opafex
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 IntelagentStudios/intelagent-mcp-template

使用说明

My MCP Server

A Model Context Protocol server built with @opafex/mcp-shared.

Quick Start

npm install
npm run build
npm start

Add to Claude Code

Create .mcp.json in your project root:

{
  "mcpServers": {
    "my-mcp-server": {
      "command": "node",
      "args": ["path/to/dist/index.js"]
    }
  }
}

Tools

Tool Description
reverse_string Reverse a string
word_count Count words and characters
server_info Server metadata and health check

Development

npm run dev       # Run with tsx (no build needed)
npm run build     # Compile TypeScript
npm test          # Run tests
npm run test:watch # Watch mode

Adding a New Tool

  1. Define types in src/types.ts
  2. Add business logic to a service in src/services/
  3. Define the tool in src/tools/ using the ToolDefinition interface
  4. Wire it up in src/index.ts
  5. Add tests in tests/

See the enrichment MCP for a full production example.

License

MIT