MCP.so
登录

MCP Server Python

@jongkwang

基本信息

分类

其他

许可证

MIT license

传输方式

stdio

作者

jongkwang

关于 MCP Server Python

暂无概览

MCP Server Python 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "hello-mcp-server-python": {
      "command": "python",
      "args": [
        "server.py"
      ]
    }
  }
}

MCP Server Python 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is MCP Server Python?

MCP Server Python is a Python server example that provides tools to LLMs such as Claude AI using the Model Context Protocol (MCP). It offers BMI calculation and weather information lookup functions.

How to use MCP Server Python?

Install dependencies with pip install mcp httpx, then run the server using python server.py or mcp run server.py. Connect to Cursor by placing an mcp.json file in the project root, or to Claude for Desktop by running the server and adding it in the MCP settings.

Key features of MCP Server Python

  • Provides calculate_bmi tool for BMI calculation
  • Provides fetch_weather tool for city weather lookup
  • Connects to Cursor and Claude for Desktop
  • Built with MCP Python SDK and httpx
  • Requires Python 3.9 or higher

Use cases of MCP Server Python

  • Calculate BMI for health and fitness applications
  • Fetch current weather for travel or planning
  • Demonstrate how to build an MCP server in Python
  • Integrate LLM chatbots with external data via function calling

常见问题

1

What tools does MCP Server Python provide?

It provides two tools: `calculate_bmi` (calculates BMI from height and weight) and `fetch_weather` (retrieves weather for a given city, requiring an API key).

2

What are the prerequisites to run MCP Server Python?

You need Python 3.9 or higher, pip, httpx, and the MCP Python SDK (installed via `pip install mcp httpx`).

3

How do I connect MCP Server Python to Cursor?

Create an `mcp.json` file in the project root with the command `mcp run /path/to/server.py`. Claude in Cursor will automatically recognize the tools.

4

How do I connect MCP Server Python to Claude for Desktop?

Run the server with `python server.py`, then in Claude for Desktop settings go to the MCP server section and add the local server (configure URL/port as needed).

5

Does MCP Server Python require an API key for weather?

Yes. You must modify `server.py` to set your API key in the `fetch_weather` function before the weather tool works.

评论

其他 分类下的更多 MCP 服务器