Octri API Docs

dev.octri由 octri.dev 發布v1.4.2更新於 Nov 5, 2026

Search an Octri project's API docs and call its endpoints as tools, shaped by its SDK Studio config.

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

把 Octri 專案的 API 文件與端點變成工具,讓助理能搜尋文件、閱讀指南並呼叫真實 API。

可以做什麼
  • 搜尋與瀏覽文件:搜尋文件、依分區列出端點、讀取單一端點的完整文件、依 slug 取得書面指南。
  • 追蹤 API 變更:從變更記錄取得近期改動與破壞性變更。
  • 尋找用戶端函式庫:列出可用 SDK 的語言、版本與下載連結。
  • 產生 SDK 程式碼:取得某端點在各種支援語言下的現成程式碼片段,或取得 SDK 方法索引。
  • 把文件所述 API 的端點當成工具呼叫,受專案擁有者逐工具權限控管。
適用情境
適合需要助理回答某個 API 的問題、撰寫正確的整合程式碼,或直接呼叫該 API 端點的情境。最適合 API 文件透過 Octri 發布、希望在一個伺服器裡同時取得文件、SDK 片段與即時呼叫的團隊。
執行需求
需要 Node.js 20 或更新版本,透過 npx 或 MCP 安裝包在本機執行。必須提供 OCTRI_PROJECT_ID(或 --project-id 參數)。呼叫被文件化的 API 還需要其自身憑證:OCTRI_API_BASE_URL、OCTRI_API_TOKEN、OCTRI_API_KEY 搭配 OCTRI_API_KEY_HEADER,或 OCTRI_API_USERNAME 與 OCTRI_API_PASSWORD。需要連線至 Octri 與目標 API 的網路。
安裝前請注意
伺服器持有被呼叫 API 的憑證並以 HTTP 標頭送出,請勿寫入共用設定,可用 login 指令存入系統鑰匙圈。操作類工具會呼叫真實 API 並可能修改資料;讀取預設自動執行,其他呼叫需先確認,無法顯示確認的用戶端會被拒絕。設定 OCTRI_ALLOW_WRITES 或 OCTRI_ALLOW_TOOLS=* 會取消該確認。每次工具呼叫都會向 Octri 回報工具名稱、結果、耗時與用戶端名稱,除非關閉遙測。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Octri API Docs,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

@octri/mcp

An MCP server that turns your API documentation into tools an AI assistant can call. Claude, Cursor, VS Code Copilot, and any other MCP client can search your endpoints, open a guide, pull a ready-to-use SDK snippet in any supported language, and check the changelog for breaking changes, all from the same OpenAPI spec your docs are built from.

Octri turns an OpenAPI spec into a documentation site, client SDKs for ten languages, an MCP server your AI assistant can call, and monitoring for the API behind them. This package is the MCP server. See octri.dev/mcp.

Node 20 or newer. Runs over stdio for a local client, or Streamable HTTP when you host it.

Operation bodies use documented media type. For multipart or binary values, pass files only as bounded inline descriptor: { "filename": "report.csv", "content": "base64...", "contentType": "text/csv" }. Paths and URLs are intentionally unsupported.

Explicit URL-encoded deepObject fields with explode: true use bracketed wire keys, including nested objects and arrays. This covers APIs such as Stripe that mark fields like invoice_settings and tax_id_data as deepObject.

Install

bash
npx -y @octri/mcp

Most clients are configured with that command, so a global install is optional. The Installation section below has the exact config block for each one.

Or install it in one click. VS Code asks for your project ID; Cursor writes YOUR_PROJECT_ID into its mcp.json for you to replace.

[Add to Cursor] [Install in VS Code]

Listed in the official MCP Registry as dev.octri/mcp.

Tools

ToolDescription
search_docsSearch the API documentation for an endpoint or concept
get_endpointGet full documentation for a specific API endpoint
list_endpointsList all available API endpoints, optionally filtered by section
get_changelogGet recent API changes and breaking changes
list_sdksList the available SDK client libraries (languages, versions, download links)
get_guideGet the full content of a written guide by its slug
get_sdk_methodsGet ready-to-use SDK code snippets for each endpoint in every supported language

Installation

Claude Desktop

One click: download octri-mcp-<version>.mcpb from the latest release and open it. Claude Desktop installs the server and asks for the project ID and the API's credentials, keeping secrets in the system keychain. No Node install, no config file.

Or by hand: add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

json
{  "mcpServers": {    "my-api-docs": {      "command": "npx",      "args": ["@octri/mcp", "--project-id", "YOUR_PROJECT_ID"]    }  }}

Cursor

Add to .cursor/mcp.json in your project root (or ~/.cursor/mcp.json globally):

json
{  "mcpServers": {    "my-api-docs": {      "command": "npx",      "args": ["@octri/mcp"],      "env": {        "OCTRI_PROJECT_ID": "YOUR_PROJECT_ID"      }    }  }}

VS Code (Copilot / MCP extension)

Add to .vscode/mcp.json:

