# anirbanbasu-pymcp [Health: Active]

**Category:** 👨‍💻 Code Execution  
**Repository:** https://github.com/anirbanbasu/pymcp  
**GitHub Stars:** 8  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/anirbanbasu-pymcp

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

## Tools
Capabilities this server exposes over MCP:

- **name** — _`string`_ (_optional_): The name to greet. Default value is none.
- **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`.
- **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.
- **DDGS_PROXY** — _`string`_ (_optional_): Optional proxy server to use for egress web search requests.
- **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`.
- **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`.

## Claude Desktop Quick Installation
Remote MCP endpoint (confidence: high). Install path detected from listing signals. Add as a URL/SSE server in your client:

```json
"mcpServers": {
  "anirbanbasu-pymcp": {
    "url": "https://pymcp-template.fastmcp.app/mcp"
  }
}
```

## Documentation

## What anirbanbasu-pymcp does

anirbanbasu-pymcp is primarily a template for developing MCP servers in Python with FastMCP. Its example surface includes five tools, three resources, and one prompt, making it useful as a reference implementation as well as a source of simple utility operations.

The tools cover a deliberately mixed set of examples: a UTC time-stamped greeting, constrained password generation, DDGS-backed text web search, permutation counts, and Python code execution. The server also provides data resources for its logos and a Unicode representation derived from a number, plus a prompt that turns a described task into a Python code-writing prompt.

## How it works

The server communicates through the MCP transport selected by configuration, with `stdio` as the documented default. Tool inputs are validated according to their declared types and constraints. Search accepts a non-empty query and can receive a region, result limit, and page count. Password generation accepts lengths from 8 through 64 and can optionally include special characters while meeting the documented character requirements.

`run_python_code` passes code to Pydantic Monty, a secure interpreter with partial Python support. It can receive input values, a script name for error reporting, type-checking preferences, and optional type definitions. Monty is described as experimental, so it should not be treated as a complete Python runtime.

## Setup and configuration

The repository targets Python 3.12 or later. Its documented installation flow uses `uv` and `just`; running `just install` installs the project with minimal dependencies in a virtual environment. The `install-all` target is intended for development and testing dependencies.

Configuration includes `MCP_SERVER_TRANSPORT`, which selects the FastMCP transport and defaults to `stdio`, and `PYMCP_LOG_LEVEL`, which defaults to `INFO`. `RESPONSE_CACHE_TTL` controls the response-cache lifetime and defaults to 30 seconds; valid values range from 0 to 86,400 seconds. Web search can use the optional `DDGS_PROXY` setting for an egress proxy.

## Tools and capabilities

The anirbanbasu-pymcp MCP server exposes these tools:

- `greet` returns a UTC time-stamped Hello World-style greeting and accepts an optional name.
- `generate_password` creates a password with a requested length and optional special characters. Length must be between 8 and 64.
- `text_web_search` queries DDGS and returns a list of search-result dictionaries. Region, maximum results, and page count are configurable.
- `permutations` calculates the number of ordered, non-repeating ways to choose `k` items from `n`; `k` defaults to `n`.
- `run_python_code` executes supplied code through Pydantic Monty and returns its output when available.

Resources include a Base64-encoded PNG logo with a SHA3-512 hash, an SVG logo, and a modulo-10 Unicode resource accepting positive integers from 1 through 1000. The `code_prompt` prompt accepts a task description and returns a prompt for writing Python code.

## Limitations and notes

The anirbanbasu-pymcp MCP server is best understood as a development template rather than a focused production integration. Its Python execution feature has partial language support because it relies on experimental Pydantic Monty. Search results depend on DDGS and may require proxy configuration in environments with restricted outbound access.

The documented server-initiated sampling and elicitation examples are not included. Older MCP clients may negotiate a legacy session-based protocol, but tools that depend on those removed back-channel patterns are outside the remaining server surface.

_Full upstream README: https://allmcps.com/mcp/anirbanbasu-pymcp/readme_

