System · MODEL CONTEXT PROTOCOL
rohinigaonkar mcp math macos
MCP for Math and MacOS operation
连接能力
rohinigaonkar mcp math macos 为 AI Agent 提供什么
- 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
- Python 3.x
- macOS (for Keynote integration)
- Keynote installed on your system
- Google Gemini API key
- Clone the repository:
- Install required dependencies:
- Create a `.env` file in the project root and add your Gemini API key:
- `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
- Automatically start the MCP server in the background
- Open Keynote and create a new document
- Perform the requested mathematical operations
- Draw a rectangle on the slide
- Add the result as text within the rectangle
- 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`)
- `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
- API communication issues
- Invalid mathematical operations
- Keynote integration problems
- Timeout handling for LLM responses
- Model Control Protocol (MCP) for the framework
- Google Gemini for the language model
- Apple Keynote for the presentation platform
安全
MCP 收录不等于安全审核
MCP 服务器可能获得模型上下文、凭据、本地文件或调用外部系统的权限。连接 Agent 前,请检查代码、环境变量、网络行为、软件包来源与维护状态。
README
仓库文档
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.
- 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
- Python 3.x
- macOS (for Keynote integration)
- Keynote installed on your system
- Google Gemini API key
- Clone the repository:
git clone <your-repository-url>
cd keynote-drawing-text- Install required dependencies:
pip install -r requirements.txt- Create a
.envfile in the project root and add your Gemini API key:
GEMINI_API_KEY=your_api_key_here
mcp-server.py: Contains the server implementation with mathematical tools and Keynote integrationmcp-client.py: Implements the client that communicates with the LLM and manages the workflowrequirements.txt: Lists all Python dependencies
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:
- Automatically start the MCP server in the background
- Open Keynote and create a new document
- Perform the requested mathematical operations
- Draw a rectangle on the slide
- 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.
-
Basic Operations:
- Addition (
add) - Subtraction (
subtract) - Multiplication (
multiply) - Division (
divide) - Power (
power) - Square root (
sqrt) - Cube root (
cbrt)
- Addition (
-
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)
- Factorial (
The project includes tools for Keynote integration:
mac_open_keynote: Opens Keynote and creates a new documentmac_draw_rectangle: Draws a rectangle on the current slidemac_add_text_in_keynote: Adds text to the current slide
The system includes comprehensive error handling for:
- API communication issues
- Invalid mathematical operations
- Keynote integration problems
- Timeout handling for LLM responses
- Model Control Protocol (MCP) for the framework
- Google Gemini for the language model
- Apple Keynote for the presentation platform
Contributions are welcome! Please feel free to submit a Pull Request.
社区