json
{  "servers": {    "my-api-docs": {      "type": "stdio",      "command": "npx",      "args": ["@octri/mcp", "--project-id", "YOUR_PROJECT_ID"]    }  }}

Environment variables

VariableRequiredDefaultDescription
OCTRI_PROJECT_IDYes*NoneThe project to connect to. Can also be set via --project-id CLI flag.
OCTRI_GROUPNoNoneServe only one tool group the project owner published (for example billing). Can also be set via --group. A group the project does not have serves no tools.
OCTRI_SKIP_PROMPTSNoNonePrompts to leave out, by name, comma-separated. Can also be set via --skip-prompts. The project's Claude Code plugin sets it for the prompts it already ships as slash commands, so each shows once.
OCTRI_API_URLNohttps://api.octri.dev/api/v1Override the API base URL for local development or an authorized private test endpoint. Hosted Octri self-hosting is not available.
MCP_TRANSPORTNostdiohttp for remote hosting (Streamable HTTP), or sse for the legacy transport.
PORTNo3000HTTP port for the http and sse transports.
MCP_HOSTNo127.0.0.1Interface to bind. Widening it requires MCP_AUTH_TOKEN.
MCP_ALLOWED_ORIGINSNoNoneComma-separated browser origins allowed to reach an HTTP transport.
MCP_AUTH_TOKENWhen MCP_HOST is not loopbackNoneBearer token every HTTP request must send as Authorization: Bearer <token>.

* Required unless every tool call passes projectId explicitly.

Credentials for the API being called

Operation tools call your real API, and these supply its credentials:

