Skip to main content

A simple MCP agents project with basic math tools

Project description

MCP Agents - Example FastMCP Server

A simple Model Context Protocol (MCP) server built with FastMCP that demonstrates basic tool implementation.

Features

  • greet: Greet a user by name

Installation

This project uses uv for package management and just for task running. Make sure you have both installed:

# Install uv if you don't have it
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install just if you don't have it
# On macOS with Homebrew:
brew install just
# Or with cargo:
cargo install just

Then build the project:

just build

Usage

Running the MCP Server

To start the MCP agents server:

just run

Using with MCP Clients

You can use this server with any MCP-compatible client. The configuration depends on how you want to run the server:

Option 1: Local Development (using source code)

For development or when running from a local clone:

{
  "mcpServers": {
    "mcp-agents": {
      "command": "uv",
      "args": ["run", "mcp-agents"],
      "cwd": "/Users/means/repository/mcp-agents",
      "env": {}
    }
  }
}

Option 2: PyPI Installation (recommended for end users)

Once published to PyPI, users can use this simpler configuration:

{
  "mcpServers": {
    "mcp-agents": {
      "command": "uvx",
      "args": ["amajakai14_mcp-agents"]
    }
  }
}

Alternative with pipx:

{
  "mcpServers": {
    "mcp-agents": {
      "command": "pipx",
      "args": ["run", "amajakai14_mcp-agents"]
    }
  }
}

Option 3: Version Pinning

To pin to a specific version:

{
  "mcpServers": {
    "mcp-agents": {
      "command": "uvx",
      "args": ["amajakai14_mcp-agents==0.1.0"]
    }
  }
}

For Claude Desktop

Add any of the above configurations to your Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json

Testing the Tools

Run the test script to verify the tools work correctly:

just test

Available Tools

greet

Greets a user by name.

Parameters:

  • name (string): The name of the person to greet

Returns: A friendly greeting message.

Example:

{
  "name": "greet",
  "arguments": {
    "name": "Alice"
  }
}

Response:

"Hello, Alice!"

Development

Available Just Commands

  • just build - Install dependencies and sync the project
  • just run - Start the MCP agents server
  • just test - Run the test script
  • just format - Format code with black and isort
  • just typecheck - Run type checking with mypy
  • just dev - Install development dependencies
  • just dist - Build distribution packages
  • just clean - Clean build artifacts
  • just publish - Publish to PyPI (used in CI)

Project Structure

mcp-agents/
├── src/
│   └── agents/
│       └── __init__.py          # Main MCP server implementation
├── pyproject.toml               # Project configuration and dependencies
├── justfile                     # Task runner configuration
├── mcp_config.json             # MCP client configuration example
├── test_tools.py               # Simple test script
└── README.md                   # This file

Adding New Tools

To add new tools using FastMCP:

  1. Add a new function with the @mcp.tool() decorator:

    @mcp.tool("tool_name", description="Description of what the tool does")
    def tool_name(param1: type, param2: type) -> return_type:
        # Tool implementation
        return result
    
  2. Update the README with documentation for the new tool

Running Tests

just test

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amajakai14_mcp_agents-0.1.3.tar.gz (86.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amajakai14_mcp_agents-0.1.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file amajakai14_mcp_agents-0.1.3.tar.gz.

File metadata

File hashes

Hashes for amajakai14_mcp_agents-0.1.3.tar.gz
Algorithm Hash digest
SHA256 19a921ef39a7c3153f9f48b4d0be24c523a4bd18931a0c1365e3f88edb2987f7
MD5 14a308d36c8c9badac85ff38963196f7
BLAKE2b-256 9a6b072919b94a18a083fd69a9a040f62113ba5faa5452a0e433ba98497dd107

See more details on using hashes here.

File details

Details for the file amajakai14_mcp_agents-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for amajakai14_mcp_agents-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a0c2e62717dfc6195f2f9127c22fce84822d6ea9ed62a851818a10a905a20cfe
MD5 c17adb148eff5139b0bc41d42fc5bfe8
BLAKE2b-256 3d82018e89b191f927dd493ad3fa6868b007d2dcfe2c4ffcca6575224f9c46bb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page