Skip to main content
Glama
NitinSharma077-echo

Zoho CRM MCP Server

Zoho CRM MCP サーバー(FastAPI + FastMCP)

FastAPI + FastMCP で構築された本番グレードの Model Context Protocol (MCP) サーバー。Claude やその他の AI クライアントに、Zoho CRM REST API v8 への完全かつ認証済みのアクセスを提供します。レコードの読み取りからモジュール設計、ワークフロー自動化の作成まで対応します。

レコード、COQL、スキーマ設計、ワークフロールールとそのアクション、Webhook、一括/大量操作、タグ、メモ、メール、セキュリティ設定、一括インポート/エクスポートをカバーする 167 の MCP ツール に加え、専用ツールが存在しない Zoho のあらゆる機能にアクセスできる汎用の zoho_api_request エスケープハッチも備えています。


🌟 主な機能

  • FastAPI Web フレームワーク: Uvicorn を搭載した高性能・本番対応の ASGI アプリ。

  • デュアルトランスポート: Streamable HTTP MCP サーバー(リモート/クラウドホスティング用)と STDIO MCP サーバー(ローカルの Claude Desktop 用)の両方で動作。

  • 完全な OAuth 2.0 ライフサイクル: 自動コード交換、ブラウザリダイレクトハンドラー(/auth/callback)、暗号化トークンストレージ、サーバー実行中にトークンを最新に保つバックグラウンドループ。

  • チャットで設定可能な認証情報: .env の代わりに、チャットから Zoho Client ID/Secret を提供可能(set_zoho_credentials、または get_auth_url/exchange_auth_code にインラインで渡す)。サーバーを再起動せずに Zoho アカウントを切り替えるのに便利。

  • 完全な自動化作成: ワークフロールールをエンドツーエンドで構築 — フィールド更新、メール通知、タスク、Webhook アクションを作成し、トリガーと条件を備えたルールに組み込む。

  • スキーマ設計: カスタムモジュール(Zoho が必須とするプロファイル付き)、フィールド、グローバルピックリスト、レイアウト、営業パイプラインを作成。

  • スコープ付きセッションモード: 特定のレコード ID に操作を制限する ID ベースの安全フィルター(activate_scope)。

  • 人間参加型(HITL)承認: 破壊的操作は実行せずに保留リクエストをキューに入れる。ZOHO_REQUIRE_APPROVAL で切り替え可能。

  • 構造化アクティビティログ: すべての認証イベント、API 呼び出し、承認判断が JSON として記録され、get_logs() / GET /logs で取得可能。

  • 暗号化トークンストレージ: OAuth トークンは保存時に暗号化(Fernet/AES)。平文では保存されません。

  • 堅牢なネットワーククライアント: プール型 httpx クライアント。自動 401 リフレッシュ&リトライ、429 バックオフのクランプ、指数関数的 5xx リトライ、送信レートリミッター、Zoho のレコード単位レスポンスにおける部分失敗検出を搭載。

  • 自動テストスイート: HTTP サーフェス、ツール登録、リクエストペイロード形状、クライアントガードをカバーする 35 の pytest テスト。


Related MCP server: Zoho CRM MCP Server

📁 リポジトリ構造

zoho-crm-mcp/
├── server.py              # FastAPI app + all FastMCP tool definitions & REST endpoints
├── auth_manager.py        # OAuth 2.0 flow, scopes & token refresh
├── zoho_client.py         # Async HTTP client for Zoho CRM API v8 (151 methods)
├── models.py              # Pydantic state & validation models
├── token_store.py         # Encrypted (Fernet) token persistence
├── approval_manager.py    # HITL approval queue for high-risk actions
├── activity_log.py        # Structured JSON activity logger
├── test_server.py         # pytest suite
├── requirements.txt       # Dependencies
├── .env.example           # Environment configuration template
├── pyproject.toml         # Package metadata
└── README.md

⚙️ セットアップとインストール

