npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp_math_server

v1.0.1

Published

MCP 服务 - 计算函数

Readme

mcp_math_server

一个基于 Model Context Protocol (MCP) 的数学计算服务器,提供加法、减法、乘法和除法功能。

功能

该 MCP 服务器提供以下工具:

  • local_sum: 计算多个数字的和
  • local_multiply: 计算多个数字的积
  • local_subtract: 计算两个数字的差
  • local_divide: 计算两个数字的商

安装

方式一:全局安装(推荐)

npm install -g mcp_math_server

方式二:本地安装

npm install mcp_math_server

配置

在 Cursor 中使用

  1. 打开 Cursor 设置
  2. 找到 MCP 服务器配置(通常在设置文件中)
  3. 添加以下配置:
{
  "mcpServers": {
    "math-server": {
      "command": "mcp-math-server",
      "args": []
    }
  }
}

如果使用本地安装,需要指定完整路径:

{
  "mcpServers": {
    "math-server": {
      "command": "node",
      "args": ["/path/to/node_modules/mcp_math_server/index.js"]
    }
  }
}

在 Claude Desktop 中使用

  1. 找到 Claude Desktop 的配置文件:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. 在配置文件中添加:

{
  "mcpServers": {
    "math-server": {
      "command": "mcp-math-server",
      "args": []
    }
  }
}

如果使用本地安装,使用完整路径:

{
  "mcpServers": {
    "math-server": {
      "command": "node",
      "args": ["/path/to/node_modules/mcp_math_server/index.js"]
    }
  }
}
  1. 重启 Claude Desktop

使用 npx(无需安装)

如果不想全局安装,也可以直接使用 npx:

{
  "mcpServers": {
    "math-server": {
      "command": "npx",
      "args": ["-y", "mcp_math_server"]
    }
  }
}

使用方法

配置完成后,重启你的 MCP 客户端(Cursor 或 Claude Desktop),然后就可以在对话中使用这些数学计算工具了。

示例

  • "计算 1, 2, 3, 4 的和"
  • "计算 5 乘以 6 乘以 7"
  • "计算 100 减去 25"
  • "计算 50 除以 2"

AI 助手会自动调用相应的 MCP 工具来执行计算。

开发

本地运行

npm start

项目结构

  • index.js: MCP 服务器主文件
  • package.json: 项目配置和依赖

许可证

ISC