laravel-zoho/mcp-server 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

laravel-zoho/mcp-server

Composer 安装命令:

composer require laravel-zoho/mcp-server

包简介

Laravel package that runs a Model Context Protocol (MCP) server exposing Zoho REST API operations as MCP tools (via Laravel MCP).

README 文档

README

Laravel package that exposes Zoho REST APIs to AI clients through the Model Context Protocol, using Laravel’s first-party Laravel MCP package (laravel/mcp) — not a separate low-level MCP SDK.

Requirements

  • PHP 8.3+
  • Laravel 13+ (this release aligns with laravel/mcp and Illuminate 13 components)
  • A Zoho OAuth client (client id + secret) in Zoho API Console

laravel/mcp is a direct dependency; installing this package pulls it in and registers the MCP console commands (for example mcp:start).

Installation

composer require laravel-zoho/mcp-server

The service provider loads migrations automatically. Run php artisan migrate in your app.

Publish configuration (optional):

php artisan vendor:publish --tag=zoho-mcp-config

Multi-user OAuth (recommended)

Each Laravel user completes the Zoho authorization code flow in the browser. Tokens are stored in zoho_mcp_oauth_connections (encrypted). Each user then gets an MCP access token (zmcp_…) from POST /zoho-mcp/mcp-access-tokens to pass as ZOHO_MCP_ACCESS_TOKEN.

See config/zoho-mcp.php for ZOHO_OAUTH_CALLBACK_URL, scopes, route prefix, and middleware.

Running the MCP server (local / stdio)

This package registers a local MCP server handle (default zoho, overridable with ZOHO_MCP_LOCAL_HANDLE / config('zoho-mcp.mcp_local_handle')):

php artisan mcp:start zoho

Compatibility wrapper (sets --token for this process, then calls mcp:start):

php artisan zoho:mcp --token='zmcp_....'
# or
export ZOHO_MCP_ACCESS_TOKEN='zmcp_....'
php artisan zoho:mcp

Legacy single-tenant mode still works when ZOHO_REFRESH_TOKEN and client credentials are set and no MCP access token is provided (see BootstrapZohoCredentials).

Cursor example

{
  "mcpServers": {
    "zoho": {
      "command": "php",
      "args": ["/absolute/path/to/your/project/artisan", "mcp:start", "zoho"],
      "cwd": "/absolute/path/to/your/project",
      "env": {
        "ZOHO_MCP_ACCESS_TOKEN": "zmcp_your_personal_token_here"
      }
    }
  }
}

You may use zoho:mcp instead of mcp:start zoho if you prefer the wrapper command.

MCP tools (Zoho CRM v8)

Tools are Laravel\Mcp\Server\Tool classes and return Laravel\Mcp\Response::json() (or Response::error() for recoverable issues). They map closely to Zoho CRM V8 APIs. Grant matching OAuth scopes (defaults in config/zoho-mcp.php include modules, users, settings, and org read).

Tool Zoho CRM v8 area
zoho_api_request Escape hatch: any REST method/path under your API base (other products or undocumented endpoints).
zoho_crm_get_organization GET /org
zoho_crm_list_modules GET /settings/modules
zoho_crm_get_module_metadata GET /settings/modules/{module}
zoho_crm_get_fields GET /settings/fields?module=
zoho_crm_get_layouts GET /settings/layouts?module=
zoho_crm_get_related_lists_metadata GET /settings/related_lists?module=
zoho_crm_list_users GET /users
zoho_crm_get_user GET /users/{id}
zoho_crm_list_roles GET /settings/roles
zoho_crm_get_role GET /settings/roles/{id}
zoho_crm_list_profiles GET /settings/profiles
zoho_crm_get_profile GET /settings/profiles/{id}
zoho_crm_list_territories GET /settings/territories
zoho_crm_get_territory GET /settings/territories/{id}
zoho_crm_get_records Module list
zoho_crm_get_record Single record
zoho_crm_create_records POST create
zoho_crm_update_records PUT update
zoho_crm_delete_records DELETE by ids
zoho_crm_coql_query COQL
zoho_crm_search_records Criteria search
zoho_crm_get_related_records Related list rows
zoho_crm_composite_requests POST /__composite_requests (≤5 sub-requests)

Additional OAuth scopes may be required for some calls (for example Zoho documents ZohoCRM.composite_requests.CUSTOM for composite). Adjust ZOHO_OAUTH_SCOPES when connecting Zoho.

Security

  • MCP access tokens are secrets; rotate via expiry or DB deletion.
  • Zoho refresh tokens in the database are encrypted with your app key.

License

MIT

laravel-zoho/mcp-server 适用场景与选型建议

laravel-zoho/mcp-server 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 07 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「oauth」 「laravel」 「Zoho」 「mcp」 「ZOHO-CRM」 「model-context-protocol」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 laravel-zoho/mcp-server 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 laravel-zoho/mcp-server 我们能提供哪些服务?
定制开发 / 二次开发

基于 laravel-zoho/mcp-server 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 49
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-07