1. 前提条件

  • Python 3.10+

  • Zoho CRM API コンソールアプリ(Zoho API Console

    • クライアントタイプ: Server-based Applications

    • リダイレクト URI: http://localhost:8000/auth/callback(またはデプロイ先のコールバック URL)

2. 環境設定

cp .env.example .env

最小構成:

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

サポートされているすべての変数(承認ゲート、OAuth スコープ上書き、レート制限、タイムアウト設定を含む)については .env.example を参照してください。

複数の Zoho アカウントで作業していますか? ZOHO_CLIENT_ID/ZOHO_CLIENT_SECRET はオプションです。空白のままにして、Claude に set_zoho_credentials(client_id, client_secret, redirect_uri?, data_center?) を呼び出してもらうか、client_id/client_secretget_auth_url / exchange_auth_code に直接渡してください。client_id を切り替えると、以前のアカウント用に保存されたトークンがクリアされ、別のアプリに発行されたリフレッシュトークンの再利用による Zoho の invalid_client エラーを回避できます。

3. 依存関係のインストール

pip install -r requirements.txt

🚀 実行とデプロイ

オプション A: ローカル FastAPI Web サーバー

python server.py

または Uvicorn を直接使用:

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

起動後:

オプション B: ローカル STDIO

python server.py --stdio

オプション C: クラウドデプロイ(Render、Railway、Docker、AWS、Heroku)

  • 開始コマンド: uvicorn server:app --host 0.0.0.0 --port $PORT

  • ヘルスチェックパス: /health

  • 環境変数: ZOHO_CLIENT_IDZOHO_CLIENT_SECRETZOHO_REDIRECT_URIZOHO_DATA_CENTERZOHO_TOKEN_ENCRYPTION_KEY を設定(一時ファイルシステム上でもトークンが再起動後も保持されるようにするため)。


🖥️ Claude Desktop 連携

モード 1: HTTP / リモート MCP 接続

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

モード 2: ローカル STDIO 接続

{
  "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"
      }
    }
  }
}

🔑 初回実行時の OAuth フロー

  1. サーバーを起動: python server.py

  2. http://localhost:8000/auth/url を開くか、Claude に get_auth_url() を実行してもらう。

  3. 返された URL を開き、Zoho CRM にサインインして Accept をクリック。

  4. Zoho が /auth/callback?code=... にリダイレクト。サーバーがコードを交換し、暗号化されたトークンを ~/.zoho_crm_tokens.json に保存。


🧩 自動化の構築: ワークフローレシピ

Zoho はワークフロールールを トリガー条件 としてモデル化し、各条件は事前に作成された アクション オブジェクトを参照します。この順序で構築してください:

1. get_workflow_configurations(module="Leads")
   -> see which triggers, comparators, and action types this org supports

2. create_field_update_action(
       name="Mark as Hot", module="Leads",
       field_api_name="Rating", value="Hot")
   -> returns the action id

3. create_workflow(
       name="Hot Lead Router",
       module="Leads",
       execute_when={"type": "create_or_edit"},
       conditions=[{
           "sequence_number": 1,
           "criteria_details": {"criteria": {"group_operator": "and", "group": [
               {"comparator": "equal",
                "field": {"api_name": "Lead_Source"},
                "value": "Web Form"}]}},
           "instant_actions": {"actions": [
               {"id": "<action id from step 2>", "type": "field_updates"}]}}])

4. activate_workflow(workflow_id="...")

同じパターンが create_email_notification_actioncreate_automation_taskcreate_webhook をアクションソースとして使用する場合にも適用されます。


🎯 スコープ付きセッションモード(安全フィルター)

すべての操作を特定のレコード ID に制限:

  • 有効化: activate_scope(module="Deals", record_ids=["4153...001", "4153...002"])

  • REST: POST /scope/activate{"module": "Leads", "record_ids": ["123", "456"]} を送信

  • 無効化: deactivate_scope() または POST /scope/deactivate

有効中は、そのモジュールの読み取りはこれらの ID にフィルタリングされ、他の ID への書き込みは OUT_OF_SCOPE で拒否されます。


✅ 人間参加型(HITL)承認

デフォルトでは、破壊的操作は実行せずに保留リクエストをキューに入れ、request_id を返します:

delete_recordbulk_update_recordsbulk_delete_recordsmass_update_recordsmass_delete_recordschange_ownermass_change_ownermerge_recordsdelete_workflowdelete_workflowsexecute_blueprintupdate_layoutactivate_layoutdelete_layoutdelete_fielddelete_userdelete_tagbulk_write_create_job

  • 確認: list_pending_approvals() または GET /approvals

  • 承認して実行: approve_action(request_id="...") または POST /approvals/{id}/approve

  • 拒否して破棄: reject_action(request_id="...") または POST /approvals/{id}/reject

  • ゲートを完全に無効化: ZOHO_REQUIRE_APPROVAL=false を設定すると、これらのツールは即座に実行されます。

すべてのリクエスト、承認、拒否はアクティビティログに記録されます。


📜 アクティビティログ

認証イベント、送信 Zoho API 呼び出し、関数実行、承認判断が {timestamp, action, status, details} エントリとして記録され、メモリ内に保持されるとともに ~/.zoho_crm_mcp_activity.log.jsonl に追記されます。

  • 取得: get_logs(limit=50, action=None, status=None) または GET /logs


