MCP.so
登录

Python MCP Server Sample

@0shimax

基本信息

分类

其他

许可证

MIT license

传输方式

stdio

作者

0shimax

关于 Python MCP Server Sample

暂无概览

Python MCP Server Sample 配置

暂无标准配置

该服务器的 README 中没有可解析的 MCP 配置块,请前往代码仓库查看安装说明。

代码仓库

Python MCP Server Sample 工具

工具列表暂未提供

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

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

概览

What is Python Mcp Server Sample?

Python Mcp Server Sample is a minimal example MCP server built using the FastMCP class from the MCP Python SDK. It demonstrates how to create a simple tool (adding two integers) and run the server over the stdio transport. The project is intended for developers learning to build and register MCP servers with clients like Cline.

How to use Python Mcp Server Sample?

Install uv, then create a new Python project with uv init mcp-server-demo, install the MCP CLI SDK (uv add "mcp[cli]"), and write the provided server code in server.py. To run, use the command uv run server.py from the project directory, or register the server in Cline’s MCP configuration by specifying the uv command with the --directory and run arguments.

Key features of Python Mcp Server Sample

  • Built with FastMCP for quick server setup.
  • Includes a single add tool that sums two integers.
  • Runs with debug mode enabled for development.
  • Uses stdio transport for local communication.
  • Designed for integration with the Cline MCP client.

Use cases of Python Mcp Server Sample

  • Learning how to structure a basic MCP server with Python.
  • Testing MCP tool registration and execution in Cline.
  • Prototyping simple computational tools for AI assistants.

常见问题

1

What is FastMCP?

FastMCP is a simplified API from the MCP Python SDK that allows creating an MCP server with minimal boilerplate, using decorators to define tools.

2

How do I install the required dependencies?

Use `uv add "mcp[cli]"` after initializing the project with `uv init`. The `[cli]` extra includes the MCP command‑line interface.

3

Which transport does the server use?

The server runs in stdio transport mode by calling `mcp.run(transport="stdio")`.

4

Where do I configure the server for Cline?

Edit the Cline project’s MCP JSON file (e.g., `.vscode/mcp.json`) and add an entry under `mcpServers` with the command `uv` and arguments pointing to the project directory and `server.py`.

5

What tools does this server provide?

It provides one tool named `add` that takes two integers `a` and `b` and returns their sum.

评论

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