> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keenable.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Every page is listed in https://docs.keenable.ai/llms.txt. To pick a product for a job, read https://docs.keenable.ai/choose.md
> Setup steps for agents, covering the SDKs, the MCP server and the CLI: https://docs.keenable.ai/skill.md
> Keenable search and fetch work without an API key. To add them to code, use the official SDK for the project's language: https://docs.keenable.ai/sdks.md
> Without a key, call POST https://api.keenable.ai/v1/search/public or GET https://api.keenable.ai/v1/fetch/public with an X-Keenable-Title header that names your app.
> With a key, send it in the X-API-Key header and read it from the KEENABLE_API_KEY environment variable. Never ask a user to paste a key into chat. Every access method: https://docs.keenable.ai/auth.md
> To get an API key without the console, use device login: https://docs.keenable.ai/authentication.md#device-login
> MCP server: https://api.keenable.ai/mcp (no key, or X-API-Key; keyless Codex uses https://api.keenable.ai/mcp-public), or https://api.keenable.ai/mcp-oauth for OAuth sign-in. These docs are an MCP server at https://docs.keenable.ai/mcp and the OpenAPI spec is at https://docs.keenable.ai/api-reference/openapi.json
> Keenable searches and fetches public web pages. If a question needs no web information, skip the call.
> On 402 with an API key (code insufficient_credits), stop and ask a human to add credits; don't retry. On 429, wait the number of seconds in Retry-After, then retry. Before you ship, follow https://docs.keenable.ai/production.md
> Every error, with its cause and fix, is in https://docs.keenable.ai/errors.md and moving from another search API is covered in https://docs.keenable.ai/migrate.md
> Before you compare Keenable with another search API, read https://docs.keenable.ai/guides/evaluate-search-apis.md

# Make Keenable your agent's default web tool

> Turn off WebSearch and WebFetch in Claude Code, Codex, Cursor and OpenCode so your agent always searches with Keenable. Routing rule, check and undo.

Make Keenable the only web search your agent has, and in most clients the only page fetch too, so every lookup goes through the Keenable MCP server. Claude Code, Codex, Cursor and OpenCode each ship their own web tools. If both sets are on, the agent picks between them from one call to the next.