🔐 トークンセキュリティ

  • トークンは ~/.zoho_crm_tokens.json に保存時に暗号化(Fernet/AES)されます。

  • キーは初回実行時に ~/.zoho_crm_mcp.key へ自動生成されます(POSIX ではユーザーのみ権限)。または ZOHO_TOKEN_ENCRYPTION_KEY で明示的に設定し、コンテナ再起動をまたいで安定したキーを使用できます。

  • トークンには発行元の client_id がタグ付けされ、不一致時には破棄されます。これにより、アカウント切り替え後の Zoho の invalid_client エラーを防ぎます。

  • 送信呼び出しは 429/5xx バックオフに加えて自己スロットリング(ZOHO_RATE_LIMIT_PER_SEC、デフォルト 10/秒)が適用されます。


🧪 テスト

pytest -v

HTTP サーフェス(/health//auth/*/scope/*/approvals/*/logs)、全 167 の MCP ツールの登録、ワークフロー/モジュール/メモ/通話/Webhook/マージ/ロックで送信される正確なリクエストペイロード、クライアント側バリデーションガード、レート制限のクランプ、Zoho の部分失敗検出をカバーしています。

テストは完全にオフラインで実行されます — Zoho の認証情報は不要です。


🛠️ MCP ツールリファレンス

カテゴリ

ツール

OAuth & 認証

get_auth_urlexchange_auth_codeset_zoho_credentialsget_auth_statusget_access_tokenrefresh_access_tokenvalidate_tokenget_token_expiry

スコープモード

activate_scopedeactivate_scopeget_scope_status

HITL & ロギング

list_pending_approvalsapprove_actionreject_actionget_logs

エスケープハッチ

zoho_api_request — 完全な認証/リトライ処理を備えた任意のZoho v8エンドポイントを呼び出し

レコードCRUD

create_recordget_recordupdate_recorddelete_record†、list_recordssearch_recordsupsert_recordclone_recordget_record_countget_deleted_recordsget_record_timeline

一括(1回あたり≤100件)

bulk_create_recordsbulk_update_records†、bulk_upsert_recordsbulk_delete_records

大量(非同期ジョブ)

mass_update_records†、get_mass_update_statusmass_delete_records†、get_mass_delete_statuschange_owner†、mass_change_owner†、merge_records

ロック & 共有

lock_recordunlock_recordget_record_locking_infoshare_recordget_shared_record_detailsrevoke_shared_record

関連レコード

get_related_recordsget_related_records_countlink_related_recordsdelink_related_record

クエリ

execute_coqlcomposite_request

メタデータ & ディスカバリ

get_modulesget_module_detailsget_fieldsget_field_detailsget_picklist_valuesget_layoutsget_layout_structureget_related_listsget_custom_viewsget_custom_view_detailsget_featuresget_organizationsget_business_hoursget_currenciesget_email_templatesget_recycle_bin

スキーマ設計

create_moduleupdate_modulecreate_fieldcreate_fieldsupdate_fielddelete_field†、get_global_picklistscreate_global_picklistupdate_layout†、activate_layout†、deactivate_layoutdelete_layout†、get_pipelinescreate_pipelineupdate_pipeline

ワークフロールール

get_workflowsget_workflowget_workflow_configurationscreate_workflowupdate_workflowactivate_workflowdeactivate_workflowdelete_workflow†、delete_workflows

ワークフローアクション

get_field_update_actionscreate_field_update_actionupdate_field_update_actiondelete_field_update_actionget_email_notification_actionscreate_email_notification_actiondelete_email_notification_actionget_automation_taskscreate_automation_taskupdate_automation_taskget_assignment_rules

ウェブフック

create_webhookget_webhooksupdate_webhookdelete_webhook

ファイル

upload_attachmentget_attachmentsdownload_attachmentdelete_attachmentupload_photodelete_photo

メモ、通話 & メール

create_noteget_notesupdate_notedelete_notecreate_callsend_mailget_from_addressesget_emails

タグ

get_tagscreate_tagsupdate_tagdelete_tag†、merge_tagsget_tag_record_countadd_tagsremove_tagsadd_tags_to_multiple_records

リード変換

get_lead_conversion_optionsconvert_leadmass_convert_leadsget_mass_convert_status

ブループリント

get_blueprintsexecute_blueprint†、create_blueprintupdate_blueprint

一括読み取り/書き込み

bulk_read_create_jobbulk_read_job_statusbulk_read_download_resultbulk_write_upload_filebulk_write_create_job†、bulk_write_job_status

セキュリティ & ユーザー

get_userscreate_userupdate_userdelete_user†、get_profilescreate_profileget_rolescreate_roleupdate_roleget_territoriesget_variablescreate_variables

通知

get_notification_detailsenable_notificationsdisable_notifications

関数

execute_functionget_functionscreate_functionupdate_functiondelete_function

レポート & ダッシュボード

get_reports(カスタムビューにプロキシ)、create_reportexport_reportget_dashboardcreate_dashboard_widget

† デフォルトでは承認が必要です。即時実行するには ZOHO_REQUIRE_APPROVAL=false を設定してください。

* Zoho CRMの公開REST APIにはこの操作のエンドポイントがありません — ブループリントの作成、Deluge関数のソース、レポート/ダッシュボードの作成はUIのみ、または別製品のZoho Analyticsに属します。これらのツールは、存在しないURLに対して失敗するのではなく、動作する代替手段を明示した NOT_SUPPORTED_BY_ZOHO_API メッセージを返します。


🧭 リストにないものへのアクセス

ZohoのAPIは手書きのラッパーよりもはるかに広大です。zoho_api_request が同じ認証、スロットリング、リトライ処理で残りをカバーします:

zoho_api_request(
    method="GET",
    endpoint="settings/territories")

zoho_api_request(
    method="POST",
    endpoint="settings/automation/scoring_rules",
    body={"scoring_rules": [{...}]})

zoho_api_request(
    method="GET",
    endpoint="read/1234567890",
    api_root="bulk")

api_root はURLベースを選択します:crm{domain}/crm/v8(デフォルト)、bulk{domain}/crm/bulk/v8root{domain}

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • The HubSpot MCP Server acts as a bridge that enables AI assistants and Large Language Models to securely interact with HubSpot CRM data through natural conversation, without requiring users to understand complex API structures. It provides read-only access to standard CRM objects (contacts, companies, deals, tickets, products, invoices, and more) and their associations, secured via OAuth 2.0, allowing AI agents to perform tasks like summarizing deals, fetching company updates, and looking up record changes.

  • Connect Claude to your Platform7n workspaces — chat, links, and tasks. One-click OAuth.

  • xmagnet — AI-powered B2B CRM for Claude. 35 tools that turn natural-language prompts into real CRM actions: prospect, enrich, score leads, manage deals, scan buying intent, run email campaigns and sequences, build forms and landing pages, refine ICP, and analyze performance — all directly inside Claude. 🚀 ONE-CLICK INSTALL: https://api.xmagnet.ai/claude The install page guides Claude users through 3 steps in under a minute: open Claude Connectors, paste the connector name, paste the server URL, sign in. A reviewer workspace is auto-provisioned on first sign-in with sample contacts, deals, campaigns, and ICP suggestions, so every tool works end-to-end with zero setup. No 2FA. No paid plan required. Free tier exposes all 35 tools. What you can do: • Prospecting — search_contacts, search_companies, search_investors, find_contacts_at_companies, enrich_contact, validate_email, find_competitors, company_intelligence • Pipeline — get_deals_pipeline, scan_deal_intent, get_ghost_pipeline, create_deal • Campaigns & sequences — create_campaign, generate_campaign_content, get_campaign_stats, get_bounce_stats, get_unsub_stats, create_sequence_draft, list_sequences • Top of funnel — suggest_icp, get_icp, create_form, list_forms, create_landing_page, list_landing_pages, show_suggestions • Operations — analyze_contacts, get_contact_details, update_contact, save_contacts_to_crm, export_contacts, get_dashboard_stats, get_credit_balance Example prompts to try: • "Find C-suite contacts at fintech companies that raised Series A in the last 6 months." • "Scan my open deals for buying intent and prioritize follow-ups." • "Generate a re-engagement campaign for contacts who opened my last newsletter but didn't reply." • "Show me my deals pipeline by stage with weighted value and win rate." • "Generate a landing page for my Q2 webinar with a registration form." Built for founders, SDRs, RevOps, and growth teams who want their CRM to take action — not just store records. Install: https://api.xmagnet.ai/claude · Site: https://xmagnet.ai · Privacy: https://xmagnet.ai/privacy-policy · Terms: https://xmagnet.ai/terms-of-service · Support: ashish.sinha@xmagnet.ai

  • WHOOP recovery, strain, sleep and workouts in Claude via official WHOOP OAuth. Free, open source.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Connects Claude to Zoho CRM with read-only access, enabling natural language queries to search records, list modules, retrieve field information, and count records using OAuth authentication.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables read-only interaction with Zoho CRM data through natural language queries, allowing users to search records, list modules, retrieve field information, and count records using secure OAuth authentication.
    2
    -
  • F
    license
    B
    quality
    D
    maintenance
    Exposes Zoho CRM v6 REST API as structured tools for LLM agents via MCP, enabling CRUD operations, search, COQL queries, and more.
    11
    3
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to interact with Zoho CRM data through secure OAuth authentication, supporting comprehensive CRM operations including record management, search, bulk operations, and lead conversion.
    3
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NitinSharma077-echo/zoho-crm-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server