Skip to content

A ver basic MCP server that simulate the tool for a OCR sistem

License

Notifications You must be signed in to change notification settings

DLesmes/mcp_server

Repository files navigation

๐Ÿš€ MCP Server Demo

๐Ÿ“‹ Overview

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.

โœจ Features

  • ๐Ÿงฎ 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

๐Ÿ“‹ Prerequisites

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) ๐Ÿ”ง

Installing UV (Recommended)

# Windows (PowerShell)
irm https://astral.sh/uv/install.ps1 | iex

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

Installing mcp-tools-cli

# Using UV
uvx mcp-tools-cli --help

# Using pip
pip install mcp-tools-cli

๐Ÿš€ Quick Start

  1. Clone and navigate to the project:
git clone git@github.com:DLesmes/mcp_server.git
cd mcp_server

Option 1: Using UV (Recommended) โšก

  1. Create virtual environment:
uv venv
  1. Activate virtual environment:
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
  1. Install dependencies:
uv pip install -r requirements.txt
  1. Run the server:
uv run python server.py

Option 2: Using Pure Python ๐Ÿ

  1. Create virtual environment:
python -m venv .venv
  1. Activate virtual environment:
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the server:
python server.py

๐Ÿงช Testing

CLI Testing with mcp-tools-cli ๐Ÿ”ง

Test your MCP server using the command line interface.

Windows Console Testing ๐ŸชŸ

Listing tools
uvx mcp-tools-cli list-tools --mcp-name local_demo --config-path .\mcp_config.json
Calling tools - Proper JSON Format
uvx mcp-tools-cli call-tool --% --mcp-name local_demo --tool-name add --tool-args {"a":1,"b":2} --config-path .\mcp_config.json
Calling tools - Key-value pairs
uvx mcp-tools-cli call-tool --mcp-name local_demo --tool-name add --tool-args a=1,b=2 --config-path .\mcp_config.json
Calling tools - Simplified JSON
uvx mcp-tools-cli call-tool --% --mcp-name local_demo --tool-name add --tool-args {a:1,b:2} --config-path .\mcp_config.json

WSL Console Testing ๐Ÿง

Listing tools
uvx mcp-tools-cli list-tools --mcp-name local_demo --config-path ./mcp_config.json
Calling tools - Proper JSON Format
uvx mcp-tools-cli call-tool --mcp-name local_demo --tool-name add --tool-args '{"a":1,"b":2}' --config-path ./mcp_config.json
Calling tools - Key-value pairs
uvx mcp-tools-cli call-tool --mcp-name local_demo --tool-name add --tool-args 'a=1,b=2' --config-path ./mcp_config.json
Calling tools - Simplified JSON
uvx mcp-tools-cli call-tool --mcp-name local_demo --tool-name add --tool-args '{a:1,b:2}' --config-path ./mcp_config.json

Claude Desktop Testing ๐Ÿ–ฅ๏ธ

For a more interactive experience, test your MCP server with Claude Desktop:

  1. Configure Claude Desktop:

    • Copy the contents of claude_desktop_config_wd.json (Windows) or claude_desktop_config_wsl.json (WSL)
    • Update the file paths and API keys in the config
    • Add the config to your Claude Desktop settings
  2. Start Claude Desktop and you'll see your MCP server available as a tool

  3. Test the tool by asking Claude to use the add function:

    "Can you add 5 and 3 using the add tool?"
    

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  1. Fork the repository ๐Ÿด
  2. Create a feature branch ๐ŸŒฟ
    git checkout -b feature/amazing-feature
  3. Make your changes โœ๏ธ
  4. Test your changes ๐Ÿงช
  5. Commit your changes ๐Ÿ’พ
    git commit -m "Add amazing feature"
  6. Push to the branch ๐Ÿš€
    git push origin feature/amazing-feature
  7. Open a Pull Request ๐Ÿ“

Development Guidelines

  • Keep it simple and educational ๐Ÿ“š
  • Add clear comments to code ๐Ÿ’ฌ
  • Test all changes thoroughly โœ…
  • Update documentation as needed ๐Ÿ“–

๐Ÿ“ž Contact


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.

About

A ver basic MCP server that simulate the tool for a OCR sistem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages