Skip to content
AgentSearch

How to Add Web Search to Kilo Code with MCP

Kilo Code is an open-source AI coding agent for VS Code that also ships as a terminal app, the Kilo CLI. It can read your repo, edit files and run commands, but it can't always look things up on the live web: a library release from last week, a changelog, a fresh answer to the error you're staring at. Kilo is an MCP client, so any Model Context Protocol server can add tools to it. This guide adds Kilo Code web search with the AgentSearch MCP server, in one config entry.

Search works right away with no API key, no signup and no wallet: 25 free searches per IP in total, then pay per call. The 25 is a lifetime allowance, not a daily one, and it never resets.

What we actually ran (November 27, 2026): the Kilo CLI 7.8.40 (@kilocode/cli, the latest on npm) on Linux with Node.js 24, in a throwaway directory with its own home and config folders, plus @agentsearchhq/agentsearch-mcp 1.8.7. We added the server three ways (project config, global config and kilo mcp add), and kilo mcp list showed it connected each time. Then we ran kilo run against a local stand-in model that only asks for a tool call. Kilo offered the model all eight AgentSearch tools, ran one real free search through the server and passed the results back. We didn't test the VS Code extension's settings screens, a real model, or Windows. Where this post describes those, it says so and links Kilo's docs.

What the agent gets (and what it costs)

Kilo names MCP tools {server}_{tool}. With the server named agentsearch, these are the eight tools Kilo sent to the model in our run:

agentsearch_agentsearch_extract          agentsearch_agentsearch_news_search
agentsearch_agentsearch_render           agentsearch_agentsearch_review_lookup
agentsearch_agentsearch_review_submit    agentsearch_agentsearch_screenshot
agentsearch_agentsearch_search_and_read  agentsearch_agentsearch_web_search

For coding research, these three matter most:

Tool What it does Cost
agentsearch_web_search Live web search, up to 5 results with title, URL and a text snippet 25 free searches per IP in total (never resets), then $0.003 per call
agentsearch_extract Any public URL as clean markdown Free trial: 5 a day per IP, then $0.002 per call
agentsearch_search_and_read Search plus the page text of the top hits, in one call 10 free calls per IP in total, then $0.005 per call

There's no account and no API key at any tier, and no minimum spend. Paid calls use x402: the API answers with a 402 and a price, the MCP server signs a small USDC payment on Base, and you're only charged when a usable answer comes back. The other tools cover news ($0.003 per call), JavaScript-heavy pages (Web Render), screenshots and a free board of agent-written reviews of web tools.

Doesn't Kilo already search the web? Sometimes. Kilo has a built-in web search tool, but in 7.8.40 it's only turned on when you use Kilo's own model gateway (or set a feature flag). With your own provider key, it isn't offered to the model. In our test with a non-Kilo provider, Kilo's tool list had no built-in web search, only the AgentSearch tools. We found the rule in Kilo's source (webSearchEnabled in packages/opencode/src/tool/registry.ts). AgentSearch works the same with any provider and adds page reading, news and screenshots.

Before you start

  • Kilo Code: the VS Code extension or the CLI (npm install -g @kilocode/cli, then kilo --version). According to Kilo's MCP docs, both read MCP servers from the same config files.
  • Node.js with npx on your PATH, because the server runs with npx.
  • A model that supports tool calling. Search itself needs no extra key.

Step 1: Add the server to kilo.jsonc

Kilo keeps MCP servers in its main config file, under a top-level mcp key. There are two levels (Kilo docs):

  • Global: ~/.config/kilo/kilo.jsonc, for every project.
  • Project: .kilo/kilo.jsonc in your project root (or kilo.jsonc at the root). Project settings take precedence.

Add this entry:

{
  "$schema": "https://app.kilo.ai/config.json",
  "mcp": {
    "agentsearch": {
      "type": "local",
      "command": ["npx", "-y", "@agentsearchhq/agentsearch-mcp"],
      "enabled": true,
      "timeout": 60000
    }
  }
}

The details matter: "type": "local" for a stdio server, the command and its arguments in one array, enabled (not disabled), and timeout in milliseconds. With exactly this file as .kilo/kilo.jsonc, kilo mcp list printed:

✓ agentsearch connected
    npx -y @agentsearchhq/agentsearch-mcp

Or let the CLI write it. This one command adds the same server to your global config:

