Skip to main content
Glama
Hng2725

Math Addition MCP Server

by Hng2725

Các phương pháp Kiểm thử (Testing)

Phương pháp 1: Debug độc lập bằng MCP Inspector (Khuyên dùng đầu tiên)

Sử dụng công cụ này để kiểm tra logic code và các gói tin JSON-RPC trên giao diện web độc lập trước khi gắn vào ứng dụng thật.

Cách sử dụng:

  1. Chạy lệnh (tại thư mục chứa dự án):

    npx @modelcontextprotocol/inspector npx tsx server.ts
  2. Truy cập http://localhost:5173 trên trình duyệt (nếu không hiện cửa sổ).

  3. Bấm Connect, chuyển sang tab Tools và nhấp Execute Tool để chạy thử tính tổng.


Related MCP server: Deployable MCP Server

Phương pháp 2: Kiểm thử với Claude Code (Giao diện CLI)

Thêm MCP server:

claude mcp add my-test-math-server -- npx tsx "C:/Đường/Dẫn/Tuyệt/Đối/server.ts"

Kiểm tra trạng thái kết nối:

claude mcp list

(Đảm bảo hiển thị Connected)

Bắt đầu test:

Mở chat với Claude Code và gõ:

"Hãy dùng công cụ tính tổng của bạn để tính 4521 + 5479"


Phương pháp 3: Kiểm thử với Claude Desktop (Giao diện App)

Thêm cấu hình vào file claude_desktop_config.json

File nằm ở:

  • Windows: %APPDATA%\Claude

  • Mac: ~/Library/Application Support/Claude/

"mcpServers": {
  "my-test-math-server": {
    "command": "npx",
    "args": [
      "tsx",
      "C:/Đường/Dẫn/Tuyệt/Đối/server.ts"
    ]
  }
}

Các bước thực hiện:

  1. Thoát hẳn (Quit) và khởi động lại ứng dụng Claude Desktop

  2. Tạo cuộc trò chuyện mới (New Chat)

  3. Gõ vào ô chat:

    "Tính tổng 1545 và 3423 bằng công cụ của bạn"


📝 Lưu ý quan trọng

  1. Không dùng console.log() trong luồng code thực thi chính. Nếu cần debug, hãy dùng console.error("log message") để tránh làm vỡ định dạng JSON-RPC trên luồng stdio.

  2. Luôn sử dụng đường dẫn tuyệt đối (Absolute Path) trỏ tới file server.ts khi cấu hình.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A simple demonstration MCP server that provides a basic arithmetic tool for adding two numbers together, showcasing how to build custom MCP servers with input validation.
    15
    ISC
  • A
    license
    B
    quality
    D
    maintenance
    A simple Model Context Protocol (MCP) server that provides basic calculation functions to Claude. It enables users to perform mathematical operations like addition directly through natural language commands.
    1
    MIT

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/Hng2725/MCPTestingWithClaude'

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