# octen-mcp [![npm version](https://img.shields.io/npm/v/octen-mcp.svg?color=blue)](https://www.npmjs.com/package/octen-mcp) [![npm downloads](https://img.shields.io/npm/dm/octen-mcp.svg)](https://www.npmjs.com/package/octen-mcp) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![CI](https://github.com/Octen-Team/octen-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/Octen-Team/octen-mcp/actions/workflows/ci.yml) MCP server for **Octen**. Plug it into Claude, Cursor, VS Code, Windsurf, or any MCP client to give your agent live web search and URL extraction. Core capabilities: - **`search`**: search the live web with domain, text, language, and time filters. - **`premier_search`**: the same search with deeper retrieval and more careful reranking — for the exact page that holds an answer, a niche document, or a query `search` answered thinly. Takes the same parameters as `search`; slower, and billed separately. - **`news_search`**: recent news, returned both as articles and as storylines — the coverage grouped into subjects, each with a summary and the span it covers. - **`pulse_search`**: the URL a query most likely means, in about 10ms — official docs, help centres, a site you could almost name. No freshness, no filters. - **`place_search`**: real-world places as structured cards — address, coordinates, phone, opening hours, rating — around a point you give it, or in an area the query names. - **`business_search`**: a company or person, returned as a structured card — profile, financials, key people, career history, recent announcements — alongside matching SEC filings and the sources behind it. - **`broad_search`**: decompose a query into multiple sub-queries, search them concurrently, and return results grouped per sub-query for broad coverage. - **`extract`**: turn one or more URLs into clean, LLM-ready content. - **`image_search`**: search the web for images by text query, by a reference image URL, or by base64 image data — exactly one of the three. - **`design_search`**: real designs to build from — screenshots of web pages, page sections, app screens and slides, each with the design values behind it, and the HTML for page sections. - **`video_search`** (In Beta — contact us for beta access): search the web for videos by text query. What makes Octen useful for agents is that `extract` returns more than page text. Each successful result also includes: - **`category`**: what the page is about - **`page_structure`**: what kind of page it is - **`highlights`**: ranked snippets when you pass a `query` That lets an agent skip login walls, nav pages, and off-topic URLs before spending tokens on the full body. ## Why Octen MCP ### Fast Web search averages 62ms. Fast enough for multi-step MCP workflows. ### Accurate Powered by SOTA text and VL embedding models. Better sources, fewer hallucinations. ### Fresh Live web data with minute-level updates. Useful for news, prices, and fast-moving pages. ### Efficient Clean highlights, optional `full_content`, and page labels keep model context relevant. ## Pricing Octen bills per call by default: $1 per 1,000 web searches, and new accounts start with $5 in credit. If your agent searches a lot, **Search Plan** is a flat monthly subscription with no overage fees: | | Standard | Plus | |---|---|---| | Price | $20 / month | $100 / month | | Web Search (`search`) | Unlimited | Unlimited | | Image Search (`image_search`) | 1,000 / month | 5,000 / month | | Priority at peak times | – | ✓ | What each tool costs on a plan: | Tool | On Search Plan | |---|---| | `search` | Included, unlimited | | `image_search` | Included up to the monthly quota, then pay-as-you-go | | `premier_search`, `news_search`, `pulse_search`, `broad_search`, `place_search`, `business_search`, `design_search`, `extract`, `video_search` | Pay-as-you-go, billed per call | | `monitor_*` | Pay-as-you-go: each monitor run is billed ($2 per 1,000 runs for a topic monitor, $3 per 1,000 runs per URL for a page monitor; runs with no change count, skipped and failed runs are free) | `full_content` is billed separately from the call, per result, on every tool that offers it. Pay-as-you-go, the first results of each search are free and only the ones beyond that allowance are billed; a Search Plan does not cover full content and has no free allowance. The rates and the allowance for each tool are on the pricing page. Once you subscribe, every API key on your account uses the plan, including keys issued through OAuth sign-in. Subscribe at [octen.ai/pricing](https://octen.ai/pricing?channel=gh-mcp). ## Quick start You need an `OCTEN_API_KEY` from [octen.ai](https://octen.ai) — or nothing at all, if your client signs in over OAuth (see [Signing in instead](#signing-in-instead)). **Two ways to connect.** Both serve the same tools: eleven that search and read the web, and ten that manage [monitors](#monitors). | | Endpoint | When | |---|---|---| | **Hosted (recommended)** | `https://mcp.octen.ai/mcp` | Nothing to install or update. Works with any client that speaks remote MCP. | | **Local** | `npx -y octen-mcp` | Clients without remote support, air-gapped setups, or when you want the process on your own machine. | > **Node compatibility (local only):** 0.4.2 and later run on every supported > Node (>= 18.17), including Node 26+. Versions 0.4.1 and below fail every call > on hosts whose embedded undici is v8+ (Node 26 and later) with > `Network error … code=UND_ERR_INVALID_ARG cause=invalid onError method` — if > you see that error, upgrade the package (or run on Node <= 24). ## Connect to the hosted endpoint ### Passing your key Three ways, tried in this order. **Prefer a header** — a key in a URL is exposed to proxy logs, browser history and `Referer` headers. | Form | Use when | |---|---| | `x-api-key: ` | The default. | | `Authorization: Bearer ` | Your client only offers one header field. | | `?octenApiKey=` appended to the URL | Your client accepts nothing but a URL. | Or use **OAuth** and paste no key at all — see [Signing in instead](#signing-in-instead). ### By client **Claude Code** — install the plugin. It brings the hosted server together with two skills, `octen-web-search` (routes a request to the right tool) and `octen-research` (multi-source research pipeline): ```bash claude plugin marketplace add Octen-Team/octen-mcp claude plugin install octen@octen ``` Or from inside a session: `/plugin marketplace add Octen-Team/octen-mcp`, then `/plugin install octen@octen`. The plugin carries no credential. The first call is answered `401` and Claude Code walks you through the OAuth sign-in — run `/mcp` if you want to start it yourself. To register the server on its own instead, with a key: ```bash claude mcp add --transport http octen https://mcp.octen.ai/mcp --header "x-api-key: your-key-here" ``` **Cursor** — clone this repository into Cursor's local plugin directory to get the hosted server and both skills in one step: ```bash git clone https://github.com/Octen-Team/octen-mcp ~/.cursor/plugins/local/octen ``` A Cursor Marketplace listing is pending review; this section will point at it once it is live. To wire up only the server, add it to `~/.cursor/mcp.json`: ```json { "mcpServers": { "octen": { "url": "https://mcp.octen.ai/mcp", "headers": { "x-api-key": "your-key-here" } } } } ``` **VS Code** — `.vscode/mcp.json` (workspace) or the user config. Note `servers`, not `mcpServers`, and the explicit `type`: ```json { "servers": { "octen": { "type": "http", "url": "https://mcp.octen.ai/mcp", "headers": { "x-api-key": "your-key-here" } } } } ``` **Codex** ```bash codex mcp add octen --url https://mcp.octen.ai/mcp --header "x-api-key: your-key-here" ``` **Windsurf / Devin Desktop** — `~/.config/devin/mcp_config.json` on macOS and Linux (`$XDG_CONFIG_HOME/devin/` when that is set), `%APPDATA%\devin\mcp_config.json` on Windows. Cascade accepts either `serverUrl` or `url` for a remote server; `~/.codeium/windsurf/mcp_config.json` is the path for the legacy agent: ```json { "mcpServers": { "octen": { "serverUrl": "https://mcp.octen.ai/mcp", "headers": { "x-api-key": "your-key-here" } } } } ``` **Gemini CLI** — `~/.gemini/settings.json`. The key is `httpUrl`: ```json { "mcpServers": { "octen": { "httpUrl": "https://mcp.octen.ai/mcp", "headers": { "x-api-key": "your-key-here" } } } } ``` **Claude Desktop** takes the URL directly — no config file, no bridge. In **Settings → Connectors**, click **Add custom connector**, name it `Octen`, and enter: ``` https://mcp.octen.ai/mcp ``` Leave the Advanced settings empty: the OAuth Client ID and Secret fields are for servers that cannot register a client on their own, and ours can. Claude will offer to sign you in, and an Octen key is issued to that connection when you approve. The connector dialog has no field for request headers, so an **API key** goes in the URL instead: ``` https://mcp.octen.ai/mcp?octenApiKey=your-key-here ``` Signing in is the better of the two — a URL is not a secret-carrying medium, and the sign-in flow can be revoked from your account without editing anything on this side. Note also that Claude connects from Anthropic's servers rather than from your machine, so a self-hosted deployment has to be reachable from the public internet for this to work at all; a private one wants the bridge below. **Zed, Warp, Raycast, and Cline** all connect to a remote server directly — point them at the endpoint and sign in. Raycast's HTTP transport offers an OAuth type of *Dynamic*, which is the one to pick: this server supports dynamic client registration, so there is no client ID to arrange. ```json { "mcpServers": { "octen": { "url": "https://mcp.octen.ai/mcp" } } } ``` A client with no field for headers takes the key in the URL instead: `https://mcp.octen.ai/mcp?octenApiKey=your-key-here`. **Only for a client that still cannot reach a remote server at all**, the `mcp-remote` bridge runs locally and forwards each request. Note there is **no space after the colon** in `--header` — the value is split on the first one: ```json { "mcpServers": { "octen": { "command": "npx", "args": [ "-y", "mcp-remote", "https://mcp.octen.ai/mcp", "--header", "x-api-key:your-key-here" ] } } } ``` ### Signing in instead If the deployment is configured with an authorization server — the hosted one is — a request with no credential is answered `401` + `WWW-Authenticate: Bearer resource_metadata="…"`. That is the signal MCP clients use to start an OAuth flow, so a client that supports OAuth will offer to sign you in rather than ask for a key. To move a connection that already has a key onto OAuth, point it at `https://mcp.octen.ai/mcp/oauth` (or append `?login`). That path issues the challenge even when a key is present, which is the only way to trigger the switch — with a key attached, the ordinary endpoint has no reason to. ### Loading fewer tools `?tools=search,extract` limits a connection to the tools you name, for both `tools/list` and `tools/call`: ``` https://mcp.octen.ai/mcp?tools=search,extract ``` Clients load every advertised tool's full schema into the model's context, so narrowing the set is a real saving when you only need one or two. An unknown name is refused with a `400` listing the valid ones, rather than a connection that quietly comes up short. `?toolsets=search` or `?toolsets=monitor` selects a whole group (with `tools`, the union of both). `?read_only=true` hides every tool that changes anything, and `monitor_preview`, even if named. Under stdio the same switches are the `OCTEN_TOOLSETS` and `OCTEN_READ_ONLY` environment variables. ## Run it locally instead ```json { "mcpServers": { "octen": { "command": "npx", "args": ["-y", "octen-mcp"], "env": { "OCTEN_API_KEY": "your-key-here" } } } } ``` [![Install in VS Code](https://img.shields.io/badge/Install%20in-VS%20Code-007ACC?logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect/mcp/install?name=octen&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22apiKey%22%2C%22description%22%3A%22Octen%20API%20Key%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22octen-mcp%22%5D%2C%22env%22%3A%7B%22OCTEN_API_KEY%22%3A%22%24%7Binput%3AapiKey%7D%22%7D%7D) [![Install in VS Code Insiders](https://img.shields.io/badge/Install%20in-VS%20Code%20Insiders-24bfa5?logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=octen&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22apiKey%22%2C%22description%22%3A%22Octen%20API%20Key%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22octen-mcp%22%5D%2C%22env%22%3A%7B%22OCTEN_API_KEY%22%3A%22%24%7Binput%3AapiKey%7D%22%7D%7D&quality=insiders) | Agent | One-line install | |--|--| | Claude Code | `claude mcp add --scope user octen -e OCTEN_API_KEY=your-key-here -- npx -y octen-mcp` | | Codex | `codex mcp add octen --env OCTEN_API_KEY=your-key-here -- npx -y octen-mcp` | | Gemini CLI | `gemini mcp add octen -e OCTEN_API_KEY=your-key-here -- npx -y octen-mcp` | | VS Code | `code --add-mcp '{"name":"octen","command":"npx","args":["-y","octen-mcp"],"env":{"OCTEN_API_KEY":"your-key-here"}}'` (or click a badge above) | | Cursor | [Add to Cursor](https://cursor.com/en/install-mcp?name=octen&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm9jdGVuLW1jcCJdLCJlbnYiOnsiT0NURU5fQVBJX0tFWSI6InlvdXIta2V5LWhlcmUifX0%3D) (then edit the key), or use the JSON above in `~/.cursor/mcp.json` | | Claude Desktop | No CLI. For the hosted endpoint use **Settings → Connectors → Add custom connector** (above); for a local install, the config file (below) | ### Config file locations - **Claude Desktop**: `~/Library/Application\ Support/Claude/claude_desktop_config.json` — only needed for a local (stdio) install; the hosted endpoint is added as a connector instead - **Cursor**: `~/.cursor/mcp.json` - **VS Code workspace**: `.vscode/mcp.json` (use `servers` instead of `mcpServers`) - **Windsurf**: `~/.codeium/windsurf/mcp_config.json` - **Gemini CLI**: `~/.gemini/settings.json` - **Cline / other clients**: paste it into that client's MCP settings ## Troubleshooting **`401` on every call.** No credential reached the server, or the sign-in was never completed. On a client that signs in, authorise the connection from its MCP settings. On one that passes a key, check the header name — `x-api-key`, or `Authorization: Bearer` — and, if you are using `mcp-remote`, that there is no space after the colon in `--header`. **The tools do not appear.** Most clients read MCP config once at startup; restart the client after editing it. If the config uses the wrong key for your client (`url` vs `serverUrl` vs `httpUrl`), the server is never contacted at all — see the per-client sections above. **`406 Not Acceptable`.** The request's `Accept` header must list *both* `application/json` and `text/event-stream`. Clients do this for you; hand-rolled `curl` probes usually do not, and the resulting 406 looks like an auth failure. **`400` mentioning `tools`, `toolsets` or `read_only`.** A name in `?tools=` is not one this deployment serves, a group in `?toolsets=` is not `search` or `monitor`, or `read_only` is not `true` / `false`. The error lists the valid values. **A tool errors with `code=403 … beta access`.** `video_search` is in Beta and enabled per account; the message says how to request it. **Errors name what happened.** A failed call reports which dependency failed and why — a timeout, a connection code, an expired token and by how long — plus Octen's own `request_id` where the API returned one. Quote that id in a support request; it is the one an engineer can look up. ## Tools | Tool | What it does | Best for | |---|---|---| | `search` | Search the live web with domain, text, language (ISO 639-1), time, and content controls | a single focused web search | | `premier_search` | Web Search Premier: the same parameters and the same results as `search`, with deeper retrieval and more careful reranking. Slower, and billed at its own rate | the exact page behind a specific fact, niche or hard-to-find documents, a query `search` answered thinly | | `news_search` | Recent news as ranked articles plus `subjects` — the coverage grouped into storylines with summaries | current events and timely reporting | | `business_search` | Company and person cards (profile, financials, key people, career, recent activity), SEC filings (Form 4, 10-K, 10-Q, 8-K) and the ranked sources | due diligence, competitor and executive lookup, insider trades | | `place_search` | Place cards (address, coordinates, phone, hours, status, rating) around a point or in a named area; web pages about them are opt-in | "near me", local lookup, opening hours, contact details | | `pulse_search` | Predicted destinations — titles and URLs in ~10ms, or page content in `standard` mode. No filters, no freshness | reaching known docs, help pages, a site you could name | | `broad_search` | Decompose a query into up to `max_queries` sub-queries, search concurrently, return grouped results (same per-sub-query options as `search`, including the `language` filter) | research-style, multi-angle coverage | | `extract` | Fetch 1-20 URLs and return clean content, labels, and optional highlights | summarization, RAG, fact lookup | | `image_search` | Search the web for images by text query (optional reference `image_url`) | finding pictures, photos, visual references | | `design_search` | Screenshots of real web pages, page sections, app screens and slides, each with its design values (colours, fonts, sizes) and, for page sections, the HTML; web pages on the same query alongside | building or restyling a UI or a deck from real references | | `video_search` | _In Beta — contact us for beta access._ Search the web for videos by text query | finding videos, clips, footage | The monitor tools are listed under [Monitors](#monitors). These are the whole surface, on purpose. Embeddings, chat completions, Answer and Research are Octen APIs that this server deliberately does not expose — reach them through the [Python SDK](https://pypi.org/project/octen/) or the [CLI](https://www.npmjs.com/package/@octen.ai/cli). A tool an agent can see is a tool it will try, so the roster stays the set that earns its place in a tool list. Reference docs: - Search: [docs.octen.ai/api-reference/search](https://docs.octen.ai/api-reference/search) - Web Search Premier: [docs.octen.ai/api-reference/search-premier](https://docs.octen.ai/api-reference/search-premier) - Design Search: [docs.octen.ai/api-reference/design-search](https://docs.octen.ai/api-reference/design-search) - Extract: [docs.octen.ai/api-reference/extract](https://docs.octen.ai/api-reference/extract) ### Monitors A monitor watches a topic (new results) or up to 10 pages (changes) on a schedule and records an event when a change meets a plain-language condition. Monitors keep running and are billed per run. Every write tool is annotated so clients ask before it runs; deleting, which can't be undone, also needs a preview the user has seen. | Tool | What it does | |---|---| | `monitor_list`, `monitor_get` | List monitors, or show one with its settings and last run | | `monitor_runs`, `monitor_run` | A monitor's runs (counts, cost, skip and failure reasons), or one run with its items | | `monitor_events` | What a monitor found: new results or page changes that met its condition | | `monitor_preview` | Shows what a create, change or delete would do and cost, changing nothing. Required before a delete (returns its `confirm_token`), optional otherwise | | `monitor_create` | Create a monitor; refused when one with the same topic, pages or name exists, unless `allow_duplicate`. The first run starts right away | | `monitor_update` | Change, pause or resume a monitor | | `monitor_delete` | Delete a monitor (needs `confirm_token` from `monitor_preview`); it can't be undone | | `monitor_trigger` | Run a monitor once now; each run is billed | **How writes are guarded.** Create, change, pause, resume and run-now rely on the client's approval prompt, driven by the tool annotations (a client set to "always allow" these tools skips that prompt). A create is refused when a monitor with the same topic, pages or name already exists, so a create whose reply was lost is not repeated; `allow_duplicate: true` overrides that when the user wants another. A delete needs `monitor_preview` first: it shows the monitor and returns a signed `confirm_token`, valid for 10 minutes and only for that monitor and key. Before deleting, the server reads the monitor again and refuses if it changed since the preview. The token proves a preview was made; showing it to the user is the agent's job. **Webhooks** are not set through these tools: their signing secret would land in the conversation. Add one with the [CLI](https://www.npmjs.com/package/@octen.ai/cli) (`octen monitor update --webhook `); `monitor_update` can still remove one (`clear: ["webhook"]`). No tool result ever contains a secret. **Writes are not retried** once they may have reached the API; an uncertain result says how to check (`monitor_get`, `monitor_list`, `monitor_runs`). Reference: [docs.octen.ai/capabilities/monitor](https://docs.octen.ai/capabilities/monitor). ### Parameters Transcribed from the schemas each tool publishes — and those are enforced, so an out-of-contract value is refused before any call is made, with a message naming the field. The limits track the [API reference](https://docs.octen.ai/api-reference/search); a test fails if the two drift apart. `image_search` takes **exactly one** of `query`, `image_url` or `image_data`. `query` must be non-empty: an empty string is refused by the schema, and a whitespace-only one by the handler. Neither reaches the API. `design_search` is the one exception — its `query` may be left out when `images.group_id` names a group to fetch. **`timeout` means two different things.** On `search`, `premier_search`, `news_search`, `broad_search`, `image_search`, `design_search` and `video_search` it is this server's own HTTP deadline for the call — it is removed from the request body and never sent to the API. On `extract` it is the API's documented **per-URL fetch budget** (1-60s) and does travel in the body; the local deadline for an extract call is derived from it with headroom, so raising `timeout` raises both. Overlapping `include_domains` and `exclude_domains` are passed through as given. The API currently answers a domain listed in both with a validation error; the published [reference](https://docs.octen.ai/api-reference/search) describes exclusion taking precedence. Until those agree, this server neither silently drops nor reorders your filters — you get the API's answer. #### `search` | Parameter | Type | Required | Limits | Default | |---|---|---|---|---| | `query` | string | yes | 1–500 chars | | | `result_type` | string | | `standard` / `dynamic` | `"standard"` | | `count` | integer | | 1–100 | `5` | | `include_domains` | array | | ≤1200 items; each ≤60 | | | `exclude_domains` | array | | ≤1200 items; each ≤60 | | | `include_text` | array | | ≤5 items; each ≤30 | | | `exclude_text` | array | | ≤5 items; each ≤30 | | | `time_basis` | string | | `auto` / `published` / `crawled` | `"auto"` | | `time_range` | string | | `day` / `week` / `month` / `year` / `d` / `w` / `m` / `y` | | | `start_time` | string | | | | | `end_time` | string | | | | | `format` | string | | `text` / `markdown` | `"text"` | | `safesearch` | string | | `off` / `strict` | `"strict"` | | `language` | array | | | `[]` | | `highlight` | object | | `enable`, `max_tokens` | | | `full_content` | object | | `enable`, `max_tokens` | | | `include_images` | boolean | | | `false` | | `timeout` | integer | | 1–60 | | `result_type: standard` returns results as the other parameters specify. `dynamic` returns only the relevant results, up to `count` (so `count` is a maximum, and fewer may come back), and Octen may adjust the highlight length per result, so `highlight.max_tokens` is a cap rather than a target. Any other value is refused before the request is sent. #### `premier_search` | Parameter | Type | Required | Limits | Default | |---|---|---|---|---| | `query` | string | yes | 1–500 chars | | | `result_type` | string | | `standard` / `dynamic` | `"standard"` | | `count` | integer | | 1–100 | `5` | | `include_domains` | array | | ≤1200 items; each ≤60 | | | `exclude_domains` | array | | ≤1200 items; each ≤60 | | | `include_text` | array | | ≤5 items; each ≤30 | | | `exclude_text` | array | | ≤5 items; each ≤30 | | | `time_basis` | string | | `auto` / `published` / `crawled` | `"auto"` | | `time_range` | string | | `day` / `week` / `month` / `year` / `d` / `w` / `m` / `y` | | | `start_time` | string | | | | | `end_time` | string | | | | | `format` | string | | `text` / `markdown` | `"text"` | | `safesearch` | string | | `off` / `strict` | `"strict"` | | `language` | array | | | `[]` | | `highlight` | object | | `enable`, `max_tokens` | | | `full_content` | object | | `enable`, `max_tokens` | | | `include_images` | boolean | | | `false` | | `timeout` | integer | | 1–60 | | `/search-premier` is documented as a drop-in for `/search`: the same request body and the same response, and as tools the two take the same parameters — `result_type` included — so arguments written for one work unchanged with the other. What differs is behind the endpoint — deeper retrieval and more careful reranking, so the page that holds the answer ranks higher — and what a call costs: it takes longer than `search`, it is billed at its own per-call rate, and a Search Plan's unlimited searches do not cover it. Use `search` by default and this one when ranking quality is what is missing. #### `news_search` | Parameter | Type | Required | Limits | Default | |---|---|---|---|---| | `query` | string | yes | 1–500 chars | | | `count` | integer | | 1–100 | `5` | | `include_domains` | array | | ≤1200 items; each ≤60 | | | `exclude_domains` | array | | ≤1200 items; each ≤60 | | | `time_basis` | string | | `auto` / `published` / `crawled` | `"auto"` | | `time_range` | string | | `day` / `week` / `month` / `year` / `d` / `w` / `m` / `y` | | | `start_time` | string | | | | | `end_time` | string | | | | | `language` | array | | | `[]` | | `highlight` | object | | `enable`, `max_tokens` | | | `full_content` | object | | `enable`, `max_tokens` | | | `subjects` | object | | `enable`, `count` 1–5, `max_sub_news` 1–20 | | | `timeout` | integer | | 1–60 | | `/news-search` is its own endpoint, so this is a different parameter set from `search`: no `include_text`/`exclude_text`, `format`, `safesearch` or `include_images`, and `subjects` on top. Omit `subjects` to take the API's default (on, 2 storylines, 5 supporting articles each). #### `business_search` | Parameter | Type | Required | Limits | Default | |---|---|---|---|---| | `query` | string | yes | 1–500 chars | | | `count` | integer | | 1–100 | `5` | | `include_domains` | array | | ≤1200 items; each ≤60 | | | `exclude_domains` | array | | ≤1200 items; each ≤60 | | | `time_basis` | string | | `auto` / `published` / `crawled` | `"auto"` | | `time_range` | string | | `day` / `week` / `month` / `year` / `d` / `w` / `m` / `y` | | | `start_time` | string | | | | | `end_time` | string | | | | | `language` | array | | | `[]` | | `highlight` | object | | `enable`, `max_tokens` | | | `full_content` | object | | `enable`, `max_tokens` | | | `entities` | object | | `enable`, `count` 1–20, `max_activities` 1–20, `max_news` 1–20 | | | `records` | object | | `enable`, `count` 1–20, `sources` (`edgar`) | | | `timeout` | integer | | 1–60 | | The domain, time and language filters never apply to the entity cards. Omit `entities` to take the API's default (on, 2 entities, 5 activities and 5 news items each). `records` are SEC filings from EDGAR, each with its parties and a `facts` object (for example Form 4 transactions or a 10-Q financial table). The time range filters them by filing date; the domain and language filters do not apply. Omit `records` to take the API's default (on, 5 filings). Long `facts` are shortened in the tool output: arrays show their first 10 items, tables their first 40 rows, and each filing's facts stop at 4,000 characters. With `full_content` enabled, each filing's full text also counts toward `full_content` billing. #### `place_search` | Parameter | Type | Required | Limits | Default | |---|---|---|---|---| | `query` | string | yes | 1–500 chars | | | `latitude` | number | | −90–90, WGS84; needs `longitude` | | | `longitude` | number | | −180–180, WGS84; needs `latitude` | | | `radius` | integer | | 1–50000 m; needs both coordinates | | | `user_location` | object | | `type` (`approximate`), `city`, `region`, `country`, `timezone` | | | `places` | object | | `count` 1–20 | | | `web_search` | object | | see below | off | | `timeout` | integer | | 1–60 | | `web_search` holds the filters the other search tools take top-level: `enable` (default **false**), `count` 1–100, `highlight`, `full_content`, `include_domains`, `exclude_domains`, `language`, `time_basis`, `time_range`, `start_time`, `end_time`. The places are the answer here and the pages cost context, which is why `web_search` is off unless asked for. Pass a coordinate pair to get a `distance` on every card; `user_location` is the fallback when only the city is known, and returns no distances. #### `pulse_search` | Parameter | Type | Required | Limits | Default | |---|---|---|---|---| | `query` | string | yes | 1–500 chars | | | `mode` | string | | `lite` / `standard` | `"lite"` | | `count` | integer | | 1–10 | `5` | | `safesearch` | string | | `off` / `strict` | `"strict"` | | `include_images` | boolean | | no effect in `lite` | `false` | | `highlight` | object | | `enable`, `max_tokens`; no effect in `lite` | | | `full_content` | object | | `enable`, `max_tokens`; no effect in `lite` | | | `timeout` | integer | | 1–60 | | A destination predictor, not a search: one inference produces the URLs a query most likely means. It takes none of `search`'s domain, text, time or language filters, sees no fresh content, and caps `count` at 10 rather than 100. In `lite` the API returns URLs **without a scheme**; this server puts `https://` back so the result can be passed straight to `extract`. `standard` adds highlights, full content and images at roughly twice the latency. #### `broad_search` | Parameter | Type | Required | Limits | Default | |---|---|---|---|---| | `query` | string | yes | 1–500 chars | | | `max_queries` | integer | | 1–30 | `5` | | `result_type` | string | | `standard` / `dynamic` | `"standard"` | | `count` | integer | | 1–100 | `5` | | `include_domains` | array | | ≤1200 items; each ≤60 | | | `exclude_domains` | array | | ≤1200 items; each ≤60 | | | `include_text` | array | | ≤5 items; each ≤30 | | | `exclude_text` | array | | ≤5 items; each ≤30 | | | `time_basis` | string | | `auto` / `published` / `crawled` | `"auto"` | | `time_range` | string | | `day` / `week` / `month` / `year` / `d` / `w` / `m` / `y` | | | `start_time` | string | | | | | `end_time` | string | | | | | `format` | string | | `text` / `markdown` | `"text"` | | `safesearch` | string | | `off` / `strict` | `"strict"` | | `language` | array | | | `[]` | | `highlight` | object | | `enable`, `max_tokens` | | | `full_content` | object | | `enable`, `max_tokens` | | | `include_images` | boolean | | | `false` | | `timeout` | integer | | 1–300 | | `result_type` is sent inside `search_options`, so it applies to every sub-query. It means what it does on `search`: `standard` returns results as the other parameters specify, while `dynamic` treats `count` as a maximum per sub-query (fewer may come back) and Octen may adjust the highlight length per result. #### `extract` | Parameter | Type | Required | Limits | Default | |---|---|---|---|---| | `urls` | array | yes | ≤20 items; each ≤2048 | | | `query` | string | | ≤500 chars | | | `max_age_seconds` | integer | | 300–31536000 | `86400` | | `format` | string | | `markdown` / `text` | `"markdown"` | | `timeout` | integer | | 1–60 | `30` | | `include_images` | boolean | | | `false` | | `include_videos` | boolean | | | `false` | | `include_audio` | boolean | | | `false` | | `mode` | string | | `standard` / `advanced` / `auto` | omitted (API uses `standard`) | | `include_links` | object | | `scope` (`prefer_internal` / `prefer_external`), `max_links` (1–1000) | `{}` → `prefer_internal`, `200` | Choosing `mode`: | Scenario | mode | |---|---| | News / blogs / docs / product pages (ordinary sites) | `standard` (or omit) | | Known hard sites (Reddit / X / LinkedIn / ResearchGate / anti-bot / SPA) | `advanced` | | Mixed batch, unsure which are hard | `auto` | | Cost-sensitive, mostly ordinary sites | `standard` | | Quality first, mostly hard sites | `advanced` | `standard` can report `success` with empty or skeletal content on hard sites; retry just those URLs with `advanced`. `advanced` is slower and 2.5x the price of `standard`; `auto` bills each URL at the mode it used. With `advanced` or `auto`, raise `timeout` (e.g. 60). Each result shows its `resolved_mode`, and the meta line's `billed:` counts come from `meta.usage.successful_by_mode`, which is authoritative for billing. #### `image_search` | Parameter | Type | Required | Limits | Default | |---|---|---|---|---| | `query` | string | | ≤500 chars | | | `image_url` | string | | | | | `image_data` | string | | ≤5242880 chars | | | `count` | integer | | 1–10 | `5` | | `include_domains` | array | | | | | `exclude_domains` | array | | | | | `safesearch` | string | | `off` / `strict` | `"strict"` | | `timeout` | integer | | 1–60 | | #### `design_search` | Parameter | Type | Required | Limits | Default | |---|---|---|---|---| | `query` | string | unless `images.group_id` is set | ≤500 chars | | | `images` | object | | see below | on | | `web_search` | object | | see below | on | | `timeout` | integer | | 1–60 | | `images` holds what comes back per design: `enable` (default **true**), `count` 1–100 (default 5), `design_facts` (default true), `snippet` (`enable`, default true; `max_tokens` 100–100000, default 5000) and `group_id`. `web_search` holds the filters the other search tools take top-level: `enable` (default **true**), `count` 1–100, `highlight`, `full_content`, `include_domains`, `exclude_domains`, `language`, `time_basis`, `time_range`, `start_time`, `end_time`. They apply to the web results only. Each image is a `web_page`, a `web_section`, an `app_screen` or a `slide`, and comes back as a link to the screenshot, a thumbnail, its design values and — for page sections — the HTML. The links are signed and time-limited, so use them rather than store them. The design values are passed through as the API returns them, because their shape depends on what the image is. A page section or a slide belongs to a group — the page it was cut from, the deck it came out of — and its result names the `group_id`, its position and the size of the group. Pass that id as `images.group_id` to get the group in order; that call needs no `query`. `images.count` still applies and still defaults to 5, so set it to the group's size to get all of it — up to 100, the most one call returns. A group id the API does not know is answered with an empty success, which this server reports as `No images in group …`. Three calls are refused here rather than sent: neither a `query` nor a group; a group with `images.enable: false`; and `images` and `web_search` both switched off, which the API answers with an empty success that still counts as a search. A `group_id` is trimmed before it is sent, and a blank one is treated as no group. A non-2xx answer that carries no Octen error code, or a 2xx whose body is not an Octen response at all, is reported as an error rather than as an empty result. An entry that cannot be rendered is named in its place rather than taking the valid ones with it, and an empty result keeps its meta line. `premier_search` does the same. The response is large — a default call returns five designs with their values and code plus five web results. Switch off what the task does not need. #### `video_search` | Parameter | Type | Required | Limits | Default | |---|---|---|---|---| | `query` | string | yes | 1–500 chars | | | `count` | integer | | 1–10 | `5` | | `time_range` | string | | `day` / `week` / `month` / `year` / `d` / `w` / `m` / `y` | | | `start_time` | string | | | | | `end_time` | string | | | | | `safesearch` | string | | `off` / `strict` | `"strict"` | | `timeout` | integer | | 1–60 | | ### Keep the tools always on (optional) In clients with **MCP tool search** enabled (the Claude Code default), tools are *deferred* — the model runs a `ToolSearch` step to load them on demand. If you'd rather have the Octen tools resident from the first turn (no discovery step), set `alwaysLoad` on the server in your `.mcp.json` (Claude Code v2.1.121+): ```jsonc { "mcpServers": { "octen": { "command": "npx", "args": ["-y", "octen-mcp"], "env": { "OCTEN_API_KEY": "your-key-here" }, "alwaysLoad": true } } } ``` Each always-loaded tool uses context on every turn, and `alwaysLoad` blocks startup until the server connects (capped at the ~5s connect timeout), so reserve it for tools you hit constantly. To keep the cost down, mark just the highest-traffic tools — e.g. `search` and `broad_search` — with `"anthropic/alwaysLoad": true` in each tool's `_meta`, leaving the rest deferred. ## Why agents like this Most extract tools stop at "here is the page body." Octen helps one step earlier: - **Skip bad pages early**: `page_structure.primary == "No Main Content"` tells the agent it hit a login wall, empty shell, or similar non-content page. - **Filter by topic early**: `category` helps a pipeline ignore pages outside the target vertical before embedding or summarizing. - **Use less context**: `query` returns `highlights` when the user wants a specific fact instead of the full page. For the full decision tree and integration patterns, see [docs/best-practices.md](docs/best-practices.md). ## Example prompts - `Fetch octen.ai and summarize the main product features.` - `Search for recent MCP news from the last week.` - `Fetch these URLs and only summarize the ones whose category is Finance.` - `Search site:docs.anthropic.com prompt caching and return only the relevant highlights.` - `Find real pricing-section designs for a SaaS landing page, then build one from the closest match.` - `Use premier search to find the page that states Kafka's default topic retention period.` ## Self-hosting the HTTP server The hosted endpoint above runs this same code; you can run it yourself instead: ```bash PORT=8080 npx -y -p octen-mcp octen-mcp-http # or: octen-mcp-http after a global install ``` Endpoints: `POST /mcp` (stateless Streamable HTTP) and `GET /healthz`. Stateless by design — there is no session to lose, so scaling is a matter of running more copies behind a load balancer. Credentials travel per request and never come from the server's own environment: a request without one fails rather than quietly spending the host's key. **Authorization is off unless you configure it.** Set both `OCTEN_OAUTH_AUTHORIZATION_SERVER` and `OCTEN_MCP_RESOURCE` and the server advertises RFC 9728 protected-resource metadata and answers uncredentialed requests with a `401` challenge. Leave them unset and it advertises nothing — an instance should never point clients at an authorization server it does not have — and a missing key surfaces at call time instead. **Argument validation.** Each tool's declared `inputSchema` is enforced, not just advertised: types, ranges, string lengths, array sizes, enums, required parameters, and the property list itself. An out-of-contract call is refused with a message naming the field, before anything is sent to the API. **Sending an image as base64.** `image_search` accepts `image_data` up to 5MB encoded, which travels inside the JSON-RPC body. `OCTEN_MCP_MAX_BODY` defaults to 6 MiB to make that work unconfigured; `OCTEN_MCP_MAX_INFLIGHT_BODY` (24 MiB) separately bounds what all in-flight bodies hold at once, since a per-request cap does nothing about many concurrent ones. ## Environment variables | Variable | Required | Default | Notes | |---|---|---|---| | `OCTEN_API_KEY` | yes | — | | | `OCTEN_API_URL` | no | `https://api.octen.ai` | | | `OCTEN_MONITOR_API_URL` | no | `OCTEN_API_URL` | Origin for the `monitor_*` tools only. Set it when the server calls services directly and `/monitors` is served by a different service than the search endpoints; leave it unset when `OCTEN_API_URL` is `https://api.octen.ai`. | | `OCTEN_ENABLE_BETA_TOOLS` | no | on | Set to `false`/`0`/`off`/`no` to hide the Beta `video_search` tool from discovery. `image_search` was covered by this switch until the API opened it to every account. | | `HTTPS_PROXY` / `HTTP_PROXY` / `NO_PROXY` | no | — | Honoured since 0.4.0. Node's built-in `fetch` ignores these by default, so before 0.4.0 the server could not reach the API from behind a proxy even when every other tool on the machine could. **Set them explicitly in your client config** — see below; most MCP clients do not pass your shell environment through. | | `OCTEN_KEEP_ALIVE_MS` | no | `60000` | How long an idle connection is kept for reuse. undici's own default of 4s meant nearly every call re-paid a full TLS handshake (~515ms measured). 60s is measured against `api.octen.ai`, which closes idle connections between 60s and 90s — staying under that means we always release first, instead of dispatching onto a socket the origin has already closed. Re-measure if you point `OCTEN_API_URL` elsewhere. | | `OCTEN_KEEP_ALIVE_MAX_MS` | no | `600000` | Upper bound on the above when the origin advertises its own `Keep-Alive` hint. `api.octen.ai` does not send one. | | `OCTEN_CONNECT_TIMEOUT_MS` | no | `10000` | Ceiling on **establishing the outbound connection to `api.octen.ai`** — unrelated to the MCP client's own startup connect timeout mentioned above. Lower it (e.g. `5000`) on a path where connections fail intermittently, so the automatic retry engages sooner. | | `OCTEN_RETRY` | no | on | Set to `false`/`0`/`off`/`no` to disable the single automatic retry on connection-level failures. Retries cost quota when the original request had in fact reached the server. | | `OCTEN_HTTP2` | no | off | Opt into HTTP/2. Measured no faster for the usual one-request-at-a-time pattern, and not reliable through every CONNECT proxy — worth trying if you issue many tool calls in parallel. | | `OCTEN_MCP_DEBUG` | no | off | Request tracing on **stderr** (stdout carries MCP framing). See below. | | `OCTEN_MCP_CONFIRM_SECRET` | for `monitor_delete` over HTTP | — | Signs the confirmation tokens `monitor_delete` requires. At least 32 bytes; every replica of one deployment must share the value. Unset over HTTP, `monitor_delete` is not served (the other monitor tools are); unset under stdio, a random per-process secret is used. | | `OCTEN_TOOLSETS` | no | all groups | stdio only (over HTTP use `?toolsets=`). Comma list of tool groups to serve: `search`, `monitor`. | | `OCTEN_READ_ONLY` | no | off | stdio only (over HTTP use `?read_only=true`). `true`/`1` hides every tool that changes anything, and `monitor_preview`. | ### Remote HTTP form only These are read only by `octen-mcp-http`; the stdio entry ignores them. | Variable | Required | Default | Notes | |---|---|---|---| | `PORT` | no | `8080` | `0` picks an ephemeral port. | | `OCTEN_MCP_LOG` | no | human text | `json` emits one JSON object per event, for a log pipeline. | | `OCTEN_MCP_MAX_BODY` | no | `6291456` | Per-request body cap, in bytes, enforced on bytes received. Over it: `413`. Sized so `image_search`'s `image_data` (5MB encoded) works unconfigured; turn it down if this deployment never sends images. | | `OCTEN_MCP_MAX_INFLIGHT_BODY` | no | `25165824` | Ceiling on the total bytes all in-flight bodies hold at once. The per-request cap stops one huge request; this stops many ordinary ones. Over it: `503` + `Retry-After`. Measured: resident cost runs about ten times this, because a base64 body exists two or three times over as a UTF-16 string. | | `OCTEN_MCP_BODY_DRAIN_MS` | no | `2000` | After a `413`, how long to keep discarding the rest of the body so the `413` itself gets delivered. | | `OCTEN_DRAIN_TIMEOUT_MS` | no | `310000` | On `SIGTERM`, how long in-flight calls may finish. Must stay below the pod's `terminationGracePeriodSeconds`, and above the longest tool budget (`broad_search`, 300s). | | `OCTEN_APPS_CHALLENGE_TOKEN` | no | — | Plugin-directory domain-verification token. When set, `GET /.well-known/openai-apps-challenge` serves exactly this value as plain text (the body must be the token alone); unset, the path answers `404`. Anonymous by design, like the PRM: the token is generated by the directory for its own verifier to read, not a secret of this deployment. | **OAuth.** Off unless both of the first two are set, so an instance never advertises an authorization server it does not have. | Variable | Required | Default | Notes | |---|---|---|---| | `OCTEN_OAUTH_AUTHORIZATION_SERVER` | for OAuth | — | Authorization server base URL. Compared byte-for-byte against the token's `iss`, and used to build the JWKS URL — **no trailing slash**; the process refuses to start with one, because it would reject every token. | | `OCTEN_MCP_RESOURCE` | for OAuth | — | This deployment's public URL, e.g. `https://mcp.example.com/mcp`. Compared byte-for-byte against the token's `aud` (RFC 8707), so a stray trailing slash fails every call. Cannot be inferred behind a proxy, hence explicit. | | `OCTEN_OAUTH_RESOLVE_URL` | for OAuth | — | Internal endpoint that exchanges a grant for an API key. Must be reachable privately; a public address will not serve it. | | `OCTEN_OAUTH_RESOLVE_TOKEN` | for OAuth | — | Shared secret sent to that endpoint as `X-Octen-Service-Token`. | | `OCTEN_OAUTH_RESOLVE_CACHE_TTL_MS` | no | `60000` | How long a resolved grant is reused. This is the revocation-propagation window: a token revoked now keeps working for up to this long. `0` resolves on every call, at the cost of putting that service in front of every tool call. | | `OCTEN_JWKS_REFETCH_COOLDOWN_MS` | no | `10000` | Floor between JWKS refetches triggered by an unknown key id. The trigger is an unverified token header, so without a floor each such request becomes one request to the authorization server. Lowering it widens that by the same ratio. | ### Setting these in Claude Desktop (and where the logs go) MCP servers do not inherit your shell environment. Claude Desktop spawns them with `HOME`, `LOGNAME`, `PATH`, `SHELL` and `USER` — and nothing else except what you put in the server's `env` block. **A proxy configured system-wide will not be picked up**; it has to be named explicitly, alongside the API key: ```json { "mcpServers": { "octen": { "command": "npx", "args": ["-y", "octen-mcp"], "env": { "OCTEN_API_KEY": "your-key-here", "HTTPS_PROXY": "http://proxy.example:8080" } } } } ``` Restart Claude Desktop after editing the config — it reads it at launch. Server output lands in: - **macOS**: `~/Library/Logs/Claude/mcp-server-octen.log` - **Windows**: `%APPDATA%\Claude\logs\mcp-server-octen.log` Everything the server writes to stderr, including the tracing below, goes there. ### Diagnosing a slow or failing call Add `"OCTEN_MCP_DEBUG": "1"` to the `env` block above while you are investigating, and **take it out afterwards** — the client appends this to a log file that is never rotated, so leaving it on grows that file for the life of the install. With it on, every call is traced to stderr: ``` [octen-mcp 2026-08-14T04:36:36.219Z] call #1 received tool=search [octen-mcp 2026-08-14T04:36:36.637Z] connect #1 established to api.octen.ai in 410ms peer=203.0.113.10:443 tls=TLSv1.3 alpn=http/1.1 [octen-mcp 2026-08-14T04:36:37.155Z] /search attempt=1 status=200 elapsed=935ms socket=new request_id=42cd56a5-… [octen-mcp 2026-08-14T04:36:37.157Z] call #1 returning tool=search handler_total=938ms ``` Each field answers a specific question: - **`call #N received` timestamp** — when the call reached this process. Subtract it from the time your MCP client issued the tool call: the difference is time spent entirely outside `octen-mcp`, in the host or in whatever relays between them. A client-side stopwatch alone cannot separate that from time we are responsible for. - **`connect … established in Xms`** — a handshake happened, and what it cost. `connect FAILED` names the phase and error code instead. - **`peer=` / `tls=` / `alpn=`** — which address the connection actually reached (the API hostname is anycast, so the hostname alone cannot tell you which edge), and the negotiated TLS version and protocol — a mismatch there otherwise presents as an unexplained slow or failed handshake. - **`socket=new` / `socket=reused`** — whether this call paid for a handshake. This is the difference between "the service is slow" and "the connection was thrown away between calls". - **`elapsed`** vs **`handler_total`** — time in the HTTP request vs time in the tool handler. A large gap means the cost is in request assembly or response formatting, not the network. - **`request_id`** — in *this trace only*: the client-generated correlation id, stable across the retry, tying a call's attempts together. It never appears in user-facing error messages, deliberately: Octen support cannot look it up (the gateway does not record the header), and an id labelled `request_id` reads like one they could. Error messages carry only ids verified searchable on Octen's side — today that is exactly one: the server's own `request_id` from an API error envelope. Failures name the cause rather than `fetch failed`: ``` Network error calling Octen Search: code=ECONNREFUSED cause=connect ECONNREFUSED 203.0.113.9:443 address=203.0.113.9:443 — could not establish a connection. If this machine requires an HTTP proxy, set HTTPS_PROXY. ``` `UND_ERR_CONNECT_TIMEOUT` means the connection was never established, `ECONNRESET` means it was established and then torn down, and `ENOTFOUND` means DNS — three different problems with three different owners. Request timeouts: `search` and the media tools default to 30s, `broad_search` to 120s (raisable to 300s), and `extract` to its per-URL budget plus headroom. The search tools accept a `timeout` parameter to override; `extract`'s `timeout` is the *server-side, per-URL* fetch budget, so the client ceiling is derived from it rather than equal to it. The automatic retry draws down the same deadline as the first attempt, so the stated timeout bounds the whole call, retry included. ## Local development ```bash git clone https://github.com/Octen-Team/octen-mcp.git cd octen-mcp npm install npm run build OCTEN_API_KEY= npm run inspect ``` ## More docs - Best practices for agent integration: [docs/best-practices.md](docs/best-practices.md) - Search API reference: [docs.octen.ai/api-reference/search](https://docs.octen.ai/api-reference/search) - Extract API reference: [docs.octen.ai/api-reference/extract](https://docs.octen.ai/api-reference/extract) ## License [MIT](LICENSE) © Octen