kilo mcp add agentsearch -- npx -y @agentsearchhq/agentsearch-mcp

In our test it printed MCP server "agentsearch" added to ~/.config/kilo/kilo.jsonc (the full path), kept the comments already in that file, and the server showed as connected. Run without arguments, kilo mcp add asks questions instead, including whether to save to the project or global config. It doesn't add a timeout, so Kilo's default of 10 seconds applies. Our first run, with an empty npm cache, connected in about 7 seconds, which is close to that limit on a slower connection. Add "timeout": 60000 if the first start fails.

In the VS Code extension, the docs describe an MCP Servers screen under Settings → Agent Behaviour → MCP Servers that writes to the same files. We didn't test the extension UI. Editing the file works either way. In the CLI's terminal UI, the docs list a /mcps command to turn servers on and off. Restart the CLI after editing the config.

Windows. Kilo's docs say to run npx through cmd: "command": ["cmd", "/c", "npx", "-y", "@agentsearchhq/agentsearch-mcp"]. We didn't test Windows.

Step 2: Allow the search tool

MCP tools use Kilo's normal permission system. Per the docs, the first call shows an approval prompt, and Approve Always saves an allow rule to your config. You can also add the rule yourself. The key is {server}_{tool}, and wildcards work:

"permission": {
  "agentsearch_agentsearch_web_search": "allow"
}

We ran our test with this rule in the project config. "agentsearch_*": "allow" allows all eight tools, including the paid ones once you add a wallet, so think before you use the wildcard.

Step 3: Try it

Ask something the agent can't know from your code:

Search the web for the latest release notes of the HTTP library this project uses,
read the release page, and tell me if anything affects our code. Cite the URLs.

The agent sees each tool's own arguments: query, max_results (1 to 5), freshness, include_domains and more for search, and url and max_chars for extract. A good pattern is to search first and then read only the page you need.

Here's what our one real free search through Kilo returned for Kilo Code MCP server config kilo.jsonc with max_results: 3 (trimmed):

{
  "query": "Kilo Code MCP server config kilo.jsonc",
  "result_count": 3,
  "results": [
    {
      "title": "Cli: where can I find update documentation about modes, agents, subagents/workflows? : r/kilocode",
      "domain": "reddit.com"
    },
    {
      "title": "kilocode/packages/kilo-docs/pages/automate/extending/plugins.md at main",
      "domain": "github.com"
    },
    {
      "title": "fix(cli): kilo.json should take priority over opencode.json in config loading · Issue #7621 · Kilo-Org/kilocode",
      "domain": "github.com"
    }
  ]
}

Each result also has its URL, a text snippet and a trust score. Results are snippets, not whole pages. For full pages, use Extract or Search + Read.

Going past the free tier: pay per call with x402

When the 25 free searches are used up, add a wallet. Use a new, dedicated wallet holding a few dollars of USDC on Base, never your main one. The MCP server reads these environment variables:

Variable What it does
AGENTSEARCH_WALLET_PRIVATE_KEY Key of the dedicated wallet. Turns on the paid tools.
AGENTSEARCH_MODE=paid Also makes search paid ($0.003 per call). A wallet key alone keeps search on the free tier.
AGENTSEARCH_MAX_TOTAL_ATOMIC Spend cap per server session in USDC atomic units (default 1000000, which is $1.00).
AGENTSEARCH_MAX_PER_CALL_ATOMIC Optional lower cap per call.

In Kilo they go under environment. Let Kilo read the key from your shell with {env:...}, so it never sits in the file:

{
  "$schema": "https://app.kilo.ai/config.json",
  "mcp": {
    "agentsearch": {
      "type": "local",
      "command": ["npx", "-y", "@agentsearchhq/agentsearch-mcp"],
      "environment": {
        // read from your shell, so the key never sits in this file
        "AGENTSEARCH_WALLET_PRIVATE_KEY": "{env:AGENTSEARCH_WALLET_PRIVATE_KEY}",
        "AGENTSEARCH_MODE": "paid",
        "AGENTSEARCH_MAX_TOTAL_ATOMIC": "200000"
      },
      "enabled": true,
      "timeout": 60000
    }
  }
}

Put this in your global config (~/.config/kilo/kilo.jsonc), not in the project. Kilo 7.8.40 treats project config as untrusted and refuses {env:...} there. It doesn't just drop that one value. It skips the whole project file, so kilo mcp list said "No MCP servers configured", and the reason (ConfigInvalidError skipped config due to error) only showed up with --print-logs. In the global file, with a dummy key exported in the shell, kilo debug config showed the value filled in from the environment and the server connected. We didn't make a paid call for this post.

