PyMCP

PyMCP

Primarily to be used as a template for developing MCP servers with FastMCP in Python, PyMCP is somewhat inspired by the official everything MCP server in Typescript.

Category
访问服务器

Tools

greet

Greet the caller with a quintessential Hello World message.

generate_password

Generate a random password with specified length, optionally including special characters. The password will meet the complexity requirements of at least one lowercase letter, one uppercase letter, and two digits. If special characters are included, it will also contain at least one such character. Until the password meets these requirements, it will keep regenerating. This is a simple example of a tool that can be used to generate passwords. It is not intended for production use.

permutations

Calculate the number of ways to choose k items from n items without repetition and with order. If k is not provided, it defaults to n.

README

Python 3.12+ pytest PyPI smithery badge

<p align="center"> <img width="256" height="84" src="https://raw.githubusercontent.com/anirbanbasu/pymcp/master/resources/logo.svg" alt="pymcp logo" style="filter: invert(1)"> </p>

Primarily to be used as a template repository for developing MCP servers with FastMCP in Python, PyMCP is somewhat inspired by the official everything MCP server in Typescript.

Components

The following components are available on this MCP server.

Tools

  1. greet
  • Greets the caller with a quintessential Hello World message.
  • Input(s)
    • name: string (optional): The name to greet. Default value is none.
  • Output(s)
    • TextContent with a UTC time-stamped greeting.
  1. generate_password
  • Generates a random password with specified length, optionally including special characters and conforming to the complexity requirements of at least one lowercase letter, one uppercase letter, and two digits. If special characters are included, it will also contain at least one such character.
  • Input(s)
    • length: integer: The length of the generated password. The value must be an integer between 8 and 64, both inclusive.
    • use_special_chars: boolean (optional): A flag to indicate whether the password should include special characters. Default value is False.
  • Output(s)
    • TextContent with the generated password.
  1. permutations
  • Calculates the number of ways to choose $k$ items from $n$ items without repetition and with order. If $k$ is not provided, it defaults to $n$.
  • Input(s)
    • n: integer: The number of items to choose from. This should be a non-zero, positive integer.
    • k: integer (optional): The number of items to choose. Default value is the value of n.
  • Output(s)
    • TextContent with number of ways to choose $k$ items from $n$, essentially ${}^{n}P_{k}$.

Resources

  1. get_logo
  • Retrieves the Base64 encoded PNG logo of PyMCP along with its SHA3-512 hash.
  • URL: data://logo
  • Output(s)
    • TextContent with a Base64EncodedBinaryDataResponse Pydantic object with the following fields.
      • data: string: The Base64 encoded PNG logo of PyMCP.
      • hash: string: The hexadecimal encoded cryptographic hash of the raw binary data, which is represented by its Base64 encoded string equivalent in data. (The hex encoded hash value is expected to be 6414b58d9e44336c2629846172ec5c4008477a9c94fa572d3419c723a8b30eb4c0e2909b151fa13420aaa6a2596555b29834ac9b2baab38919c87dada7a6ef14.)
      • hash_algorithm: string: The cryptographic hash algorithm used, e.g., sha3_512.
  1. unicode_modulo10
  • Computes the modulus 10 of a given number and returns a Unicode character representing the result. The character is chosen based on whether the modulus is odd or even. For odd modulus, it uses the Unicode character starting from ❶ (U+2776). For even modulus, it uses the Unicode character starting from ① (U+2460). If the modulus is 0, it returns the circled zero character ⓪ (U+24EA).
  • URL: data://modulo10/{number}
  • Input(s)
    • number: integer: A positive integer between 1 and 1000, both inclusive.
  • Output(s)
    • TextContent with a string representing the correct Unicode character.

Installation

The directory where you clone this repository will be referred to as the working directory or WD hereinafter.

Install uv. To install the project with its minimal dependencies in a virtual environment, run the following in the WD. To install all non-essential dependencies (which are required for developing and testing), replace the --no-dev with the --all-groups flag in the following command.

uv sync --no-dev

Standalone usage

PyMCP can be started standalone as a MCP server with stdio transport by running the following. However, you are unlikely to use it this way.

uv run pymcp

Furthermore, being a template repository, the code deliberately does not implement streamable-http and sse transports.

Test with the MCP Inspector

The MCP Inspector is an official Model Context Protocol tool that can be used by developers to test and debug MCP servers. This is the most comprehensive way to explore the MCP server.

To use it, you must have Node.js installed. The best way to install and manage node as well as packages such as the MCP Inspector is to use the Node Version Manager (or, nvm). Once you have nvm installed, you can install and use the latest Long Term Release version of node by executing the following.

nvm install --lts
nvm use --lts

Following that, run the MCP Inspector and PyMCP by executing the following in the WD.

npx @modelcontextprotocol/inspector uv run pymcp

This will create a local URL at port 6274 with an authentication token, which you can copy and browse to on your browser. Once on the MCP Inspector UI, press Connect to connect to the MCP server. Thereafter, you can explore the tools available on the server.

Use it with Claude Desktop, Visual Studio, and so on

The server entry to run with stdio transport that you can use with systems such as Claude Desktop, Visual Studio Code, and so on is as follows.

{
    "command": "uv",
    "args": [
        "run",
        "pymcp"
    ]
}

Instead of having pymcp as the last item in the list of args, you may need to specify the full path to the script, e.g., WD/.venv/bin/pymcp.

Contributing

Install pre-commit for Git by using the --all-groups flag for uv sync for the installation of PyMCP.

Then enable pre-commit by running the following in the WD.

pre-commit install

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选