An MCP server for integrating with the Claude Desktop application on macOS. Requires the Claude Desktop app to be installed and configured.
A Model Context Protocol (MCP) server that enables Claude Code to communicate with Claude Desktop. This server allows Claude Code to send prompts to Claude Desktop and poll for responses.
Inspired by claude-chatgpt-mcp, this project adapts the concept for Apple's ecosystem using native macOS automation.
You can install and use this MCP server in two ways:
The simplest way to use this server is directly with npx, without any installation:
{
"mcpServers": {
"claude-desktop": {
"command": "npx",
"args": ["mcp-claude-desktop"]
}
}
}
git clone https://github.com/dpaluy/mcp-claude-desktop
cd mcp-claude-desktop
npm install
npm run build
{
"mcpServers": {
"claude-desktop": {
"command": "node",
"args": ["/path/to/mcp-claude-desktop/dist/index.js"]
}
}
}
This MCP server provides two tools:
ask
prompt
: The text to send to Claude Desktop (required)conversationId
: Optional ID to continue a specific conversationtimeout
: Response timeout in seconds (optional, default: 30, max: 300)pollingInterval
: How often to check for response in seconds (optional, default: 1.5, min: 0.5)get_conversations
Once configured, Claude Code can use the MCP in various ways:
When Claude uses these tools, it will call them with parameters like:
Basic usage:
ask
{ "prompt": "What is dependency injection?" }
With custom timeout:
ask
{ "prompt": "Explain quantum computing", "timeout": 120 }
With both timeout and polling interval:
ask
{ "prompt": "Quick question", "timeout": 10, "pollingInterval": 0.5 }
Get conversations:
get_conversations
{}
Once the MCP server is configured and running, you can use these tools directly in Claude:
Basic usage:
With custom timeout:
Important: The MCP server configuration (shown above) only tells Claude how to start the server. The timeout and pollingInterval parameters are specified when you use the tool in Claude, not in the server configuration file.
Due to Claude Desktop's Electron-based architecture, this MCP integration cannot read Claude's responses programmatically. The tool can successfully:
This is a limitation of how Electron apps expose UI elements through accessibility APIs. When you use the ask
tool, you'll receive a confirmation that the message was sent, but you'll need to check the Claude Desktop window directly to see the response.
Claude Commands allow you to create reusable workflows that combine MCP tools. This project works seamlessly with Claude Commands to enable powerful automation.
We've included an example Claude Command that demonstrates how to use MCP Claude Desktop for automated code reviews. The command uses git to analyze recent changes and sends them to Claude Desktop for peer review feedback.
Copy the example command to your Claude Commands directory:
cp examples/claude-peer-review.md ~/.claude/commands/
The command will be available in Claude Code as /claude-peer-review
The peer review command accepts up to 3 arguments:
Examples:
# Review most recent commit with defaults
/claude-peer-review
# Review with description
/claude-peer-review "bug fix for user login"
# Custom polling interval (2 seconds)
/claude-peer-review "API update" 2
# Custom timeout for complex reviews (2 minutes)
/claude-peer-review "major refactor" 1.5 120
Git Integration: The command automatically fetches:
Claude Desktop Review: Sends the changes to Claude Desktop with specific review questions:
Response Handling: Uses the MCP server's polling mechanism to wait for Claude's response
Summary Generation: Provides a structured summary of:
You can create custom Claude Commands that leverage MCP Claude Desktop. Commands should:
Include the tools in the frontmatter:
---
allowed-tools: mcp__claude-desktop__ask, mcp__claude-desktop__get_conversations
---
Use the MCP tools with appropriate parameters:
mcp__claude-desktop__ask
prompt: "Your prompt here"
timeout: 60
pollingInterval: 2
Handle timeouts gracefully and suggest longer timeouts for complex queries
See the example command for a complete implementation.
npm run dev
npm test
npm run lint
npm run typecheck
ask
Send a prompt to Claude Desktop and get a response.
Parameters:
prompt
(string, required): The prompt to sendconversationId
(string, optional): Continue a specific conversationtimeout
(number, optional): Response timeout in seconds
pollingInterval
(number, optional): How often to check for response in seconds
Response:
String containing Claude's response
get_conversations
Get a list of available conversations in Claude Desktop.
Parameters: None
Response:
{
conversations: string[];
timestamp: string;
}
The MCP server uses AppleScript to communicate with Claude Desktop:
"AppleScript execution failed"
LOG_LEVEL=3
"Response timed out"
timeout: 60
(60 seconds)timeout: 120
(2 minutes)pollingInterval: 0.5
"Permission denied"
MCP Server Crashes After Sending Requests If the MCP server crashes after handling requests, you can:
Disable response polling (recommended for stability):
export SKIP_CLAUDE_POLLING=true
This will send the message to Claude Desktop but won't try to read the response.
Enable debug logging to see what's happening:
export LOG_LEVEL=3
Check stderr output - All logs are now written to stderr to avoid interfering with the MCP protocol on stdout.
Response polling can occasionally cause instability due to:
Consider using SKIP_CLAUDE_POLLING=true
for more reliable operation if you don't need response reading.
We welcome contributions to MCP Claude Desktop! Whether you're fixing bugs, adding features, or improving documentation, your help is appreciated.
git clone https://github.com/YOUR_USERNAME/mcp-claude-desktop
cd mcp-claude-desktop
npm install
git checkout -b feature/your-feature-name
npm test
npm run lint
npm run typecheck
npm run build
git commit -m "feat: add support for conversation history"
git push origin feature/your-feature-name
MIT
Converts Markdown text into HTML compatible with WeChat official accounts using an external API key.
A gateway for the Wise API to manage recipients, requiring a Wise API token.
Automate your local browser
Integrate with the Goodday project management platform to manage projects, tasks, and users via its API.
Automate desktop actions like mouse control, keyboard input, and taking screenshots.
A multi-model agent for managing tasks across various platforms, requiring API keys for different AI models.
An MCP server that provides system information, such as CPU and memory usage.
An MCP server for managing tasks with the command-line tool TaskWarrior.
Manage and interact with Google Calendar events using the Google Calendar API.
Integrates with Jira's REST API to manage issues programmatically.