Live prices on November 27, 2026, from AgentSearch's own x402 API at api.agentsearchhq.com: search $0.003, news $0.003, extract $0.002, search-and-read $0.005, paid in USDC on Base. No signup, no API key, no minimums. New to per-call payments? Read x402 pay-per-call APIs for AI agents.

Gotchas we hit

Old configs vs. new configs. Kilo's 7.x releases moved MCP servers into kilo.jsonc. Older guides show the previous format (mcpServers, with command and args separate, env, disabled, alwaysAllow), stored in mcp_settings.json or a project .kilocode/mcp.json. The CLI still converts a project .kilocode/mcp.json when it loads: our old-format test file showed up in kilo mcp list as connected. That's a migration path, though, and new setups should use the mcp key. Kilo's migration notes say the CLI on its own only reads the project files, and the old global mcp_settings.json is only read when Kilo runs inside VS Code (or as Kilo's background daemon).

{env:...} in a project config silently drops the whole file. See the paid section above. Keep secrets in the global config.

The 10 second default timeout. It's in the docs and applies when you leave timeout out, which kilo mcp add does. The first npx start downloads the package, so give it 60000.

The tool names are doubled. The permission key and the name the model sees are agentsearch_agentsearch_web_search: the server name, an underscore, then the tool's own name. If you name the server search, it becomes search_agentsearch_web_search.

Troubleshooting

Run the server by itself. Run npx -y @agentsearchhq/agentsearch-mcp in a terminal. A healthy server prints a line starting agentsearch-mcp listening on stdio to stderr and waits (Ctrl+C to stop). On npx: command not found or an engine error, install Node.js.

kilo mcp list says "No MCP servers configured". Kilo didn't load your file. Check the path (.kilo/kilo.jsonc in the project, or ~/.config/kilo/kilo.jsonc), then run kilo mcp list --print-logs and look for skipped config due to error. A project file with {env:...} in it causes this.

The server shows as failed. Raise timeout to 60000, make sure command is one array (["npx", "-y", "@agentsearchhq/agentsearch-mcp"], not a string) and that npx runs in the same environment as Kilo.

The agent doesn't use the tools. Check that the model supports tool calling, that the server is enabled, and that a permission rule doesn't deny agentsearch_*.

HTTP 429 from search or extract. You've used the free allowance: the 25 lifetime searches for your IP, the 10 lifetime search-and-read calls, or the daily extract trial (5). Add a wallet as shown above to keep going.

Wallet set but search still free. That's expected. Search only switches to paid with AGENTSEARCH_MODE=paid.

FAQ

Does Kilo Code web search need an API key?

Not with this setup. The AgentSearch MCP server gives you 25 free searches per IP in total with no key, account or wallet, then you pay per call over x402. You still need whatever key your model provider uses.

Where does Kilo Code store MCP servers?

In kilo.jsonc, under the top-level mcp key: ~/.config/kilo/kilo.jsonc for all projects, or .kilo/kilo.jsonc (or kilo.jsonc) in a project. The CLI and the VS Code extension use the same files. The older mcp_settings.json format is from before Kilo 7.

Does the Kilo CLI support MCP servers?

Yes. kilo mcp add adds a server, kilo mcp list shows whether it connected, and kilo run can call MCP tools. We tested all three with the AgentSearch server on Kilo CLI 7.8.40.

Can the agent spend money on its own?

Not without a wallet. With no wallet key, search uses the free tier and the other tools use their free allowances, and once those run out the calls fail instead of charging anything. With a wallet, the server never spends more than AGENTSEARCH_MAX_TOTAL_ATOMIC per session (default $1.00), and search stays free unless you also set AGENTSEARCH_MODE=paid.

Is it safe to let the agent read web pages?

Treat web content as untrusted input, because a page can contain text written to steer an AI. Keep tool approval on for anything that edits files or runs commands, and review what the agent does with what it read.

Next steps

Add one entry to kilo.jsonc, check it with kilo mcp list, and ask the agent about something that changed last week. You get 25 free searches per IP in total with no key, then $0.003 per paid search.

More from the blog

Service pages: Web Search API · Web Extract API · Search + Read API · Web Render API