ai.smithery/anirbanbasu-pymcp

Primarily to be used as a template repository for developing MCP servers with FastMCP in Python, P…

8MITai-ml

Install

Config snippet generator goes here (5 client tabs)

README

[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue?logo=python&logoColor=3776ab&labelColor=e4e4e4)](https://www.python.org/downloads/release/python-3120/) [![pytest](https://github.com/anirbanbasu/pymcp/actions/workflows/uv-pytest-coverage.yml/badge.svg)](https://github.com/anirbanbasu/pymcp/actions/workflows/uv-pytest-coverage.yml) [![PyPI](https://img.shields.io/pypi/v/pymcp-template?label=pypi%20package)](https://pypi.org/project/pymcp-template/#history) ![GitHub commits since latest release](https://img.shields.io/github/commits-since/anirbanbasu/pymcp/latest) [![CodeQL Advanced](https://github.com/anirbanbasu/pymcp/actions/workflows/codeql.yml/badge.svg)](https://github.com/anirbanbasu/pymcp/actions/workflows/codeql.yml) [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/anirbanbasu/pymcp/badge)](https://scorecard.dev/viewer/?uri=github.com/anirbanbasu/pymcp)


<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](http://gofastmcp.com/) in Python, PyMCP is somewhat inspired by the [official everything MCP server](https://github.com/modelcontextprotocol/servers/tree/main/src/everything) 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.
2. **`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.
3. **`text_web_search`**
  - Searches the web with a text query using the [Dux Distributed Global Search (DDGS)](https://github.com/deedy5/ddgs).
  - Input(s)
    - `query`: _`string`_: The search query to fetch results for. It should be a non-empty string.
    - `region`: _`string`_ (_optional_): Two letter country code followed by a hyphen and then by two letter language code, e.g., `uk-en` or `us-en`. Default value is `uk-en`.
    - `max_results`: _`integer`_ (_optional_): Optional maximum number of results to be fetched. Default value is 10.
    - `pages`: _`integer`_ (_optional_): Optional number of pages to spread the results over. Default value is 1.
  - Environment variable(s)
    - `DDGS_PROXY`: _`string`_ (_optional_): Optional proxy server to use for egress web search requests.
  - Output(s)
    - `TextContent` with a list of dictionaries with search results.
4. **`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}$.
5. **`run_python_code`**
  - Runs arbitrary Python code in a secure and fast interpreter using [Pydantic Monty](https://github.com/pydantic/monty). Note that Pydantic Monty is experimental and Python language support is partial as of February 8, 2026.
  - Input(s)
    - `code`: _`string`_: The Python code to run.
    - `inputs`: _`dict[str, Any]`_ (_optional_): A dictionary of input values for the Python code. Default value is `None`.
    - `script_name`: _`str`_ (_optional_): The name of the script used in traceback and error messages. Default value is `main.py`.
    - `check_types`: _`bool`_ (_optional_): A flag to indicate whether to check types. Default value is `True`.
    - `type_definitions`: _`str`_ (_optional_): Type definitions to be used for type checking. Default value is `None`.
  - Output(s)
    - `TextContent` with the output, if any, of the Python code.

6. **`pirate_summary`**
  - Summarises the given text in a pirate style. _This tool uses LLM client sampling. Hence, a sampling handler must exist on the client-side._
  - Input(s)
    - `text`: _`string`_: The text to summarise.
  - Output(s)
    - `TextContent` with the summary of `text` in pirate speak.
7. **`vonmises_random`**
  - Generates a