loading…
Search for a command to run...
loading…
A simple MCP server that provides a tool for adding two numbers, designed for testing MCP integration with Claude.
A simple MCP server that provides a tool for adding two numbers, designed for testing MCP integration with Claude.
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.
Chạy lệnh (tại thư mục chứa dự án):
npx @modelcontextprotocol/inspector npx tsx server.ts
Truy cập http://localhost:5173 trên trình duyệt (nếu không hiện cửa sổ).
Bấm Connect, chuyển sang tab Tools và nhấp Execute Tool để chạy thử tính tổng.
claude mcp add my-test-math-server -- npx tsx "C:/Đường/Dẫn/Tuyệt/Đối/server.ts"
claude mcp list
(Đảm bảo hiển thị Connected)
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"
claude_desktop_config.jsonFile nằm ở:
%APPDATA%\Claude~/Library/Application Support/Claude/"mcpServers": {
"my-test-math-server": {
"command": "npx",
"args": [
"tsx",
"C:/Đường/Dẫn/Tuyệt/Đối/server.ts"
]
}
}
"Tính tổng 1545 và 3423 bằng công cụ của bạn"
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.
Luôn sử dụng đường dẫn tuyệt đối (Absolute Path) trỏ tới file server.ts khi cấu hình.
Run in your terminal:
claude mcp add math-addition-mcp-server -- npx