How to Add Free Web Search to VS Code Copilot Agent Mode with MCP (No API Key)
How to Add Free Web Search to VS Code Copilot Agent Mode with MCP (No API Key) GitHub Copilot's agent in VS Code can edit files and run terminal commands, but it can't look things up on the live web unless you give it a tool for that. This guide adds VS Code MCP web search with one MCP server entry

Posted on Nov 3 • Originally published at agentsearchhq.com
GitHub Copilot's agent in VS Code can edit files and run terminal commands, but it can't look things up on the live web unless you give it a tool for that. This guide adds VS Code MCP web search with one MCP server entry, with no API key and no signup. Here's the whole setup. Save it as.mcp.json in the root of your workspace:
{ "mcpServers": { "agentsearch": { "command": "npx", "args": [ "-y", "@agentsearchhq/agentsearch-mcp" ] } } } Enter fullscreen mode Exit fullscreen mode Prefer VS Code's own format? The same server in.vscode/mcp.json uses servers instead of mcpServers:
{ "servers": { "agentsearch": { "type": "stdio", "command": "npx", "args": [ "-y", "@agentsearchhq/agentsearch-mcp" ] } } } Enter fullscreen mode Exit fullscreen mode Either entry runs AgentSearch, the @agentsearchhq/agentsearch-mcp package on npm (also listed in the official MCP Registry as io.github.agentsearchhq-coder/agentsearch-mcp ). It gives Copilot a free agentsearch_web_search tool:
Free tier: up to 25 searches/day per IP, no key needed (shared daily capacity; paid calls have no cap).
What we tested: with @agentsearchhq/agentsearch-mcp 1.3.6 (npm latest) on Linux and Node.js 24, the official MCP TypeScript SDK client read both files above, started the server through npx, listed its five tools, and ran a real free search. We also ran code --add-mcp in VS Code 1.144.1 and checked the file it wrote. We didn't sign in to Copilot, so we didn't watch the agent call the tools in a chat. Menu names come from the VS Code docs.
Using a different editor? See Cursor, Claude Code, or the Cline extension for VS Code.
VS Code reads MCP servers from two file formats that aren't interchangeable:
Use.mcp.json to share the server with a project, ~/.copilot/mcp-config.json to have it everywhere, or.vscode/mcp.json if your team already keeps servers there. Don't paste an mcpServers block into a servers file, or the reverse.
From the Command Palette. Run MCP: Add Server, choose Command (stdio), and enter:
npx -y @agentsearchhq/agentsearch-mcp Enter fullscreen mode Exit fullscreen mode Give it the server ID agentsearch. For a personal setup, pick Global, then Copilot Global, which writes the portable entry to ~/.copilot/mcp-config.json.
From a terminal. The code CLI adds a server to your VS Code user profile in one line:
code --add-mcp '{"name":"agentsearch","type":"stdio","command":"npx","args":["-y","@agentsearchhq/agentsearch-mcp"]}' Enter fullscreen mode Exit fullscreen mode In our test it printed Added MCP servers: agentsearch and wrote a servers entry to User/mcp.json in the VS Code data folder ( ~/.config/Code/User/mcp.json by default on Linux). MCP: Open User Configuration opens it on any OS.
By hand. Paste the matching snippet from the top of this post and save. The -y skips npx's install prompt, and free search needs no env block. If the file already has servers, add agentsearch next to them and mind the commas. Then check the JSON:
python3 -m json.tool.vscode/mcp.json Enter fullscreen mode Exit fullscreen mode With a trailing comma, it printed Illegal trailing comma before end of object: line 6 column 55.
Workspace files (.vscode/mcp.json and.mcp.json ) follow Workspace Trust: in Restricted Mode the server won't start. Servers from your user configuration may ask for trust on first start.
Run MCP: List Servers, select agentsearch, and pick Start Server or Show Output (or use Chat: Open Customizations > MCP Servers ). A healthy start logs agentsearch-mcp listening on stdio.
Search, extract, render, and review lookup are marked read-only. To limit what the agent can pick, use Chat: Open Customizations > Tools for Copilot harness sessions, or Configure Tools in the chat input for Local sessions.
Here's a trimmed result from the real search we ran through the.vscode/mcp.json entry with max_results: 2:
{ "query": "vs code mcp.json servers configuration", "result_count": 2, "results": [ { "title": "Add MCP servers in VS Code", "url": "https://code.visualstudio.com/docs/agent-customization/mcp-servers", "content": "Open the Command Palette (Ctrl+Shift+P) and run MCP: Add Server. · Choose the option that matches what the publisher provides: · Enter a server ID, such as...", "domain": "code.visualstudio.com" }, { "title": "MCP configuration reference", "url": "https://code.visualstudio.com/docs/agents/reference/mcp-configuration", "content": "This article provides the MCP configuration formats, supported fields, commands, and settings in VS Code. To connect your first server, see Add MCP servers.", "domain": "code.visualstudio.com" } ] } Enter fullscreen mode Exit fullscreen mode Results are passages, not whole pages. That's what Extract and Render are for.
Select Agent in the chat's agent picker. The VS Code docs say to name the server in your prompt when you're checking a new one, so start like this:
Use the agentsearch MCP server to search the web for the latest Node.js LTS release and list what changed, with links. Don't change any files. Enter fullscreen mode Exit fullscreen mode If an approval prompt appears, check the query and select Allow. Then expand the tool call to confirm the answer came from its output.
Search also helps mid-task, when the agent hits something newer than its training data:
The build fails with this bundler error. Search the web for it and suggest a fix that matches the version in package.json. Enter fullscreen mode Exit fullscreen mode When a passage isn't enough, ask for the full page:
Extract the first link as markdown and summarize the migration steps. Enter fullscreen mode Exit fullscreen mode That's Extract. If the page is a single-page app and Extract comes back thin, ask for Render:
The server pays through the Pocket Network Agentic Portal with USDC on Base, using the key of a new, dedicated wallet that holds only a small amount of USDC. Don't write the key into a file you commit. In the portable format, reference an environment variable instead:
{ "mcpServers": { "agentsearch": { "command": "npx", "args": [ "-y", "@agentsearchhq/agentsearch-mcp" ], "env": { "AGENTSEARCH_WALLET_PRIVATE_KEY": "${AGENTSEARCH_WALLET_PRIVATE_KEY}", "AGENTSEARCH_MAX_TOTAL_ATOMIC": "50000" } } } } Enter fullscreen mode Exit fullscreen mode Per the VS Code docs, set that variable in the environment of the host that runs the server, and use the braced ${NAME} form. In.vscode/mcp.json, you can instead use a promptString input with "password": true, referenced as ${input:...}. VS Code prompts once and stores the value, but servers that need inputs aren't forwarded to Copilot harness sessions, so that only works in Local sessions. Restart the server after any change.
Search stays free by default, even with a wallet key. In 1.3.6, the key only turns on paid Extract and Render. agentsearch_web_search stays on the free tier unless you also set AGENTSEARCH_MODE to paid (or auto ).
Spend caps. The server checks these before it signs anything:
With the cap at 0 and an unfunded test key, Extract returned Session spend cap reached... Nothing was signed.
Run the server by itself. Run npx -y @agentsearchhq/agentsearch-mcp in a terminal. It should print the listening on stdio line and wait. If it fails there, VS Code can't start it either.
Read the output. MCP: List Servers > agentsearch > Show Output shows the exact error.
The server doesn't appear. Check that the top-level key matches the file ( mcpServers for.mcp.json and ~/.copilot/mcp-config.json, servers for mcp.json ), that the workspace is trusted, and that the server doesn't rely on ${input:...} variables in a Copilot session. Organization policy can also block servers.
npx not found. Install Node.js 20+. With a version manager, VS Code may not inherit your shell's PATH, so put the output of which npx in command. In a remote window or dev container, Node has to be installed where the server runs.
The agent doesn't call the tool. Name the server in the prompt, as in Step 4, and check it's enabled in Tools.
For retry and fallback patterns, see error handling for AI agent web tools.
More clients are on the AgentSearch MCP page, and MCP web search for AI agents covers the bigger picture.
No. The entries at the top have no key, no account, and no env block. Free tier: up to 25 searches/day per IP, no key needed (shared daily capacity; paid calls have no cap).
The current VS Code docs point new setups to the portable files: workspace-root.mcp.json for a team, ~/.copilot/mcp-config.json for yourself..vscode/mcp.json still works and VS Code forwards it to Copilot sessions. Use it if you need input variables, envFile, or sandboxing.
Copilot CLI reads ~/.copilot/mcp-config.json, the same file Copilot Global writes, so one entry covers both. We didn't test the CLI.
Not by default. In 1.3.6, only AGENTSEARCH_MODE=paid (or auto ) makes search a paid call at $0.005. Extract and Render are the calls that use the wallet.
Up to 5 per call. The agent can ask for fewer with max_results (1 to 5).
Yes. The chat.mcp.discovery.enabled setting lets VS Code read MCP configs from Claude Desktop, Cursor, Windsurf, and GitHub Copilot CLI. Copilot CLI discovery is on by default; the others are off until you turn them on.
Treat web content as untrusted input: a page can contain text written to steer an AI. Keep approvals on for tools that edit files or run commands.
Add the agentsearch entry to.mcp.json or.vscode/mcp.json, trust the workspace, check MCP: List Servers for the five tools, and ask Copilot's agent about something that changed this week. When you need full pages, add a capped wallet for Extract and Render. See pricing and the MCP setup page, or browse more guides on the AgentSearch blog.
Originally published on the AgentSearch blog.