Zoho CRM MCP Server

Zoho CRM MCP Server

Enables AI clients and Claude Desktop to interact with the Zoho CRM REST API for record CRUD, metadata discovery, workflows, and bulk operations via OAuth 2.0 authentication.

Category
Visit Server

README

Zoho CRM MCP Server (FastAPI + FastMCP)

A production-grade Model Context Protocol (MCP) server built with FastAPI + FastMCP that provides Claude Desktop and AI clients with complete, authenticated access to the Zoho CRM REST API v8.


๐ŸŒŸ Key Features

  • FastAPI Web Framework: High-performance, production-ready web application powered by Uvicorn and FastAPI.
  • Dual Transport Support: Runs seamlessly both as a Web/HTTP/SSE MCP Server (for remote deployment & cloud hosting) and as a STDIO MCP Server (for local Claude Desktop).
  • Full OAuth 2.0 Lifecycle: Automatic code exchange, browser redirect handler (/auth/callback), token storage, and automatic token refresh.
  • Scoped Session Mode: ID-based safety filter (activate_scope) that restricts operations exclusively to specific record IDs to prevent accidental modifications.
  • Interactive OpenAPI Documentation: Built-in Swagger UI accessible at /docs.
  • Resilient Network Client: Built with httpx featuring automatic 401 token refresh retry, HTTP 429 rate limit backoff, and exponential retry for 5xx errors.
  • Automated Test Suite: Complete test suite using pytest and FastAPI TestClient.

๐Ÿ“ Repository Structure

zoho-crm-mcp/
โ”œโ”€โ”€ server.py              # FastAPI application + FastMCP tool definitions & endpoints
โ”œโ”€โ”€ auth_manager.py        # OAuth 2.0 flow & token refresh manager
โ”œโ”€โ”€ zoho_client.py         # Async HTTP client wrapper for Zoho CRM API v8
โ”œโ”€โ”€ models.py              # Pydantic state & validation models
โ”œโ”€โ”€ token_store.py         # File-based JSON token persistence (~/.zoho_crm_tokens.json)
โ”œโ”€โ”€ test_server.py         # Automated pytest test suite
โ”œโ”€โ”€ requirements.txt       # Project dependencies
โ”œโ”€โ”€ .env.example           # Environment configuration template
โ”œโ”€โ”€ pyproject.toml         # Package metadata
โ””โ”€โ”€ README.md              # Server documentation

โš™๏ธ Setup & Installation

1. Prerequisites

  • Python 3.10+
  • A Zoho CRM Developer Account / API Console App (Zoho API Console)
    • Client Type: Server-based Applications
    • Redirect URI: http://localhost:8000/auth/callback (or your production deployment callback URL)

2. Environment Setup

Copy .env.example to .env:

cp .env.example .env

Configure .env with your Zoho API application credentials:

ZOHO_CLIENT_ID=1000.xxxxxxx
ZOHO_CLIENT_SECRET=xxxxxxx
ZOHO_REDIRECT_URI=http://localhost:8000/auth/callback
ZOHO_DATA_CENTER=com
HOST=0.0.0.0
PORT=8000

3. Install Dependencies

Using pip:

pip install -r requirements.txt

๐Ÿš€ Running & Deploying the Server

Option A: Local Development / FastAPI Web Server

To start the FastAPI web server with Uvicorn auto-reload:

python server.py

Or directly with Uvicorn:

uvicorn server:app --host 0.0.0.0 --port 8000 --reload

Once running, access:

Option B: Cloud Production Deployment (Render, Railway, Docker, AWS, Heroku)

Deploy using standard ASGI entrypoint server:app:

  • Start Command: uvicorn server:app --host 0.0.0.0 --port $PORT
  • Health Check Path: /health
  • Environment Variables: Set ZOHO_CLIENT_ID, ZOHO_CLIENT_SECRET, ZOHO_REDIRECT_URI, ZOHO_DATA_CENTER in your hosting dashboard.

๐Ÿงช How to Test the Server

1. Run Automated Test Suite (pytest)

Execute all unit and integration tests using pytest:

pytest -v

This runs tests verifying:

  • Health check endpoint (/health)
  • Root landing page dashboard (/)
  • OAuth URL generation (/auth/url)
  • OAuth callback handler (/auth/callback)
  • Scoped mode state lifecycle (/scope, /scope/activate, /scope/deactivate)
  • Registration of all 30+ FastMCP tools.

2. Test via Interactive Swagger UI

  1. Open http://localhost:8000/docs in your browser.
  2. Test /health to verify server status.
  3. Test /auth/url to receive your OAuth authorization URL.
  4. Test /scope endpoints to manage scoped record access.

3. Test OAuth Login Flow in Browser

  1. Start server: python server.py
  2. Open http://localhost:8000/auth/url in browser or ask Claude to run get_auth_url().
  3. Open the returned URL, sign in to Zoho CRM, and click Accept.
  4. Zoho will redirect to http://localhost:8000/auth/callback?code=....
  5. The FastAPI server will automatically exchange the code, save tokens to ~/.zoho_crm_tokens.json, and render a success confirmation page.

๐Ÿ–ฅ๏ธ Claude Desktop Integration

Mode 1: HTTP / Remote MCP Connection

In claude_desktop_config.json:

{
  "mcpServers": {
    "zoho-crm": {
      "url": "http://localhost:8000/mcp/mcp"
    }
  }
}

Mode 2: Local STDIO Connection

In claude_desktop_config.json:

{
  "mcpServers": {
    "zoho-crm": {
      "command": "python",
      "args": ["C:/Users/Lenovo/Desktop/zoho MCP/server.py", "--stdio"],
      "env": {
        "ZOHO_CLIENT_ID": "1000.YOUR_CLIENT_ID",
        "ZOHO_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
        "ZOHO_REDIRECT_URI": "http://localhost:8000/auth/callback",
        "ZOHO_DATA_CENTER": "com"
      }
    }
  }
}

๐ŸŽฏ Scoped Session Mode (Safety Filter)

Restrict operations exclusively to specific record IDs to prevent unintended modifications:

  • Activate: activate_scope(module="Deals", record_ids=["415340000000123001", "415340000000123002"])
  • REST Activation: POST http://localhost:8000/scope/activate with JSON {"module": "Leads", "record_ids": ["123", "456"]}
  • Deactivate: deactivate_scope() or POST http://localhost:8000/scope/deactivate

๐Ÿ› ๏ธ Complete MCP Tool Reference

Category Tools Included
OAuth & Auth get_auth_url, exchange_auth_code
Scoped Mode activate_scope, deactivate_scope, get_scope_status
Record CRUD create_record, get_record, update_record, delete_record, list_records, search_records, upsert_record
COQL Engine execute_coql
Metadata & Discovery get_modules, get_fields, get_layouts, get_related_lists, get_users, get_organizations
Settings API create_module, update_module, create_field, update_field, delete_field, get_custom_views
Workflows create_workflow, get_workflows, update_workflow, activate_workflow, deactivate_workflow, delete_workflow
Bulk Operations bulk_create_records, bulk_update_records, bulk_delete_records
Attachments & Notes upload_attachment, get_attachments, download_attachment, create_note, get_notes, create_call
Record Actions & Tags convert_lead, add_tags, remove_tags, get_blueprints, execute_blueprint

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured