A simple and fast introduction to Model Context Protocol (MCP) servers! This project demonstrates how to create a basic MCP server with a simple math tool, perfect for learning MCP concepts without the complexity of inspector tools or npm dependencies.
This demo server provides a basic add function that can be called through the MCP protocol, showcasing the fundamental concepts of MCP server development.
- ๐งฎ Simple Math Tool: Basic addition functionality via MCP
- ๐ Python-based: Built with FastMCP for easy development
- ๐ UV Support: Modern Python package management with UV
- ๐ง CLI Testing: Test tools directly with mcp-tools-cli
- ๐ฅ๏ธ Claude Desktop Integration: Ready-to-use configs for both Windows and WSL
- ๐ฆ Minimal Dependencies: Only essential packages required
Before you begin, ensure you have the following installed:
- Python 3.12+ ๐
- UV (recommended) or pip ๐ฆ
- Claude Desktop (for GUI testing) ๐ฅ๏ธ
- mcp-tools-cli (for CLI testing) ๐ง
# Windows (PowerShell)
irm https://astral.sh/uv/install.ps1 | iex
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh# Using UV
uvx mcp-tools-cli --help
# Using pip
pip install mcp-tools-cli- Clone and navigate to the project:
git clone git@github.com:DLesmes/mcp_server.git
cd mcp_server- Create virtual environment:
uv venv- Activate virtual environment:
# Windows
.venv\Scripts\activate# macOS/Linux
source .venv/bin/activate- Install dependencies:
uv pip install -r requirements.txt- Run the server:
uv run python server.py- Create virtual environment:
python -m venv .venv- Activate virtual environment:
# Windows
.venv\Scripts\activate# macOS/Linux
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Run the server:
python server.pyTest your MCP server using the command line interface.
uvx mcp-tools-cli list-tools --mcp-name local_demo --config-path .\mcp_config.jsonuvx mcp-tools-cli call-tool --% --mcp-name local_demo --tool-name add --tool-args {"a":1,"b":2} --config-path .\mcp_config.jsonuvx mcp-tools-cli call-tool --mcp-name local_demo --tool-name add --tool-args a=1,b=2 --config-path .\mcp_config.jsonuvx mcp-tools-cli call-tool --% --mcp-name local_demo --tool-name add --tool-args {a:1,b:2} --config-path .\mcp_config.jsonuvx mcp-tools-cli list-tools --mcp-name local_demo --config-path ./mcp_config.jsonuvx mcp-tools-cli call-tool --mcp-name local_demo --tool-name add --tool-args '{"a":1,"b":2}' --config-path ./mcp_config.jsonuvx mcp-tools-cli call-tool --mcp-name local_demo --tool-name add --tool-args 'a=1,b=2' --config-path ./mcp_config.jsonuvx mcp-tools-cli call-tool --mcp-name local_demo --tool-name add --tool-args '{a:1,b:2}' --config-path ./mcp_config.jsonFor a more interactive experience, test your MCP server with Claude Desktop:
-
Configure Claude Desktop:
- Copy the contents of
claude_desktop_config_wd.json(Windows) orclaude_desktop_config_wsl.json(WSL) - Update the file paths and API keys in the config
- Add the config to your Claude Desktop settings
- Copy the contents of
-
Start Claude Desktop and you'll see your MCP server available as a tool
-
Test the tool by asking Claude to use the
addfunction:"Can you add 5 and 3 using the add tool?"
We welcome contributions! Here's how you can help:
- Fork the repository ๐ด
- Create a feature branch ๐ฟ
git checkout -b feature/amazing-feature
- Make your changes โ๏ธ
- Test your changes ๐งช
- Commit your changes ๐พ
git commit -m "Add amazing feature" - Push to the branch ๐
git push origin feature/amazing-feature
- Open a Pull Request ๐
- Keep it simple and educational ๐
- Add clear comments to code ๐ฌ
- Test all changes thoroughly โ
- Update documentation as needed ๐
- Issues: GitHub Issues ๐
- Discussions: GitHub Discussions ๐ฌ
- Email: your-email@example.com ๐ง
Happy MCP Development! ๐
This project is designed to be a quick and easy introduction to MCP servers. Perfect for beginners who want to understand the basics without getting overwhelmed by complex tooling.