Token导航 LogoToken导航TokenDH.com
calculator MCP demo logo
运维云端未说明官方级别未说明来源级核验

calculator MCP demo

MCP Server

一个简单的MCP服务器演示,用于执行基本算术运算,适用于需要快速部署计算服务的场景。

工具数

4

提示词数

0

GitHub Stars

0

资源数

0
PythonClaudeClaude DesktopClaude DesktopClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

amugoodbad229

提供方

amugoodbad229

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

计算器MCP演示

一个简单而现代的MCP服务器演示,旨在执行基本的算术运算。此存储库主要是为在FastMCP Cloud上部署而创建的。

🚀 概述

该项目提供了一个构建和部署MCP(模型控制程序)服务器的简单示例。它公开了一组可由客户端应用程序调用的计算器工具。

✨ 特性

  • 补充: 将两个数字相加。
  • 减法: 从一个数字中减去另一个数字。
  • 乘法: 将两个数字相乘。
  • 部门: 将一个数字除以另一个数字,并对除以零的错误进行处理。

► 查看资源板

🛠️ 技术栈

  • python
  • FastMCP
  • httpx

🚀 如何使用它

从下面的选项中选择您喜欢的客户端或工具,并使用提供的代码段进行连接。

🐍 FastMCP Client (Python)

import asyncio
from fastmcp import Client, FastMCP

client = Client("https://calculator-mcp-demo.fastmcp.app/mcp")

async def main():
    async with client:
        # Ensure client can connect
        await client.ping()

        # List available operations
        tools = await client.list_tools()
        resources = await client.list_resources()
        prompts = await client.list_prompts()

        # Ex. execute a tool call
        result = await client.call_tool("your_example_tool", {"param": "value"})
        print(result)

asyncio.run(main())

🧠 OpenAI SDK (Python)

from openai import OpenAI

client = OpenAI()

resp = client.responses.create(
    model="gpt-4.1",
    tools=[
        {
            "type": "mcp",
            "server_label": "calculator-mcp-demo",
            "server_url": "https://calculator-mcp-demo.fastmcp.app/mcp",
            "require_approval": "never",
        },
    ],
    input="Hello from FastMCP Cloud!",
)

🤖 Claude Desktop

要连接、下载并安装 .dxt 配置文件来自 客户 FastMCP Cloud仪表板上的选项卡。

🖱️ Connect to Cursor

通过在浏览器上粘贴链接立即安装:

cursor://anysphere.cursor-deeplink/mcp/install?name=calculator-mcp演示和配置=eyJ1cmwiOiJodHRwczovL2NhbGN1bGF0b3ItbWNwLWRlbW8uZmFzdG1jcC5hcHAvbWNwIn0%3D

⚡ Command Line Integrations (CLI)

Gemini CLI

gemini mcp add calculator-mcp-demo https://calculator-mcp-demo.fastmcp.app/mcp --transport http

克劳德代码

claude mcp add --scope local --transport http calculator-mcp-demo https://calculator-mcp-demo.fastmcp.app/mcp

Codex CLI

运行此命令以添加服务器:

codex mcp add -- calculator-mcp-demo npx -y mcp-remote@latest https://calculator-mcp-demo.fastmcp.app/mcp

或者,将此添加到您的Codex配置文件中:

[mcp_servers.calculator-mcp-demo]
command = "npx"
args = ["-y", "mcp-remote@latest", "https://calculator-mcp-demo.fastmcp.app/mcp"]

☁️ 部署

此MCP服务器旨在部署在 FastMCP云The pyproject.toml 包含文件是为了方便此过程。

📄 许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

目录标签

目录标签

PythonClaudeClaude Desktop计算服务本地部署MCP服务器算术运算Python工具

支持客户端

Claude DesktopClaudeCursor

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP