Introduction
Ever wanted to integrate ChatGPT with Claude and other AI tools without dealing with API keys or wasting your monthly subscription?
Instead of the traditional API approach, I solved this challenge using macOS Shortcuts - an unexpected solution that combines existing resource utilization, security, cost efficiency, and simplicity in one innovative approach.
Today, I'll share how I built an MCP server that integrates the Model Context Protocol (MCP) with macOS Shortcuts to solve this exact problem.
What I Built
This MCP server enables communication with ChatGPT through the macOS ChatGPT app and Apple Shortcuts, completely bypassing the need for API keys.
The Problems We're Solving
Many developers face these common challenges:
๐ฐ Cost Issues
- Expensive API usage: Heavy tasks can result in unexpected billing charges
- Wasted subscriptions: ChatGPT Plus costs $20/month but can't be used via API
๐ Claude Code Limitations
- Infinite debugging loops: Weaker LLMs get stuck repeating the same fixes endlessly, never completing tasks
The Core Innovation: Leveraging macOS Shortcuts
The key breakthrough was utilizing macOS Shortcuts functionality.
Why This Approach is Revolutionary
- Leverage Existing Resources: Maximize your already-paid ChatGPT Plus subscription
- Enhanced Security: No API key management required
- Cost Effective: Zero additional integration costs
- Simplicity: Uses only macOS standard functionality
How It Works
The system uses a temporary file-based communication pattern to pass prompts to the shortcuts system, then processes responses back through the MCP protocol.
Key Benefits: Solving Claude Code's Weaknesses
The biggest advantage of this MCP server is compensating for Claude Code's limitations.
Claude Code's Challenges
While Claude Code is an excellent tool, it has some issues:
- Band-aid coding: Applies quick fixes without considering fundamental design
- Debug loops: Gets stuck repeating similar fixes indefinitely
- Rigid thinking: Fixates on one approach, unable to consider alternatives
Rescue with ChatGPT o3
When Claude Code gets stuck in a loop, you can consult ChatGPT o3 via this MCP server:
Ask ChatGPT: "This code has a bug with โโ, but Claude Code keeps repeating similar fixes. What's the fundamental solution?"
This provides:
- Different perspective: Analysis from a different angle than Claude
- Root cause identification: Understanding essential problems, not just surface issues
- Design-level suggestions: Architectural approaches that rethink the problem
Real Usage Example
When Claude Code gets stuck in loops, using this MCP server to consult ChatGPT o3 gives you:
- Different perspective: Analysis from a different angle than Claude
- Root cause identification: Understanding essential problems, not just surface issues
- Design-level suggestions: Architectural approaches that rethink the problem
Usage
1. Prerequisites
# Install ChatGPT app (official from OpenAI)
# Set up "Ask ChatGPT on Mac" shortcut
2. Global Installation
claude mcp add chatGPTOnMac -s user \
-- npx mcp-server-chatgpt-mac-app
3. Project-Local Setup
// .mcp.json
{
"mcpServers": {
"chatGPTOnMac": {
"command": "npx",
"args": ["mcp-server-chatgpt-mac-app"],
"cwd": ".",
"env": {}
}
}
}
How It Works in Practice
You can give Claude natural instructions like:
Ask ChatGPT: "What's the best way to optimize this code?"
The flow:
- MCP server writes prompt to temporary file
- macOS shortcut executes
- Shortcut sends prompt to ChatGPT app
- ChatGPT response returns via Claude
Key Learnings
Power of macOS Automation
macOS Shortcuts proved more powerful than expected:
-
CLI invocation:
shortcuts run
command available -
File input:
-i
option enables file-based input - App integration: Tight integration with third-party applications
MCP Protocol Flexibility
I gained real appreciation for the Model Context Protocol design:
- Pluggable: Easy to add new functionality
- Type-safe: Robust schema definitions
- Standardized: Consistency across different AI tools
Conclusion
This project reinforced the importance of "maximizing existing resources through creative engineering." Without using API keys, we achieved cost-effective and secure ChatGPT integration by leveraging Apple Shortcuts - a standard system feature.
If you're paying for monthly subscriptions but still paying separate API fees, this approach is definitely worth trying!
Links
- GitHub Repository: https://github.com/yimajo/mcp-server-chatgpt-mac-app
- NPM Package: https://www.npmjs.com/package/mcp-server-chatgpt-mac-app
- Original Python Version: https://github.com/cdpath/mcp-server-chatgpt-app
Top comments (0)