Labsco
dpaluy logo

Claude Assist MCP

โ˜… 1

from dpaluy

Enables communication between Claude Code and Claude Desktop for code reviews.

๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

MCP Claude Desktop

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.

Features

  • Send prompts from Claude Code to Claude Desktop
  • Automatic polling for responses with configurable timeout
  • List available conversations in Claude Desktop
  • Error handling and retry logic
  • Comprehensive logging

MCP Tools

This MCP server provides two tools:

ask

  • Purpose: Send a prompt to Claude Desktop and get a response
  • Parameters:
    • prompt: The text to send to Claude Desktop (required)
    • conversationId: Optional ID to continue a specific conversation
    • timeout: 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

  • Purpose: Get a list of available conversations in Claude Desktop
  • Parameters: None

Claude Commands Integration

Claude Commands allow you to create reusable workflows that combine MCP tools. This project works seamlessly with Claude Commands to enable powerful automation.

Example: Code Peer Review Command

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.

Setup

  1. Copy the example command to your Claude Commands directory:

    cp examples/claude-peer-review.md ~/.claude/commands/
  2. The command will be available in Claude Code as /claude-peer-review

Usage

The peer review command accepts up to 3 arguments:

  • description: What changes to review (e.g., "authentication fix")
  • polling_interval: How often to check for response (default: 1.5s)
  • timeout: Maximum wait time for response (default: 30s)

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

How It Works

  1. Git Integration: The command automatically fetches:

    • Current git status
    • Recent commit statistics
    • Full diff of changes
    • Current branch name
  2. Claude Desktop Review: Sends the changes to Claude Desktop with specific review questions:

    • Code appropriateness and implementation quality
    • Security concerns or potential bugs
    • Code quality and best practices
    • Suggestions for improvements
  3. Response Handling: Uses the MCP server's polling mechanism to wait for Claude's response

  4. Summary Generation: Provides a structured summary of:

    • Changes reviewed
    • Claude's feedback
    • Actions taken based on feedback
    • Final review status

Creating Your Own Commands

You can create custom Claude Commands that leverage MCP Claude Desktop. Commands should:

  1. Include the tools in the frontmatter:

    ---
    allowed-tools: mcp__claude-desktop__ask, mcp__claude-desktop__get_conversations
    ---
  2. Use the MCP tools with appropriate parameters:

    mcp__claude-desktop__ask
    prompt: "Your prompt here"
    timeout: 60
    pollingInterval: 2
  3. Handle timeouts gracefully and suggest longer timeouts for complex queries

See the example command for a complete implementation.

Development

Running in Development Mode

npm run dev

Running Tests

npm test

Linting

npm run lint

Type Checking

npm run typecheck

API

Tools

ask

Send a prompt to Claude Desktop and get a response.

Parameters:

  • prompt (string, required): The prompt to send
  • conversationId (string, optional): Continue a specific conversation
  • timeout (number, optional): Response timeout in seconds
    • Default: 30 seconds
    • Minimum: 1 second
    • Maximum: 300 seconds (5 minutes)
  • pollingInterval (number, optional): How often to check for response in seconds
    • Default: 1.5 seconds
    • Minimum: 0.5 seconds
    • Maximum: 10 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;
}

Architecture

The MCP server uses AppleScript to communicate with Claude Desktop:

  1. Claude Code sends a prompt via MCP
  2. AppleScript activates Claude Desktop and creates a new conversation
  3. The prompt is typed into Claude Desktop
  4. The server polls Claude Desktop for the response
  5. Once a response is detected, it's parsed and returned to Claude Code