Sponsored by Deepsite.site

Custom MCP Server with Enhanced Tools

Created By
suh4s8 months ago
Content

Custom MCP Server with Enhanced Tools

This project demonstrates a powerful MCP (Model Context Protocol) server with 5 custom tools that extend AI assistant capabilities directly in Cursor. Built on the foundation of the AI Makerspace MCP framework, this server includes web search, utility tools, and content generation capabilities.

🚀 Features

Available Tools:

🔍 Web Search - Search the web using Tavily API integration
🎲 Dice Roller - Roll dice with custom notation (e.g., 2d20k1)
📱 QR Code Generator - Generate QR codes for any text or URL
🔄 Unit Converter - Convert between different units (length, weight, temperature, volume)
🔗 URL Shortener - Shorten URLs using TinyURL or is.gd services

Project Overview

The MCP server integrates seamlessly with Cursor through the Model Context Protocol, providing instant access to powerful tools directly within your AI assistant. The server is designed to run in standard input/output (stdio) transport mode and includes:

  • TavilyClient: Web search capabilities using the Tavily API
  • QR Code Generation: Base64 encoded QR codes using the qrcode library
  • Unit Conversion: Comprehensive unit conversion with manual temperature handling
  • URL Shortening: Multiple service support (TinyURL, is.gd)
  • Dice Rolling: Advanced dice notation with keep-highest functionality

Prerequisites

  • Python 3.13 or higher
  • A valid Tavily API key
  • UV package manager (for dependency management)

⚠️NOTE FOR WINDOWS:⚠️

You'll need to install this on the Windows side of your OS.

This will require getting two CLI tool for Powershell, which you can do as follows:

  • winget install astral-sh.uv
  • winget install --id Git.Git -e --source winget

After you have those CLI tools, please open Cursor into Windows.

Installation

  1. Clone the repository:

    git clone https://github.com/suh4s/my-mcp-server.git
    cd my-mcp-server
    
  2. Install dependencies:

    uv sync
    
  3. Configure environment variables: Create a .env file and add your Tavily API key:

    TAVILY_API_KEY=your_api_key_here
    

Running the MCP Server

To start the MCP server, you will need to add the following to your MCP Profile in Cursor:

NOTE: To get to your MCP config, use the Command Palette (CMD/CTRL+SHIFT+P) and select "View: Open MCP Settings" and replace the contents with the JSON configuration below.

{
    "mcpServers": {
        "mcp-server": {
            "command": "uv",
            "args": ["--directory", "/FULL/PATH/TO/YOUR/REPOSITORY", "run", "server.py"]
        }
    }
}

The server will start and listen for commands via standard input/output.

🛠️ Tool Usage Examples

QR Code Generator

"Generate a QR code for 'Hello World'"
"Create a QR code for https://github.com/suh4s/my-mcp-server"

Unit Converter

"Convert 100 fahrenheit to celsius"
"Convert 5 miles to kilometers"
"Convert 2 pounds to grams"

URL Shortener

"Shorten this URL: https://github.com/suh4s/my-mcp-server"
"Shorten https://example.com using is.gd"

Dice Roller

"Roll 2d20k1" (roll 2 20-sided dice, keep highest)
"Roll 3d6" (roll 3 6-sided dice)
"Search for 'MCP protocol documentation'"
"Find recent AI news"

🔧 Technical Implementation

Dependencies:

  • mcp[cli] - Model Context Protocol framework
  • tavily-python - Web search API integration
  • qrcode + pillow - QR code generation
  • pint - Unit conversion library
  • requests - HTTP requests for URL shortening
  • python-dotenv - Environment variable management

Architecture:

  • FastMCP Server: Handles tool registration and protocol communication
  • Tool Functions: Decorated with @mcp.tool() for automatic discovery
  • Error Handling: Comprehensive error handling with helpful messages
  • Type Safety: Full type hints for all tool parameters

🎯 Advanced Features

  • Temperature Conversion: Custom formulas to handle Fahrenheit/Celsius conversions
  • QR Code Customization: Adjustable size and border parameters
  • Multiple URL Services: TinyURL and is.gd support with fallback handling
  • Dice Notation: Support for complex dice expressions with keep-highest logic

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

Acknowledgments

Built as part of the AI Makerspace MCP Session. Original framework by AI-Maker-Space.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
WindsurfThe new purpose-built IDE to harness magic
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Playwright McpPlaywright MCP server
Tavily Mcp
Serper MCP ServerA Serper MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Amap Maps高德地图官方 MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
ChatWiseThe second fastest AI chatbot™
CursorThe AI Code Editor
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
DeepChatYour AI Partner on Desktop