# Give your AI agent web search and page reading

> Connect Claude Code, Codex, Cursor, VS Code, and other MCP clients to PacketStream's remote MCP server for Google search and web page reading with your API key.

**Early beta.** Fields, limits, and availability may change during the beta. These pages describe what the API serves today. Questions or problems? [Contact support](https://packetstream.io/contact-us/).

PacketStream runs a remote [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server with two tools for AI agents: `packetstream_search` runs a Google search, and `packetstream_fetch` reads a web page as Markdown. Tool calls use your PacketStream API key, the same key as the [Search API](https://packetstream.io/docs/search-api/) and the [Fetch API](https://packetstream.io/docs/fetch-api/).

## Before you begin

You need:

- a [PacketStream account](https://app.packetstream.io/signup?account=buy&next=mcp) with funds in its balance. Tool calls draw from the same prepaid balance as proxy traffic;
- an API key. Create one on the [MCP page of the dashboard](https://app.packetstream.io/dashboard/mcp). The key is shown once, so copy it when it appears.

## Server URL

```text
https://api.packetstream.io/v1/mcp
```

Choose your client's Streamable HTTP transport. The server is stateless: each POST gets one JSON response, with no event stream and no session.

## Authentication

Send your key in an `Authorization: Bearer YOUR_API_KEY` header. There is no OAuth and no browser sign-in, so your client must let you set a custom header.

Your client can connect and list the tools without a key. The server checks the key when your agent calls a tool. A call without a valid key is not billed. It returns an [error result](https://packetstream.io/docs/mcp/reference/#key-errors) that tells the agent what is wrong and how to fix it:

- `missing_api_key`: the request has no key.
- `invalid_api_key`: the header does not hold a PacketStream key. Often the variable meant to hold the key is not set where the client starts, or the configuration still has the `YOUR_API_KEY` placeholder.
- `unauthorized`: the key was revoked or replaced, or it was copied wrongly.

So a client that shows the server as connected has not checked your key. [Check your key](https://packetstream.io/docs/mcp/#check-your-key) on its own.

## No account or key yet?

1. [Sign up](https://app.packetstream.io/signup?account=buy&next=mcp) and add funds to your balance.
2. Create an API key on the [MCP page of the dashboard](https://app.packetstream.io/dashboard/mcp). It is shown once, so copy it when it appears.
3. Put the key in your client's configuration, as shown under [Connect a client](https://packetstream.io/docs/mcp/#connect-a-client), and restart the client.

If you already have an account but not the key, [log in](https://app.packetstream.io/login?next=mcp) and create a new key on the MCP page. The new key replaces the old one, which stops working at once.

## Tools

| Tool | What it does | Arguments | Billed as |
| --- | --- | --- | --- |
| `packetstream_search` | Runs one Google search and returns the results as Markdown text, with the JSON response as `structuredContent`. | The [Search API parameters](https://packetstream.io/docs/search-api/parameters/) without `format`. Only `query` is required. | One search, $0.0025 |
| `packetstream_fetch` | Reads one public page as Markdown, with the same URL rules, limits, and errors as `POST /v1/fetch`. | `url` (required), `content`, `include_links`, `max_length`, `start_index`, and `user_agent`. [Some defaults differ from REST](https://packetstream.io/docs/mcp/reference/#packetstream_fetch-arguments). | One fetch, $0.0025 |

The [reference](https://packetstream.io/docs/mcp/reference/) lists every argument and the result formats.

## Connect a client

In Claude Code, run this in a terminal and add the `export` line to your shell profile:

```bash
export PACKETSTREAM_API_KEY="YOUR_API_KEY"
claude mcp add --transport http --scope user packetstream https://api.packetstream.io/v1/mcp \
  --header 'Authorization: Bearer ${PACKETSTREAM_API_KEY}'
claude mcp list
```

[Client setup](https://packetstream.io/docs/mcp/clients/) covers [Codex CLI](https://packetstream.io/docs/mcp/clients/#codex-cli), [Cursor](https://packetstream.io/docs/mcp/clients/#cursor), [VS Code](https://packetstream.io/docs/mcp/clients/#vs-code), [Claude Desktop](https://packetstream.io/docs/mcp/clients/#claude-desktop), and [other clients](https://packetstream.io/docs/mcp/clients/#other-clients).

## Check your key

Listing the tools works without a key, so it does not check the key. This call does. It returns your balance, is free, and does not use a rate-limit token. It reads the key from `PACKETSTREAM_API_KEY`, set as shown above.

```bash
curl -sS https://api.packetstream.io/v1/account \
  -H "Authorization: Bearer $PACKETSTREAM_API_KEY"
```

A working key returns your [balance and usage](https://packetstream.io/docs/search-api/responses/#account) as JSON. A missing or wrong key returns HTTP 401 with the code `unauthorized`.

## Billing

- Each successful `packetstream_search` call is billed as one search, and each successful `packetstream_fetch` call as one fetch: $0.0025 each, from your prepaid balance.
- Failed calls are free, apart from the rare `internal_error` case described under [billing](https://packetstream.io/docs/search-api/errors-limits/#billing). A call without a valid key is never billed.
- `initialize`, `ping`, `server/discover`, and `tools/list` are always free and need no key.
- The server asks agents to use these tools for every web search and page fetch, in place of their built-in web tools, so an agent can call them many times in one task. Review your client's tool-approval settings to control spend.
- Tool calls share your key's limit of 5 requests per second, with bursts of 10, with the REST API.

## Good to know

- `packetstream_fetch` puts page text between `<<<PAGE CONTENT: untrusted>>>` and `<<<END PAGE CONTENT>>>`. Agents should treat it as data, never as instructions.
- `packetstream_fetch` does not read robots.txt. You decide which sites your agent reads, and you need any permission that the law, a contract, or the site operator requires, as set out in [section 7 of our Terms of Service](https://packetstream.io/terms-of-service/#acceptable-use).
- `packetstream_fetch` returns at most 40,000 characters by default and leaves out link URLs unless the agent sets `include_links`. It always uses a US exit.
- Keep the key in an environment variable or your client's own settings, never in a file you commit or share.

Related pages:

- [Client setup](https://packetstream.io/docs/mcp/clients/): Claude Code, Codex CLI, Cursor, VS Code, Claude Desktop, and other clients.
- [Reference](https://packetstream.io/docs/mcp/reference/): Tool arguments, result formats, errors, protocol revisions, and the Origin rule.
- [Search API](https://packetstream.io/docs/search-api/): The REST API behind `packetstream_search`.
- [Fetch API](https://packetstream.io/docs/fetch-api/): The REST API behind `packetstream_fetch`.
