Cover image
Try Now
2025-04-04

Client du serveur MCP avec des outils de base

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

MCP Server with Gemini AI Integration

This project implements a Multi-Component Platform (MCP) server with Gemini AI integration, allowing users to perform various mathematical operations and complex tasks through natural language commands.

Features

  • Mathematical Operations

    • Basic arithmetic (add, subtract, multiply, divide)
    • Advanced math (power, square root, cube root)
    • Special functions (factorial, log, trigonometric functions)
    • List operations (sum of list, exponential sum)
  • String Processing

    • Convert strings to ASCII values
    • Process character arrays
  • Keynote Integration

    • Open Keynote application
    • Draw rectangles with custom dimensions
    • Add text to shapes
  • AI-Powered Task Execution

    • Natural language processing using Gemini AI
    • Iterative problem solving
    • Automatic tool selection based on user queries

Prerequisites

  • Python 3.8 or higher
  • Google Gemini API key
  • macOS (for Keynote integration)

Installation

  1. Clone the repository:
git clone <repository-url>
cd <repository-name>
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file in the project root and add your Gemini API key:
GEMINI_API_KEY=your_api_key_here

Project Structure

  • mcp_server.py: Contains the MCP server implementation and tool definitions
  • talk2mcp.py: Client application that interfaces with the MCP server and Gemini AI
  • .env: Configuration file for API keys
  • requirements.txt: Project dependencies

Usage

You can start the application in two ways:

Option 1: Start Server and Client Separately

  1. Start the MCP server in one terminal:
python mcp_server.py
  1. In another terminal, run the client application:
python talk2mcp.py

Option 2: Start Client Only (Recommended)

The client application can automatically start the server if it's not already running. Simply run:

python talk2mcp.py

The client will:

  1. Check if the server is running
  2. Start the server if needed
  3. Establish connection automatically
  4. Prompt for your query

Using the Application

  1. Enter your query when prompted. Examples:

    • "Add 5 and 3"
    • "Find the ASCII values of characters in INDIA"
    • "Start keynote app and draw a rectangle of size 300x400"
    • "Calculate the factorial of 5"
  2. Type 'exit' to quit the application.

Note: When using Option 2, the server will automatically shut down when you exit the client application.

Available Tools

The system provides the following tools:

  1. Mathematical Tools

    • add(a: int, b: int): Add two numbers
    • subtract(a: int, b: int): Subtract two numbers
    • multiply(a: int, b: int): Multiply two numbers
    • divide(a: int, b: int): Divide two numbers
    • power(a: int, b: int): Calculate power
    • sqrt(a: int): Calculate square root
    • cbrt(a: int): Calculate cube root
    • factorial(a: int): Calculate factorial
    • log(a: int): Calculate logarithm
    • sin(a: int), cos(a: int), tan(a: int): Trigonometric functions
  2. String Processing Tools

    • strings_to_chars_to_int(string: str): Convert string to ASCII values
    • int_list_to_exponential_sum(int_list: list): Calculate sum of exponentials
  3. Keynote Tools

    • open_keynote(): Open Keynote application
    • draw_rectangle_in_keynote(shapeWidth: int, shapeHeight: int): Draw rectangle
    • add_text_to_keynote_shape(text: str): Add text to shape

Demo

Watch a demo of the MCP Server with Gemini AI integration in action:

MCP Server Demo

Click the image above to watch the demo video on YouTube.

Error Handling

The system includes comprehensive error handling:

  • Timeout handling for AI responses
  • Type conversion validation
  • Tool availability checking
  • Parameter validation

Debugging

Debug information is printed to the console, including:

  • Tool execution details
  • Parameter processing
  • Result formatting
  • Error messages and stack traces

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Google Gemini AI for natural language processing capabilities
  • MCP framework for tool management
  • Python community for various libraries used in this project

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • tomoyoshi hirata
  • Sony α7IIIマニュアルアシスタント

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • jae-jae
  • MCP Server pour récupérer le contenu de la page Web à l'aide du navigateur sans tête du dramwright.

  • ravitemer
  • Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)

  • patruff
  • Pont entre les serveurs Olllama et MCP, permettant aux LLM locaux d'utiliser des outils de protocole de contexte de modèle

  • Sysc4lls
  • Lecteur de documentation IDA (Sort-of) MCP Server

  • pontusab
  • La communauté du curseur et de la planche à voile, recherchez des règles et des MCP

  • JackKuo666
  • 🔍 Permettre aux assistants d'IA de rechercher et d'accéder aux informations du package PYPI via une interface MCP simple.

  • av
  • Exécutez sans effort LLM Backends, API, Frontends et Services avec une seule commande.

    Reviews

    3 (1)
    Avatar
    user_AAFiRrYb
    2025-04-17

    The EAGS4-MCP-Server-Client by walnashgit is a robust solution for seamless server-client communication. This product is impressive in its efficiency and ease of integration, allowing both experienced developers and beginners to utilize its functionalities effectively. Its comprehensive documentation is another advantage, making setup and usage straightforward. Highly recommend this for anyone needing reliable server-client interaction. Check it out here: https://github.com/walnashgit/EAGS4-MCP-Server-Client