site24x7-code-mode-mcp

site24x7-code-mode-mcp

A Model Context Protocol server for Zoho Site24x7 that uses a JavaScript sandbox to execute API calls, enabling management of monitors, accounts, and MSP/BU tenancy through natural language.

Category
访问服务器

README

site24x7-code-mode-mcp

Status: public beta (v0.1.0-beta.1). Verification status is tracked below.

A Model Context Protocol server for the Zoho Site24x7 REST API, built on the code-mode pattern: instead of mapping each of the hundreds of Site24x7 endpoints to its own MCP tool, this server exposes exactly two tools (site24x7_search and site24x7_execute) and a JavaScript sandbox where the LLM writes real code against a flat site24x7.* surface.

This is the same architecture used by the sibling repos:

What's different about Site24x7:

  1. Zoho OAuth 2.0 with a permanent refresh token (Self Client flow). New auth pattern for this family.
  2. MSP / Business Unit tenancy — a second axis of tenancy inside a single OAuth identity, expressed as Cookie: zaaid=<customer_id>. First-class in this server, not bolted on.
  3. No public OpenAPI spec. We scrape the official REST reference into a bundled JSON spec at build time.

Quickstart

git clone https://github.com/jmpijll/site24x7-code-mode-mcp
cd site24x7-code-mode-mcp
npm install --legacy-peer-deps
cp .env.example .env
# Fill in SITE24X7_CLIENT_ID / SECRET / REFRESH_TOKEN / ZONE — see "Authentication" below.
npm run build
node dist/index.js                   # stdio mode (default)
# or, for multi-tenant HTTP mode:
MCP_TRANSPORT=http MCP_HTTP_PORT=8000 node dist/index.js

Then wire it into your MCP client:

  • Cursor — uses .cursor/mcp.json shipped in this repo.
  • opencode — uses opencode.json shipped in this repo.
  • Claude Code / Claude Desktop / Codex / Continue / Cline / Zed / MCP Inspector — see docs/usage.md.

Authentication

Site24x7 reuses Zoho's accounts service for OAuth 2.0. The only practical long-lived option for a local MCP is the Self Client → refresh token flow.

Why this flow (and not the others)

Flow Why we don't use it
Web-server authorization-code Needs a callback URL — impossible for a local MCP.
Access-token only Expires every hour — terrible UX.
Legacy portal_id / authtoken Deprecated by Zoho for new integrations.
Self Client refresh-token What we use. One-time setup, permanent refresh token, automatic per-tenant access-token rotation.

One-time setup (5 minutes)

  1. Open the Zoho API console for your data center:

    Zone Console URL
    US (com) https://api-console.zoho.com
    EU (eu) https://api-console.zoho.eu
    India (in) https://api-console.zoho.in
    Australia (com.au) https://api-console.zoho.com.au
    China (cn) https://api-console.zoho.com.cn
    Japan (jp) https://api-console.zoho.jp
    Canada (ca) https://api-console.zohocloud.ca
    UK (uk) https://api-console.zoho.uk
    UAE (ae) https://api-console.zoho.ae
    Saudi Arabia (sa) https://api-console.zoho.sa
  2. Click Add ClientSelf ClientCreate. Note the Client ID and Client Secret.

  3. Go to the Generate Code tab on the same Self Client and fill in:

    • Scope: the scopes you want available to the MCP, comma-separated. Pick from the table below. For a typical "full admin + MSP" deployment:

      Site24x7.Admin.All,Site24x7.Account.All,Site24x7.Reports.All,Site24x7.Operations.All,Site24x7.Msp.All,Site24x7.Bu.All
      
    • Description: anything ("site24x7 code-mode mcp" works).

    • Time Duration: 10 Minutes (the maximum; you only need a minute or two).

    • Click Create. Copy the displayed code (the grant token).

  4. Exchange the grant token for a refresh token using curl (run within 10 minutes of step 3):

    curl -X POST 'https://accounts.zoho.com/oauth/v2/token' \
      -d "client_id=$CLIENT_ID" \
      -d "client_secret=$CLIENT_SECRET" \
      -d "code=$GRANT_CODE" \
      -d "grant_type=authorization_code"
    

    Replace accounts.zoho.com with the accounts host for your zone (accounts.zoho.eu, accounts.zoho.in, etc.). The response includes:

    {
      "access_token": "1000.xxx",
      "refresh_token": "1000.yyy",
      "expires_in": 3600,
      "token_type": "Bearer"
    }
    

    Keep the refresh_token — it's permanent. The access_token is throwaway; the MCP server will mint fresh ones automatically.

  5. Drop the values into .env:

    SITE24X7_CLIENT_ID=1000.xxx
    SITE24X7_CLIENT_SECRET=xxx
    SITE24X7_REFRESH_TOKEN=1000.yyy
    SITE24X7_ZONE=com
    

Scopes reference

Scope family What it grants Levels
Site24x7.Account.* Users, license, account-wide data Read, Create, Update, Delete, All
Site24x7.Admin.* Monitors, profiles, third-party integrations Read, Create, Update, Delete, All
Site24x7.Reports.* Reports and monitor status Read, Create, Update, Delete, All
Site24x7.Operations.* IT Automation, maintenance, status pages Read, Create, Update, Delete, All
Site24x7.Msp.* MSP-level operations Read, Create, Update, Delete, All
Site24x7.Bu.* Business-Unit-level operations Read, Create, Update, Delete, All

Pick the narrowest set of scopes that covers your intended use. The MCP server tells the LLM, per operation, which scope it needs — so a scope-aware 403 always has actionable context.

Revoking a refresh token

curl -X POST 'https://accounts.zoho.com/oauth/v2/token/revoke?token=YOUR_REFRESH_TOKEN'

Or via the Zoho web UI: https://accounts.zoho.com/u/h#sessions/refreshtokens.


MSP and Business Units

If your Zoho identity is an MSP user (or a BU portal user), one Self Client / refresh token lets you operate against any customer / BU under your portal — but you must tell each API call which customer to act on via Cookie: zaaid=<customer_zaaid>. This server makes that ergonomic.

Finding your customers' zaaid values

In the sandbox:

site24x7.listCustomers();

This returns [{ name, zaaid, ... }] from /api/short/msp/customers (or /api/short/bu/business_units if SITE24X7_ACCOUNT_TYPE=bu).

Running against a single customer

site24x7.withCustomer('658123456', function (s) {
  return s.monitors.list();
});

withCustomer re-injects the cookie for every call inside the closure. Outside the closure, the active zaaid reverts to whatever was in scope when you entered.

Fanning out

var customers = site24x7.listCustomers();
var summary = [];
for (var i = 0; i < customers.length; i++) {
  var c = customers[i];
  var status = site24x7.withCustomer(c.zaaid, function (api) {
    return api.request({ method: 'GET', path: '/api/current_status' });
  });
  summary.push({
    name: c.name,
    zaaid: c.zaaid,
    down: (status && status.monitors_status && status.monitors_status.down) || 0,
  });
}
summary;

Multi-tenant HTTP mode

When the server runs with MCP_TRANSPORT=http, each request can override the active customer via the X-Site24x7-Zaaid header. The full multi-tenant contract:

Header Required Notes
X-Site24x7-Client-Id yes Zoho Self Client client ID
X-Site24x7-Client-Secret yes Zoho Self Client client secret
X-Site24x7-Refresh-Token yes Permanent refresh token
X-Site24x7-Zone yes One of com, eu, in, com.au, cn, jp, ca, uk, ae, sa
X-Site24x7-Zaaid no Default zaaid for this request; can still be overridden by withCustomer
X-Site24x7-Account-Type no standard / msp / bu — improves error messages

See docs/multi-tenant.md for the full architecture.


Data centers

The server speaks to two hosts per zone — Zoho accounts (for OAuth) and Site24x7 (for API calls). Both are routed automatically from SITE24X7_ZONE.

Zone (SITE24X7_ZONE) Zoho accounts Site24x7 API
com (US, default) https://accounts.zoho.com https://www.site24x7.com/api
eu (Europe) https://accounts.zoho.eu https://www.site24x7.eu/api
in (India) https://accounts.zoho.in https://www.site24x7.in/api
com.au (Australia) https://accounts.zoho.com.au https://www.site24x7.net.au/api
cn (China) https://accounts.zoho.com.cn https://www.site24x7.cn/api
jp (Japan) https://accounts.zoho.jp https://app.site24x7.jp/api
ca (Canada) https://accounts.zohocloud.ca https://www.site24x7.ca/api
uk (UK) https://accounts.zoho.uk https://app.site24x7.uk/api
ae (UAE) https://accounts.zoho.ae https://app.site24x7.ae/api
sa (Saudi Arabia) https://accounts.zoho.sa https://www.site24x7.sa/api

The sandbox surface

See SKILL.md for the operating manual aimed at the model writing the JavaScript. TL;DR:

site24x7.request({ method, path, query?, body?, version?, zaaid? })
site24x7.<tag>.<op>(args)               // typed accessor
site24x7.callOperation('opId', args)    // flat lookup
site24x7.listCustomers()                // MSP/BU enumeration
site24x7.withCustomer(zaaid, fn)        // scoped customer override (sync)
site24x7.zaaid                          // active zaaid (or undefined)

Configuration

All variables are documented in .env.example. Highlights:

Variable Default Notes
MCP_TRANSPORT stdio stdio or http
MCP_HTTP_PORT 8000 HTTP port (only if MCP_TRANSPORT=http)
MCP_HTTP_ALLOWED_ORIGINS http://localhost,http://127.0.0.1 Comma-separated origin allowlist
SITE24X7_CLIENT_ID / SECRET / REFRESH_TOKEN Zoho Self Client credentials
SITE24X7_ZONE com Data center (see table above)
SITE24X7_ZAAID (Optional) default MSP/BU customer scope
SITE24X7_ACCOUNT_TYPE standard standard / msp / bu
SITE24X7_MAX_CALLS_PER_EXECUTE 50 Per-execute API call budget
SITE24X7_EXECUTE_TIMEOUT_MS 30000 Wall-clock deadline (ms)
SITE24X7_CACHE_DIR ~/.cache/site24x7-code-mode-mcp/ On-disk cache root

Project status

This is v0.1.0-beta.1. Honest verification surface:

Surface Verified
Unit tests (Vitest, in-process)
Integration tests (InMemoryTransport + real HTTP transport against a mock Site24x7)
MCP Inspector CLI smoke (tools/list, site24x7_search, site24x7_execute)
Live read-only sweep against a real Site24x7 tenant ⏳ pending credentials
Live MSP customer round-trip via withCustomer ⏳ pending credentials
OpenCode end-to-end LLM round-trip ⏳ pending credentials
Cursor / Claude Code / Claude Desktop / Continue / Cline / Aider / Zed
Mutating live operations ⛔ deliberately not run until you give us a lab tenant
Other zones beyond the one your refresh token lives in
Cloudflare Workers full transport ⛔ 501 scaffold only (parity with sibling repos)
Long-running soak / stability

This table updates honestly as we verify more — if a row is not ticked here, we haven't tested it. Verification reports are welcome (see CONTRIBUTING.md).


Docs


License

MIT.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选