Skip to main content
Glama

My MCP Server

一个功能丰富的 Model Context Protocol (MCP) 服务器,提供工具、资源和可复用的提示模板。

特性

🛠️ 工具 (Tools)

  • 算术运算:加法、减法、乘法、除法

📚 资源 (Resources)

  • 文件资源:动态访问项目中的知识库文件

  • 技术文档:前端和后端开发文档(React、Vue、HTML、Python、Go等)

💡 提示模板 (Prompts)

  • 代码审查 (code-review):系统化的代码审查指南

  • 文档生成 (doc-generation):API、README、使用指南等文档模板

  • 调试帮助 (debug-help):结构化的调试方法论

  • 测试生成 (test-generation):完整的测试用例编写指南

  • 重构建议 (refactoring):代码重构的系统方法

🔄 工作流 (Workflows)

  • 开发工作流:从需求到部署的完整流程

  • 代码审查工作流:系统化的代码审查过程

  • 问题调试工作流:Bug 修复和问题排查流程

  • 重构工作流:安全的代码重构流程

  • 功能开发工作流:敏捷开发流程(TDD)

  • API开发工作流:API 开发标准流程

Related MCP server: MCP Demo Server

快速开始

安装依赖

npm install

编译项目

npm run build

启动服务器

npm start

开发模式

npm run dev

项目结构

my-mcp-server/
├── src/
│   ├── index.ts                  # 主服务器文件
│   ├── server/
│   │   ├── tools/               # 工具定义
│   │   │   ├── index.ts
│   │   │   └── arithmetic.ts    # 算术工具
│   │   ├── resource/            # 资源定义
│   │   │   ├── index.ts
│   │   │   ├── resources.ts     # 静态资源
│   │   │   └── fileServer.ts    # 文件资源服务
│   │   └── prompts/             # 提示模板
│   │       ├── index.ts
│   │       ├── templates.ts     # 提示模板定义
│   │       └── workflows.ts     # 工作流定义
│   ├── types/                   # 类型定义
│   │   ├── mcpTool.ts
│   │   ├── mcpResource.ts
│   │   └── mcpPrompt.ts
│   └── utils/                   # 工具函数
│       └── file.ts
├── resources/                   # 知识库资源
│   ├── frontend/
│   └── backend/
├── build/                       # 编译输出
├── PROMPTS_GUIDE.md            # 提示模板详细指南
├── PROMPTS_EXAMPLES.md         # 使用示例
├── FILE_SERVER_GUIDE.md        # 文件服务器指南
└── package.json

使用指南

使用工具

// 加法运算
const result = await client.callTool("add", {
  a: 10,
  b: 20
});
// 结果: 30

访问资源

// 读取前端文档
const doc = await client.readResource("file://frontend/react");

// 读取后端文档
const backendDoc = await client.readResource("file://backend/python");

使用提示模板

// 代码审查
const reviewGuide = await client.getPrompt("code-review", {
  language: "TypeScript",
  focus: "性能"
});

// 生成 API 文档
const apiDoc = await client.getPrompt("doc-generation", {
  docType: "API",
  projectName: "my-project"
});

// 调试帮助
const debugGuide = await client.getPrompt("debug-help", {
  errorType: "运行时错误",
  language: "JavaScript"
});

详细的提示模板使用说明,请查看:

文件资源服务

详细的文件资源使用说明,请查看 FILE_SERVER_GUIDE.md

配置

在 Claude Desktop 中使用此服务器,需要在配置文件中添加:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

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

Windows: %APPDATA%\Claude\claude_desktop_config.json

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

功能亮点

📝 提示模板系统

提示模板提供了可复用的结构化指导,涵盖软件开发的各个环节:

  • 标准化:确保团队遵循统一的最佳实践

  • 高效性:减少重复性思考工作

  • 知识共享:积累和传播团队经验

  • 灵活性:可根据需求自定义模板

🔄 工作流管理

工作流将多个步骤组合成完整的开发流程:

  • 流程化:明确的步骤指导

  • 集成化:关联相关的工具和资源

  • 可追踪:便于跟踪项目进度

  • 可扩展:轻松添加新的工作流

📦 动态资源系统

智能的文件资源管理:

  • 自动发现:自动扫描和注册资源目录

  • 动态加载:按需读取文件内容

  • 分类管理:前端、后端等分类组织

  • 易于扩展:添加新资源无需修改代码

开发指南

添加新工具

  1. src/server/tools/ 中创建新文件

  2. 定义工具的输入输出 schema

  3. 实现工具的 handler 函数

  4. src/server/tools/index.ts 中导出

添加新提示模板

  1. src/server/prompts/templates.ts 中定义模板

  2. 指定参数 schema 和 handler

  3. src/server/prompts/index.ts 中导出

  4. 重新编译:npm run build

详细说明请参考 PROMPTS_GUIDE.md

添加新工作流

  1. src/server/prompts/workflows.ts 中定义工作流

  2. 指定步骤、关联的提示模板和工具

  3. 添加元数据(标签、分类、预估时间)

  4. 在文件末尾导出

添加新资源

将文档文件添加到 resources/ 目录:

resources/
├── frontend/
│   └── new-framework.md
└── backend/
    └── new-language.md

服务器会自动扫描并注册这些资源。

调试

使用 MCP Inspector 调试服务器:

npx @modelcontextprotocol/inspector node build/index.js

技术栈

  • TypeScript: 类型安全的开发体验

  • MCP SDK: Model Context Protocol 官方 SDK

  • Zod: 运行时类型验证

  • Node.js: 运行时环境

统计信息

当前版本包含:

  • ✅ 4 个工具

  • ✅ 5 个提示模板

  • ✅ 6 个工作流定义

  • ✅ 动态文件资源系统

  • ✅ 2+ 资源分类(前端、后端)

许可证

MIT

贡献

欢迎贡献!如果您有任何改进建议或新功能想法:

  1. Fork 本仓库

  2. 创建特性分支 (git checkout -b feature/AmazingFeature)

  3. 提交更改 (git commit -m 'Add some AmazingFeature')

  4. 推送到分支 (git push origin feature/AmazingFeature)

  5. 开启 Pull Request

支持

如有问题或需要帮助,请:


让开发更高效,让团队更协同! 🚀

Install Server
F
license - not found
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    D
    maintenance
    An AI-powered MCP server that provides development tools for code analysis, documentation, and project management including code pattern extraction, humorous code reviews, TODO scanning, and PRD generation.
    Last updated
    18
    ISC
  • A
    license
    -
    quality
    D
    maintenance
    A demonstration MCP server showcasing tools (calculator, file operations, weather, timestamp), resources (server config, system info, documentation), and reusable prompt templates for code review, documentation, and debugging.
    Last updated
    Apache 2.0
  • F
    license
    -
    quality
    D
    maintenance
    A modular MCP server that provides tools for file operations, regex-based code searching, and structural analysis of functions and classes across multiple programming languages. It also includes AI-powered features for intelligently updating files according to architectural changes.
    Last updated
  • A
    license
    -
    quality
    D
    maintenance
    An AI-native specification framework that enables deep requirements analysis and structured project planning through intelligent Q\&A workflows. The MCP server provides tools for project initialization, requirement analysis, and the generation of living documentation like development plans and architecture specs.
    Last updated
    25
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • MCP server for AI agent profiles and smart notes. 60+ coding prompt packs with expert personas.

  • Augments MCP Server - A comprehensive framework documentation provider for Claude Code

  • MCP server for generating rough-draft project plans from natural-language prompts.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GHjiejie/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server