Provides integration with Zoho CRM, offering tools for contact management (searching, creating, updating), deal management (searching, creating, listing), and user information retrieval. Supports full OAuth2 authentication and token management with Zoho CRM.
Zoho CRM MCP Server
A Model Context Protocol (MCP) server that provides seamless integration with Zoho CRM. This server exposes Zoho CRM functionality as MCP tools that can be used by AI assistants like Claude, GPT, and other MCP-compatible clients.
Features
- Full OAuth2 Authentication: Secure authentication with Zoho CRM using OAuth2 flow
- Environment Variables: Secure credential management using .env files
- Contact Management: Search, create, and update contacts
- Deal Management: Search, create, and list deals
- User Information: Get current user details
- STDIO Transport: Compatible with MCP clients using standard input/output
- Error Handling: Comprehensive error handling with clear error messages
- Token Management: Automatic access token refresh
- PyPI Ready: Installable via pip/uvx for easy distribution
Prerequisites
- Python 3.11 or higher
- Zoho CRM account with API access
- Zoho Developer Console app credentials
Installation
Option 1: Install from PyPI (Recommended)
Option 2: Install from Source
- Clone this repository:
- Install dependencies:
Setup
Step 1: Create Zoho Developer App
- Go to Zoho Developer Console
- Create a new "Server-based Applications" app
- Note down your
Client ID
andClient Secret
- Set redirect URI to
http://localhost:8080/callback
Step 2: Configure Environment Variables
Create a .env
file in your working directory:
Edit .env
with your credentials:
Authentication Setup
Before running the MCP server, you need to generate authentication tokens manually:
Step 1: Generate Tokens
Run the authentication helper to generate your tokens:
This will guide you through the OAuth flow:
Step 2: Add Tokens to .env File
Copy the generated tokens and add them to your .env
file:
⚠️ Important: Keep these tokens secure and never commit them to version control!
Running the MCP Server
Once your tokens are configured, you can run the server:
The server will validate your authentication and start:
Available MCP Tools
1. get_contact_by_email_tool
Search for a contact by email address.
Parameters:
email
(string): Email address to search for
Returns:
- Contact information including ID, name, phone, account, and timestamps
2. create_contact_tool
Create a new contact in Zoho CRM.
Parameters:
first_name
(string): Contact's first namelast_name
(string): Contact's last nameemail
(string): Contact's email addressphone
(string): Contact's phone number
Returns:
- Created contact ID and status
3. get_deal_by_name_tool
Search for a deal by name.
Parameters:
deal_name
(string): Name of the deal to search for
Returns:
- Deal information including ID, amount, stage, contacts, and dates
4. create_deal_tool
Create a new deal in Zoho CRM.
Parameters:
deal_name
(string): Name of the dealcontact_id
(string): ID of the associated contactstage
(string): Deal stage (e.g., 'Qualification', 'Proposal', 'Negotiation', 'Closed Won')amount
(float): Deal amount
Returns:
- Created deal ID and status
5. update_contact_tool
Update a specific field of an existing contact.
Parameters:
contact_id
(string): ID of the contact to updatefield
(string): Field name to update (e.g., 'Phone', 'Email', 'First_Name')value
(string): New value for the field
Returns:
- Update status and confirmation
6. list_open_deals_tool
List all open deals (excluding closed deals).
Parameters: None
Returns:
- Array of open deals with details
7. get_user_info_tool
Get current authenticated user information.
Parameters: None
Returns:
- User information including name, email, role, and profile
Usage with MCP Clients
Claude Desktop
Add this server to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Alternative configuration if installed locally:
Other MCP Clients
For other MCP-compatible clients, configure them to run:
Error Handling
The server provides comprehensive error handling:
- Authentication errors: Clear messages about missing or invalid credentials
- API errors: Detailed error messages from Zoho CRM API
- Network errors: Connection and timeout error handling
- Data validation: Input parameter validation
All errors are returned in a consistent format:
Security Considerations
Current Implementation (Development)
- Refresh tokens are stored in
.env
file (plain text) - Suitable for development and testing
Production Recommendations
- Store refresh tokens in encrypted database
- Use secure key management services (AWS KMS, Azure Key Vault, etc.)
- Implement token rotation policies
- Use environment variables for sensitive configuration
- Enable audit logging
- Implement rate limiting
Extending the Server
To add new tools:
- Add the function to
zoho_mcp/zoho_tools.py
: - Create MCP tool wrapper in
zoho_mcp/server.py
: - Update documentation
Troubleshooting
Common Issues
- "Missing .env file" error:
- Create a
.env
file in your working directory - Copy from
.env.example
and fill in your credentials
- Create a
- "Not authenticated" error:
- Run
zoho-mcp-auth
to set up authentication - Check that your
.env
file has valid credentials
- Run
- "Token refresh failed":
- Re-run the OAuth setup process
- Delete old tokens from
.env
and re-authenticate
- "API request failed":
- Verify your Zoho CRM permissions
- Check that the API domain is correct for your region
- "Contact/Deal not found":
- Verify the search criteria
- Check that the record exists in your CRM
Environment Variable Issues
- Missing environment variables:
- Ensure
ZOHO_CLIENT_ID
andZOHO_CLIENT_SECRET
are set in.env
- Check
.env.example
for the complete list
- Ensure
- Invalid credentials:
- Verify your
ZOHO_CLIENT_ID
andZOHO_CLIENT_SECRET
- Ensure they match your Zoho Developer Console app
- Verify your
- Wrong redirect URI:
- Ensure
ZOHO_REDIRECT_URI
matches your Zoho app configuration - Default should be
http://localhost:8080/callback
- Ensure
- Authentication flow issues:
- If authentication fails, delete
ZOHO_ACCESS_TOKEN
andZOHO_REFRESH_TOKEN
from.env
- Restart the server to trigger a fresh OAuth flow
- If authentication fails, delete
Debug Mode
For debugging, you can add logging to see API requests:
API Rate Limits
Zoho CRM has API rate limits:
- Free edition: 200 API calls per day
- Paid editions: Higher limits based on plan
The server doesn't implement rate limiting, so monitor your usage accordingly.
Support
For issues related to:
- Zoho CRM API: Check Zoho CRM API documentation
- MCP Protocol: Check Model Context Protocol specification
- This server: Check the error messages and logs
License
This project is provided as-is for educational and development purposes.
This server cannot be installed
A Model Context Protocol server that integrates AI assistants with Zoho CRM, enabling contact and deal management operations through natural language.
Related MCP Servers
- -securityFlicense-qualityA versatile Model Context Protocol server that enables AI assistants to manage calendars, track tasks, handle emails, search the web, and control smart home devices.Last updated -13Python
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to interact directly with Attio CRM data, supporting operations for companies, people, lists, and tasks through natural language queries.Last updated -1606TypeScript
- AsecurityFlicenseAqualityA Model Context Protocol server that enables AI assistants to interact with Zulip workspaces by exposing REST API capabilities as tools for message operations, channel management, and user interactions.Last updated -254JavaScript
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants to interact with Odoo ERP systems, providing comprehensive tools for searching, creating, updating, and managing Odoo records through a standardized interface.Last updated -1PythonGPL 3.0