VariableDescription
OCTRI_API_BASE_URLTarget API base for operation calls (falls back to the studio's Base URL).
OCTRI_API_TOKENBearer / OAuth2 token.
OCTRI_API_KEY (+ OCTRI_API_KEY_HEADER)API-key value, and the header it goes in (default X-API-Key).
OCTRI_API_USERNAME / OCTRI_API_PASSWORDBasic-auth credentials.

All of these are sent as HTTP headers. An API that takes its credentials in the request body instead (Plaid's client_id and secret, for example) is not served by them: those are ordinary body fields, so they appear as tool arguments and the agent passes them like any other field. Setting OCTRI_API_KEY for such an API adds a header it ignores.

Permissions

The project owner sets every operation tool to run on its own, ask first, or off, and publishes that from the MCP page. Reads run on their own by default and everything else asks first. An "ask first" call is shown to the user through MCP elicitation (Claude Code 2.1.76+, VS Code) with its method, URL and body, and is sent only on approval. A client that cannot ask is refused the call instead.

These narrow what the owner allowed. Only ALLOW widens anything, and nothing brings back a tool the owner turned off:

VariableFlagEffect
OCTRI_READ_ONLY=1--read-onlyList and run only tools that read.
OCTRI_DENY_TOOLS=a,b--deny-tools a,bNever list or run these tools. Matches a tool's name, its endpoint slug, or the name it had before the project owner renamed it.
OCTRI_ALLOW_TOOLS=a,b--allow-tools a,bRun these "ask first" tools without asking (* for all). Matches a tool's current name or its endpoint slug; after a rename, an old name asks again.
OCTRI_ALLOW_WRITES=1--allow-writesSame as OCTRI_ALLOW_TOOLS=*.
OCTRI_DRY_RUN=1--dry-runBuild each call and return it to the agent unsent.
OCTRI_PRACTICE=1--practicePractice mode: answer every call with fake data built from the API's documentation, keeping records the agent creates for the session. Nothing is sent and no credential is needed. The project's owner must turn practice mode on.

Tool groups

A project owner can split the tools into groups, each served as its own MCP server, so a team connects only the tools a job needs. Pass --group <slug> (or set OCTRI_GROUP) to serve one. Inside a group every tool keeps the owner's permissions and the limits above: a group only takes tools away. Each group can also be reached hosted, at https://api.octri.dev/api/v1/public/mcp/<project id>/g/<group>/mcp.

Usage reporting

Each tool call reports its tool name, outcome, duration, tool group (when one is served) and the client's name to Octri, so the project owner can see which tools agents use. Arguments and responses are never sent. Set OCTRI_TELEMETRY=0 or pass --no-telemetry to turn it off.


Remote hosting

Use Streamable HTTP (MCP_TRANSPORT=http), the transport the MCP spec has defined for remote servers since revision 2025-03-26 and the one a current client tries first:

bash
docker build -t octri-mcp .
docker run -p 3000:3000 \  -e MCP_AUTH_TOKEN=<a long random token> \  -e OCTRI_PROJECT_ID=YOUR_PROJECT_ID \  octri-mcp

The image binds all interfaces, so it refuses to start without MCP_AUTH_TOKEN; clients send it as Authorization: Bearer <token>. It runs as a non-root user, and GET /health answers a container or load balancer probe without the token.

It serves a single endpoint, /mcp. A client's first request opens a session and gets its id back in the mcp-session-id header; every later request carries it and reaches the same server. That is what lets a tool that asks first work: the approval prompt goes out in the middle of a call and the answer comes back on another request. Sessions idle for 30 minutes are closed. Behind more than one replica, route by mcp-session-id (sticky sessions). Point a remote MCP client at http://your-host:3000/mcp.

Legacy HTTP+SSE transport

MCP_TRANSPORT=sse serves the older 2024-11-05 design, kept so existing deployments keep working. It exposes GET /sse to open a connection and POST /messages?sessionId=<id> to relay client messages. Prefer http for anything new.

Binding and origins

Both HTTP transports bind 127.0.0.1 by default and refuse any request whose Origin is not listed in MCP_ALLOWED_ORIGINS, or whose Host is not loopback. This server holds your API credentials, and any page the browser visits can reach a loopback port.

Widening MCP_HOST puts those credentials on the network, so the server then refuses to start without MCP_AUTH_TOKEN, and every request must send Authorization: Bearer <token>. Configure the same header in your MCP client, and list browser origins explicitly.


Check your setup

bash
npx -y @octri/mcp doctor --project-id YOUR_PROJECT_ID

Confirms the project and its tools load, the base URL and credentials are set, and makes one real read call, then says what to fix if anything fails. --no-call skips the call. Exits non-zero on a failure.


Keep the credential out of the config

bash
npx -y @octri/mcp login --project-id YOUR_PROJECT_ID

Asks for the API credential the project's scheme needs and saves it in your system keychain (macOS Keychain, Windows Credential Manager, or the Secret Service on Linux). Your MCP client's config then needs no OCTRI_API_* variable. A variable set in the config still wins. logout removes it.

The keychain store, @napi-rs/keyring, is an optional dependency. Where it cannot install or the system has no secret store, login says so and env variables work as before.


Local development

bash
# Buildpnpm build
# Run in stdio modeOCTRI_PROJECT_ID=my-project node dist/index.js
# Run in Streamable HTTP mode (POST /mcp)MCP_TRANSPORT=http OCTRI_PROJECT_ID=my-project node dist/index.js
# Run in the legacy SSE modeMCP_TRANSPORT=sse OCTRI_PROJECT_ID=my-project node dist/index.js

As a library

The octri-mcp command is one host for the server core. createServer takes the tool source and everything else a host decides:

ts
import { createServer, startStdio, processEnv, loadUserPermissions } from "@octri/mcp";
const env = processEnv("ACME"); // reads ACME_API_TOKEN, ACME_ALLOW_TOOLS, ...await startStdio(() =>  createServer({    // "live" fetches tools from the Octri API; "static" serves a fixed manifest.    source: { kind: "static", manifest },    branding: { name: "acme-mcp", version: "2.4.0" },    env,    permissions: loadUserPermissions(process.argv.slice(2), env),  }),);

A static source serves Octri's documentation tools, and reports usage, only when it is given an Octri project (octri: { apiUrl, projectId }).


Publishing

bash
pnpm buildpnpm pack:mcpbnpm publish --access publicgh release upload v<version> octri-mcp-<version>.mcpb --repo octridev/octri-mcpmcp-publisher publish

Requires an npm account with access to the @octri scope. pack:mcpb writes the MCP Bundle and points server.json at it on the GitHub release, so upload that exact file before mcp-publisher publish.


The rest of Octri

ProductWhat it does
API StudioYour OpenAPI spec becomes a hosted documentation site with a live request playground, editable page by page.
SDK StudioThe same spec becomes client libraries for ten languages, versioned and released together.
MCPYour endpoints and docs become tools an AI assistant can call, generated from the same spec.
MonitoringErrors, traces, uptime and releases for the API, joined to the SDK calls that reached it.

Monitoring runtimes

Node · Python · Go · Ruby · Rust · PHP · Java · Kotlin · Swift · Dart

Documentation · Pricing · Changelog

MIT licensed.

來源:README.md,提交 5acb0d4

工具

7

search_docs

Search the API documentation for an endpoint or concept

輸入參數limitquery必填projectId

get_endpoint

Get full documentation for a specific API endpoint

輸入參數slug必填projectId

list_endpoints

List the API's endpoints and guides, grouped by section. A large API lists its sections with endpoint counts instead: pass `section` to list one of them.

輸入參數sectionprojectId

get_changelog

Get recent API changes and breaking changes

輸入參數projectIdbreakingOnly

list_sdks

List the available SDK client libraries for this API (languages, versions, and download links)

輸入參數projectId

get_guide

Get the full content of a written guide (tutorial / conceptual doc) by its slug

輸入參數slug必填groupSlugprojectId

get_sdk_methods

Show how to call this API through its generated SDKs. With `slug` (from list_endpoints or search_docs): ready-to-use code for that endpoint in every SDK language, or in one with `language` (e.g. typescript, python, go). Without `slug`: the index of SDK methods, one line per endpoint.

輸入參數sluglanguageprojectId

版本歷史

6
  1. v1.4.2最新Nov 4, 2026
  2. v1.4.1Nov 3, 2026
  3. v1.4.0Nov 3, 2026
  4. v1.3.0Oct 19, 2026
  5. v1.2.2Oct 12, 2026
  6. v1.1.1Sep 25, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分