Set this up after you add the [MCP server](https://docs.keenable.ai/mcp-server.md) to your client. Then turn off the client's own tools, and add a routing rule that names the Keenable tools.

## What changes in each client

The [Keenable CLI](https://docs.keenable.ai/cli.md) turns off the built-in tools in Claude Code and OpenCode for you. In Codex and Cursor, you change one setting yourself.

| Client | Built-in tools | How to turn them off | Done by `keenable configure-mcp` |
| - | - | - | - |
| Claude Code | `WebSearch`, `WebFetch` | Add both to `permissions.deny` in `~/.claude/settings.json` | Yes |
| OpenCode | `websearch` | Set `permission.websearch` to `"deny"` in `~/.config/opencode/opencode.json`. OpenCode's own `webfetch` stays on. | Yes |
| Codex | Web search | Set the top-level key `web_search = "disabled"` in `~/.codex/config.toml` | No. It adds the MCP entry only. |
| Cursor | Web Search, Web Fetch | Turn both off in Cursor's settings | No. It prints a reminder to turn them off. |

## Turn off the built-in tools with the CLI

This command adds Keenable to Claude Code and OpenCode and turns off their built-in web tools. `--yes` skips the confirmation prompt:

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
keenable configure-mcp --claude-code --opencode --yes
```

For Claude Code, the CLI adds `WebSearch` and `WebFetch` to `permissions.deny` in `~/.claude/settings.json`. It also removes them from the allow lists in the `.claude/settings.local.json` files it finds in `~/dev`, `~/projects`, `~/src`, `~/repos`, `~/work` and `~/code`, up to three folders deep, and in your home directory. For OpenCode, it sets `permission.websearch` to `"deny"`.

To include every client the CLI detects, use `--all` instead of the client flags. See [MCP setup in the CLI](https://docs.keenable.ai/cli.md#mcp-setup) for the file each client flag edits.

## Turn off the built-in tools by hand

Pick your client:

> [tab] Claude Code
>
> Add both tools to the `deny` list in `~/.claude/settings.json`. If the file already has a `permissions` block, add the two names to its `deny` list instead of adding a second block:
>
> ```json ~/.claude/settings.json theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
> {
>   "permissions": {
>     "deny": ["WebSearch", "WebFetch"]
>   }
> }
> ```
>
> To turn them off for one session without editing the file, start Claude Code like this:
>
> ```bash theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
> claude --disallowedTools WebSearch WebFetch
> ```
>
> See [Claude](https://docs.keenable.ai/integrations/claude.md#turn-off-the-built-in-search) for more on the Claude apps.

> [tab] Codex
>
> Add `web_search = "disabled"` to `~/.codex/config.toml`, above the `[mcp_servers.keenable]` line. It's a top-level key. Below a table header, it belongs to that table and Codex ignores it:
>
> ```toml ~/.codex/config.toml theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
> web_search = "disabled"
>
> [mcp_servers.keenable]
> url = "https://api.keenable.ai/mcp"
> http_headers = { "X-API-Key" = "keen_<your_key>" }
> ```
>
> See [Codex](https://docs.keenable.ai/integrations/codex.md#turn-off-the-built-in-search) for the other modes and a per-profile setup.

> [tab] Cursor
>
> Open **Cursor Settings → Agents → Context and Tools** and turn off Web Search and Web Fetch. The labels can move between Cursor releases. The toggles also apply to subagents.
>
> See [Cursor](https://docs.keenable.ai/integrations/cursor.md#turn-off-the-built-in-search) for how to check the setting in a chat.

> [tab] OpenCode
>
> Set `permission.websearch` to `"deny"` in `~/.config/opencode/opencode.json`, next to your Keenable `mcp` entry:
>
> ```json ~/.config/opencode/opencode.json theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
> {
>   "permission": {
>     "websearch": "deny"
>   }
> }
> ```

## Add a routing rule

A routing rule names the Keenable tools in your agent's instructions. It helps when an agent loads tool details only once it decides a tool is relevant, as Codex does, and when you keep the built-in tools on. Put the rule in `CLAUDE.md` for Claude Code, or in `AGENTS.md` for Codex and Cursor, at the root of your repository:

```markdown AGENTS.md theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
## Web search

- Use `search_web_pages` for anything that needs the web.
- Follow a search with `fetch_page_content` to read the sources you cite.
- Don't use the built-in web search or web fetch tools.
```

If you use the [OpenCode plugin](https://docs.keenable.ai/integrations/opencode.md) instead of the MCP server, its tools are `keenable_search` and `keenable_fetch`. Name those in the rule.

## Check the setup

Run `keenable configure-mcp` with no flags. It lists each detected client and flags any problem, such as `Standard tools (WebSearch, WebFetch) not disabled`:

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
keenable configure-mcp
```

In Claude Code, this command prints the deny list from your settings:

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
jq '.permissions.deny' ~/.claude/settings.json
```

You see `"WebSearch"` and `"WebFetch"` in the list. Then start a new chat and ask a question that needs the web. The agent calls `search_web_pages` without being told to.

## Undo the change

`keenable reset` removes the Keenable MCP entry and turns the built-in tools back on. In Claude Code, it removes only the deny entries that `configure-mcp` added, so entries you wrote yourself stay. If an older CLI made the change, reset can't tell which entries it added and removes both `WebSearch` and `WebFetch`:

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"dark-plus"}}
keenable reset --claude-code --opencode --yes
```

To turn the built-in tools back on and keep Keenable, undo the setting by hand instead:

| Client | Undo |
| - | - |
| Claude Code | Delete `WebSearch` and `WebFetch` from `permissions.deny` in `~/.claude/settings.json` |
| OpenCode | Delete `websearch` from `permission` in `~/.config/opencode/opencode.json` |
| Codex | Delete the `web_search = "disabled"` line from `~/.codex/config.toml` |
| Cursor | Turn Web Search and Web Fetch back on in Cursor's settings |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.