Math MCP Server for MacOS

Math MCP Server for MacOS

Implements a math agent using Model Control Protocol that performs mathematical calculations and visually presents results in Keynote, enabling drawing shapes and adding text to slides.

Category
Visit Server

README

Introduction to MCP; Draw & Add Text to Keynote on MacOS

This project implements a math agent using Model Control Protocol (MCP) that can perform mathematical calculations and present results visually in Keynote on macOS. The agent can draw shapes and add text to Keynote slides, making it useful for creating mathematical presentations.

Features

  • Mathematical operations (addition, subtraction, multiplication, division, etc.)
  • Advanced mathematical functions (factorial, logarithms, trigonometric functions)
  • ASCII value calculations and exponential sum operations
  • Visual presentation in Keynote:
    • Drawing rectangles
    • Adding text to slides
    • Automatic slide management

Prerequisites

  • Python 3.x
  • macOS (for Keynote integration)
  • Keynote installed on your system
  • Google Gemini API key

Installation

  1. Clone the repository:
git clone <your-repository-url>
cd keynote-drawing-text
  1. Install required 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 server implementation with mathematical tools and Keynote integration
  • mcp-client.py: Implements the client that communicates with the LLM and manages the workflow
  • requirements.txt: Lists all Python dependencies

Usage

The client script (mcp-client.py) automatically handles the MCP server startup and communication. You only need to run the client with your query:

python mcp-client.py "Your mathematical query here"

For example:

python mcp-client.py "Find the ASCII values of characters in INDIA and then return sum of exponentials of those values"

If no query is provided, the script will use a default query mentioned in the above example.

The client will:

  1. Automatically start the MCP server in the background
  2. Open Keynote and create a new document
  3. Perform the requested mathematical operations
  4. Draw a rectangle on the slide
  5. Add the result as text within the rectangle

Note: The MCP server is managed internally by the client script, so you don't need to start it manually. The server handles all the mathematical operations and Keynote interactions, while the client manages the communication with the language model and orchestrates the overall workflow.

Available Mathematical Tools

  • Basic Operations:

    • Addition (add)
    • Subtraction (subtract)
    • Multiplication (multiply)
    • Division (divide)
    • Power (power)
    • Square root (sqrt)
    • Cube root (cbrt)
  • Advanced Operations:

    • Factorial (factorial)
    • Natural logarithm (log)
    • Remainder (remainder)
    • Trigonometric functions (sin, cos, tan)
    • Fibonacci sequence (fibonacci_numbers)
    • ASCII value calculations (strings_to_chars_to_int)
    • Exponential sum (int_list_to_exponential_sum)

Keynote Integration

The project includes tools for Keynote integration:

  • mac_open_keynote: Opens Keynote and creates a new document
  • mac_draw_rectangle: Draws a rectangle on the current slide
  • mac_add_text_in_keynote: Adds text to the current slide

Error Handling

The system includes comprehensive error handling for:

  • API communication issues
  • Invalid mathematical operations
  • Keynote integration problems
  • Timeout handling for LLM responses

Tools

  • Model Control Protocol (MCP) for the framework
  • Google Gemini for the language model
  • Apple Keynote for the presentation platform

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured