@doitintl/doit-mcp-server

中文文档
4.0.0发布于 2026/11/12MITTypeScriptES Module构建来源已验证近 30 天下载 1.3万

DoiT official MCP Server

原始使用文档
文档目录15 节
  1. Authentication
  2. Remote (Streamable HTTP)
  3. Headless clients (API token)
  4. Local (stdio)
  5. Supported MCP protocol versions
  6. Clone to Local Repository
  7. Core package API
  8. Large results
  9. Usage Examples
  10. Cost Analysis and Savings
  11. Reports and Analytics
  12. Anomaly Detection
  13. Invoices
  14. Claude Code plugin and channel (research preview)
  15. Environment Variables

DoiT MCP Server

License: MIT NPM Version

DoiT MCP Server provides access to the DoiT API. This server enables LLMs like Claude to access DoiT platform data for troubleshooting and analysis.

top-services

Authentication

How you authenticate depends on the connection method:

MethodURL / commandAuth
Remote (Streamable HTTP)https://mcp.doit.com/mcpOAuth — your client opens a DoiT sign-in and consent page. Headless clients can instead send a customer personal API token as Authorization: Bearer.
Local (stdio)npx -y @doitintl/doit-mcp-server@latestPersonal API token via DOIT_API_KEY.

The legacy SSE endpoint (https://mcp.doit.com/sse) is deprecated and should not be used for new setups.

Your DoiT plan must include API access. Tools follow the same permissions as the DoiT API.

Tool results are capped at 140,000 serialized UTF-16 code units after response formatting, including structured content and metadata. Oversized reads return an actionable error; completed writes return a compact success receipt and must not be repeated just to retrieve their output. Errors remain errors. This is a response size policy, not a token limit or a bound on upstream downloads.

Each dispatched call emits a payload-free JSON mcp_tool_response event to stderr on stdio; some clients display these logs. Hosts can supply onResponseMetrics to route the events elsewhere. Use original.serializedChars for response-size percentiles and exceededLimit for over-limit rates; returned measures the result after the guard. Metrics also include UTF-8 byte counts, duration, tool/client, and disposition, without tool arguments or response bodies.

The Claude Desktop steps below are examples, not the only supported clients. Cursor, VS Code, Amazon Q, Claude Code, and others are covered in the Connections guide.

Remote (Streamable HTTP)

Example with Claude Desktop: add a custom connector (+ → Add connector → Add custom connector) and set the remote MCP server URL to https://mcp.doit.com/mcp. Complete DoiT sign-in when prompted.

Headless clients (API token)

Agents that cannot open a browser (for example HolmesGPT on a cluster, CI jobs, cron workers) can authenticate to the same endpoint with a customer personal API token sent as a bearer header. Tools run with that token's permissions, exactly as on stdio. DoiT employee tokens are not accepted on the remote endpoint; employees use OAuth or the local server.

Example with HolmesGPT:

mcp_servers:
  doit:
    description: "DoiT Cloud Intelligence"
    config:
      url: "https://mcp.doit.com/mcp"
      mode: streamable-http
      headers:
        Authorization: "Bearer {{ env.DOIT_API_KEY }}"
      health_check_tool: "validate_user"

Keep the token in a secret store and rotate it on a schedule. Design notes: docs/remote-api-key-bearer-auth.md.

Local (stdio)

Supports Skills over MCP for compatible clients. No skills are bundled by default.

Requires Node.js v20 or higher and a personal API token as DOIT_API_KEY. Create a token from the Personal API tokens page in the DoiT console.

Example with Claude Desktop — add the following to claude_desktop_config.json (or Settings), then restart Claude:

{
  "mcpServers": {
    "doit_mcp_server": {
      "command": "npx",
      "args": ["-y", "@doitintl/doit-mcp-server@latest"],
      "env": {
        "DOIT_API_KEY": "your_doit_api_key"
      }
    }
  }
}
  • DOIT_API_KEY: Your DoiT API token (required)
  • CUSTOMER_CONTEXT: Customer context identifier (optional)

Supported MCP protocol versions

The stdio server works with clients of both MCP protocol eras without any configuration:

  • 2024-10-07 through 2025-11-25, through the initialize handshake.
  • 2026-07-28, through server/discover.

Each connection's opening message decides which era it uses. See docs/protocol-compatibility.md for the details and the tests that verify it.

Clone to Local Repository

If you want to clone and run this MCP server directly from the source code, follow these steps:

  1. Clone the repository
git clone https://github.com/doitintl/doit-mcp-server
cd doit-mcp-server
  1. Install dependencies
yarn install
  1. Build the project
yarn build
  1. Run the server
DOIT_API_KEY=your_doit_api_key node dist/index.js

Core package API

Applications that provide their own MCP transport can reuse the published, transport-independent implementation:

npm install @doitintl/doit-mcp-server@latest
import {
    COVERED_ENDPOINTS,
    executeToolHandler,
    generateTools,
    generatedToolsOpenApiSpec,
    HAND_WRITTEN_TOOLS,
} from "@doitintl/doit-mcp-server/core";

The /core entry includes the tool and prompt definitions, generated-tool utilities, request handling, and shared configuration APIs. It does not initialize the stdio transport or include the Cloudflare Worker, OAuth, Durable Objects, or widget implementation.

Large results

Claude accepts about 150,000 characters per tool result, so executeToolHandler caps every result at 140,000 characters. A list result that would exceed the cap is returned in parts instead of failing: the server keeps the records that fit, adds pageSplit: { returnedRecords, remainingInResult }, and sets pageToken to a signed continuation token. Passing that token back to the same tool returns the next part; the API's own cursor appears only once the whole API page has been delivered, so no record is skipped or repeated. If the record a part stopped at is deleted before the next call, the continuation resumes at its index, so a record is repeated rather than skipped. Paging is opt-in: a read-only list tool whose endpoint has no paging of its own declares resultPaged: true (hand-written tools on the tool object, generated ones in src/tools/generated/overrides.ts) and gains an optional pageToken argument. Single-resource tools have nothing to split, and reads that must not be re-run (ask_ava_sync) stay out. Analytics results (rows) are never split and keep the size error with a narrowing hint. Fields other than the record collection (counts, sibling maps such as a components statussheet) describe the whole result and repeat on every part. Consumers that register the generated registry's schemas advertise the argument on opted-in generated tools and should pass resultPaging so it takes effect.

The stdio server signs tokens with a random per-process secret. A consumer that provides its own transport passes resultPaging: { secret, cursorField } to executeToolHandler, and applies withResultPageToken to the zod schema of every tool in RESULT_PAGED_TOOLS when it registers tools from the exported schemas, so both transports advertise the same arguments.

Usage Examples

Here are some common queries you can ask using the DoiT MCP server:

Cost Analysis and Savings

  • "What are my Flexsave savings?" - This will analyze your Flexsave cost optimization savings across your cloud accounts.
  • "What are my top 3 AWS services by cost?" - This will run a Cloud Analytics query to identify your highest-spending AWS services.

Reports and Analytics

  • "List all my available reports" - This will show all Cloud Analytics reports you have access to.
  • "Show me the results of my 'Monthly Cost Overview' report" - This will fetch and display results from a specific report.

Anomaly Detection

  • "What are my recent GCP anomalies?" - This will show recent cost or usage anomalies detected in your Google Cloud Platform accounts.
  • "Show me details about anomaly ABC123" - This will provide detailed information about a specific anomaly.

Invoices

  • "List all my invoices" - This will show all current and historical invoices for your organization.
  • "Show me details for invoice INV-2024-001" - This will provide full details for a specific invoice, including line items and payment status.

These examples demonstrate basic usage patterns. You can combine and modify these queries based on your needs. The MCP server will interpret your natural language queries and use the appropriate tools to fetch the requested information.

Claude Code plugin and channel (research preview)

A Claude Code plugin in this repository pushes new cost anomalies and cloud incidents into an open session. It sends events only; the tools come from the DoiT Cloud Intelligence plugin or the remote connector.

/plugin install doit --marketplace doitintl/doit-mcp-server

See docs/channels.md for how to start Claude Code with the channel and what an organization needs to allow.

Environment Variables

Used by the local stdio server. Remote /mcp connections authenticate with OAuth.

  • DOIT_API_KEY: Your DoiT personal API token (required for stdio)
  • CUSTOMER_CONTEXT: Your customer context identifier (optional)
  • DOIT_CHANNEL_EVENTS: Opt in to Claude Code channel mode (research preview) by listing event kinds to push into an open session: anomalies, incidents (optional, off by default)
  • DOIT_CHANNEL_POLL_SECONDS: Channel poll interval in seconds, minimum 60 (optional, default 300)
  • DOIT_CHANNEL_ONLY: Set to true to serve channel events and no tools, for a session that has the DoiT tools from another connection (optional)

版本与发布记录

@doitintl/doit-mcp-server 共发布 79 个版本,首次发布于 2025/05/15;过去 12 个月发布了 64 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
4.0.0latest2026/11/121 天前
3.1.02026/11/121 天前
3.0.02026/11/121 天前
2.16.02026/11/112 天前
2.15.02026/11/067 天前
2.12.12026/11/0310 天前

关于 @doitintl/doit-mcp-server 的常见问题

@doitintl/doit-mcp-server 是什么?

DoiT official MCP Server

如何安装 @doitintl/doit-mcp-server?

在项目目录运行 npm install @doitintl/doit-mcp-server,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 doit-mcp-server,可以用 npx doit-mcp-server 直接运行。

@doitintl/doit-mcp-server 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@doitintl/doit-mcp-server 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@doitintl/doit-mcp-server 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@doitintl/doit-mcp-server 可以商用吗?

@doitintl/doit-mcp-server 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@doitintl/doit-mcp-server 的下载量有多少?

根据 npm 官方下载统计,@doitintl/doit-mcp-server 在 2026/10/13 – 2026/11/11 这 30 天内被下载 12,985 次,日均约 433 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@doitintl/doit-mcp-server 还在维护吗?

最新版本 4.0.0 发布于 2026/11/12(1 天前);至今共发布 79 个版本,其中过去 12 个月发布了 64 个;首次发布于 2025/05/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。