Toy

Toy MCP server
  • python

0

GitHub Stars

python

Language

4 months ago

First Indexed

3 weeks ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "mircorudolph-mcp-tool": {
      "command": "uv",
      "args": [
        "run",
        "mcp",
        "dev",
        "main.py"
      ]
    }
  }
}

You run a toy MCP server implemented with the official MCP Python SDK. It exposes two tools you can call through MCP clients: random_animal and roll_d20. The server is lightweight, transport-flexible, and designed to demonstrate how MCP tools are declared and invoked in practice.

How to use

You interact with the server through an MCP client. The server declares two tools you can call without arguments: random_animal which returns a random animal from a predefined list, and roll_d20 which returns a random number between 1 and 20. Use your MCP client to list the available tools and then invoke them one at a time to see the results.

Typical usage pattern:

How to install

Prerequisites you need to install and run the server:

uv sync

If you are not using uv, you can install dependencies with:

pip install -e .

This will install the mcp[cli] SDK, which provides the MCP runtime and developer tooling.

Optional but recommended: install Claude Desktop if you want to register this server as a Claude MCP connector so you can launch it from Claude Desktop.

Step-by-step setup from a project root:

uv run mcp dev main.py

# This runs the server in development mode (stdio) and opens the MCP Inspector.

Alternate way to run the server directly (useful for custom MCP clients or testing):

python main.py

# This starts the MCP server loop using the FastMCP instance defined in main.py.

Additional notes and considerations

Registering the server with Claude Desktop is an optional step that enables easy discovery and launching from Claude’s MCP integration. If you choose to connect Claude Desktop, you will configure it to run the same command you use locally (for example, python main.py) and Claude will manage starting the server on demand.

You can inspect the server’s declared tools and manually invoke them to verify behavior before integrating with any MCClients. The two tools you will interact with are random_animal and roll_d20, each returning a simple, deterministic output suitable for demonstration.

Available tools

random_animal

Returns a random animal from a predefined list of 10 animals when invoked without arguments.

roll_d20

Returns a random integer from 1 to 20 to simulate a 20-sided die roll when invoked without arguments.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational