The Model Context Protocol (MCP) server provides AI assistants with access to InboxAI's email management capabilities.
# From the InboxAI project root
uv run python src/mcp_server.pyThe server will start and be available for MCP client connections.
Add this to your Claude Desktop MCP configuration:
{
"mcpServers": {
"inboxai": {
"command": "uv",
"args": ["run", "python", "/path/to/InboxAI/src/mcp_server.py"],
"cwd": "/path/to/InboxAI"
}
}
}Purpose: Fetch and categorize emails with AI-powered summaries
Parameters:
time_window(string, default: "24h"): Time window to fetch emails from- Examples: "24h", "7d", "12h", "3d"
Returns: Formatted markdown string with email summaries by category
Example:
result = summarise_emails_mcp("24h")
# Returns categorized email summariesPurpose: Send intelligent replies to emails
Parameters:
email_id(string): ID of the email to reply toreply_text(string, optional): Custom reply textauto_generate(boolean, default: False): Auto-generate reply using AItone(string, default: "professional"): Tone for auto-generated replies- Options: "professional", "casual", "friendly", "formal"
Returns: Success message or error description
Examples:
# Send custom reply
reply_to_email_mcp("email_123", "Thank you for your message!")
# Auto-generate professional reply
reply_to_email_mcp("email_123", auto_generate=True, tone="professional")
# Auto-generate casual reply
reply_to_email_mcp("email_123", auto_generate=True, tone="casual")Purpose: Generate multiple reply suggestions for an email
Parameters:
email_id(string): ID of the email to generate suggestions fornum_suggestions(integer, default: 3): Number of reply options to generate
Returns: Formatted string with multiple reply suggestions
Example:
suggestions = get_email_suggestions("email_123", 3)
# Returns 3 different reply options with different tonesPurpose: Run the complete InboxAI workflow using LangGraph
Parameters:
time_window(string, default: "24h"): Time window to process emails from
Returns: Complete formatted email processing results
Example:
result = process_inbox_full("7d")
# Returns full inbox analysis with categories and summariesOnce configured, you can use these commands in Claude Desktop:
Please summarize my emails from the last 24 hours using InboxAI.
Reply to email ID email_123 with a professional tone saying I'll review the proposal.
Generate 3 different reply suggestions for email email_456.
from mcp_server import mcp
# Your AI assistant can call these tools directly
async def handle_email_request(time_window="24h"):
# Get email summaries
summaries = await mcp.call_tool("summarise_emails_mcp", {"time_window": time_window})
# Process the results
return summariesEnsure you have these configured:
- Gmail API Credentials:
credentials.jsonin project root - Google AI API Key: Set in
.envfile asGOOGLE_API_KEY - Dependencies: Install with
uv add mcp
The MCP server requires:
mcp>=1.10.0- Model Context Protocollangchain[google-genai]>=0.3.26- AI integrationlanggraph>=0.4.10- Workflow orchestrationgoogle-api-python-client>=2.161.0- Gmail API
- All email processing happens locally
- Only classification/summarization uses external AI API (Google Gemini)
- OAuth credentials are stored securely
- No email content is stored permanently
"Import mcp.server.fastmcp could not be resolved"
uv add mcp"API key not valid"
- Check your
GOOGLE_API_KEYin.env - Ensure you're using a Google AI Studio API key
"Credentials file not found"
- Place
credentials.jsonin the project root - Ensure Gmail API is enabled in Google Cloud Console
MCP Server Not Starting
# Check if the server script runs
uv run python src/mcp_server.py
# Check dependencies
uv syncEnable verbose logging:
export LOG_LEVEL=DEBUG
uv run python src/mcp_server.py- Main README - Full project documentation
- Setup Guide - Installation instructions
- MCP Official Docs - MCP specification
Note: The MCP server provides a bridge between AI assistants and InboxAI's email management capabilities, enabling intelligent email processing through natural language commands.