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

支持

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


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

Available Tools

4 tools
add加法工具B

将两个数字相加并返回结果

ParametersJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions the tool returns a result, which is basic behavioral information, but lacks details like error handling, performance characteristics, or any constraints. For a simple arithmetic tool, this is minimal but not entirely absent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words: '将两个数字相加并返回结果'. It is appropriately sized and front-loaded, making it easy to understand immediately.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (simple arithmetic), the presence of an output schema (which handles return values), and the description's basic clarity, it is mostly complete. However, the lack of usage guidelines and minimal parameter semantics slightly reduce completeness for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, but the description adds some semantic context by specifying that the parameters are '两个数字' (two numbers). However, it doesn't explain what 'a' and 'b' represent beyond being numbers, leaving gaps in understanding their roles.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '将两个数字相加并返回结果' (adds two numbers and returns the result). It specifies the verb (adds) and resource (two numbers), but doesn't explicitly differentiate from sibling tools like 'subtract' or 'multiply' beyond the inherent meaning of 'add'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'subtract', 'multiply', or 'divide'. It states what the tool does but offers no context about appropriate use cases or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

divide除法工具B

将两个数字相除并返回结果

ParametersJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the basic operation but lacks details on error handling (e.g., division by zero), performance, or other behavioral traits. It does not contradict annotations, but it is insufficient for a mutation-like operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the purpose and outcome with zero waste. It is appropriately sized for a simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (basic arithmetic), 2 parameters, and the presence of an output schema (which handles return values), the description is mostly complete. However, it lacks error handling details, which is a minor gap for a division operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaning by specifying that the parameters are 'two numbers' to be divided, which clarifies the input schema's properties 'a' and 'b'. With 0% schema description coverage, this compensates well, though it does not detail parameter roles (e.g., dividend and divisor).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('divide') and resources ('two numbers'), and specifies the outcome ('return result'). It distinguishes from siblings by focusing on division rather than addition, multiplication, or subtraction. However, it lacks explicit sibling differentiation in the text.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus the sibling tools (add, multiply, subtract). The description implies usage for division operations but offers no context, exclusions, or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

multiply乘法工具B

将两个数字相乘并返回结果

ParametersJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the basic behavior (multiply and return), but lacks details on error handling (e.g., overflow, invalid inputs), performance characteristics, or any side effects. For a tool with no annotation coverage, this is a significant gap in behavioral disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (simple arithmetic), two parameters with an output schema (which handles return values), and no annotations, the description is reasonably complete. It covers the core functionality, though it could benefit from more behavioral context given the lack of annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, but the description compensates by specifying that the tool multiplies 'two numbers', which aligns with the two parameters (a and b). However, it doesn't detail parameter roles (e.g., which is multiplicand/multiplier) or constraints beyond being numbers, leaving some ambiguity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function ('将两个数字相乘并返回结果' translates to 'multiply two numbers and return the result'), which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'add' or 'divide', though the mathematical operation is inherently distinct.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'add' or 'divide'. While the mathematical context might imply usage for multiplication operations, there's no explicit mention of when to choose this over other arithmetic tools or any prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

subtract减法工具B

将两个数字相减并返回结果

ParametersJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the action (subtract) and outcome (return result), but lacks details on error handling (e.g., for non-numeric inputs), performance, side effects, or other behavioral traits. This is a significant gap for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence: '将两个数字相减并返回结果'. It is front-loaded with the core action, has zero wasted words, and is appropriately sized for a simple arithmetic tool. Every part of the sentence contributes directly to understanding the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (basic subtraction), 2 parameters with a simple schema, and the presence of an output schema (which handles return values), the description is reasonably complete. It covers the essential purpose and outcome. However, it lacks behavioral details (e.g., error cases) and usage guidelines, which are minor gaps in this context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description implies two numeric parameters but doesn't name or explain them beyond 'two numbers'. With 0% schema description coverage, the schema only defines types (number) and requirements. The description adds minimal semantic value (e.g., it clarifies the operation is subtraction, not addition), but doesn't compensate fully for the coverage gap, such as by specifying parameter roles (e.g., minuend and subtrahend).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: '将两个数字相减并返回结果' (subtract two numbers and return the result). It specifies the verb (subtract), resource (two numbers), and outcome (return result). However, it doesn't explicitly differentiate from sibling tools like 'add' or 'divide' beyond the inherent meaning of subtraction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'add' or 'divide'. It states what the tool does but offers no context about use cases, prerequisites, or comparisons to sibling tools. The agent must infer usage solely from the tool name and basic description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv1.0.0
    • First observedadd
    • First observeddivide
    • First observedmultiply
    • First observedsubtract

TDQS

A3.8/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct mathematical operation: addition, division, multiplication, and subtraction. There is no overlap in purpose, and an agent can easily select the correct tool based on the desired arithmetic operation.

Naming Consistency5/5

All tool names follow a consistent verb-only pattern in English (add, divide, multiply, subtract), which is simple and predictable. There are no deviations in naming style or conventions.

Tool Count5/5

With 4 tools, the server is well-scoped for basic arithmetic operations. Each tool serves a distinct and essential function, and the count is appropriate for the domain without being too thin or heavy.

Completeness5/5

The tool set provides complete coverage for basic arithmetic operations, including addition, subtraction, multiplication, and division. There are no obvious gaps for this domain, as all fundamental operations are covered.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    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.
    5 npm
    ISC
  • A
    license
    Not graded
    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.
    Apache 2.0
  • A
    license
    Not graded
    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.
    4 npm
    Apache 2.0