> SpecStream is the live web data engine for teams and agents. This is the Markdown copy of https://specstream.ai/docs/integrations/phi. Every page, with what SpecStream does and costs: https://specstream.ai/llms.txt

# phi

phi has no web search of its own: its README says external HTTP fetch comes through MCP. Add SpecStream to `~/.phi/mcp.json` as an `http` server, and phi can search the live web, read whole pages, and build lists from a request in plain words.

[SpecStream for phiCoding agents](https://specstream.ai/integrations/phi.md)

## What you need

-   phi with MCP on (it is on unless `PHI_MCP=off`).
-   A SpecStream account and an API key. New accounts get $10 of credit, no card.

1.  1

    ## 1. Create a SpecStream API key

    phi's `http` transport sends the headers you write in `mcp.json` and has no OAuth sign-in, so it connects with a key. In the workspace, open **Agents & API**, choose **API keys**, then **Create API key**, and set a total spending limit.

2.  2

    ## 2. Add SpecStream to ~/.phi/mcp.json

    `phi mcp add` writes stdio servers only, so add the entry by hand. Open `~/.phi/mcp.json`, or create it, and add `specstream` under `servers`, with your key in place of `YOUR_SPECSTREAM_API_KEY`. Keep any servers you already have in the same `servers` object.

    phi does not expand environment variables in `headers`, so the key is written in the file. Keep it in the user file, not in a project's `.phi/mcp.json` that git may pick up, and run `chmod 600 ~/.phi/mcp.json`.

    ~/.phi/mcp.json

    ```json
    {
      "servers": {
        "specstream": {
          "transport": "http",
          "url": "https://api.specstream.ai/mcp",
          "headers": { "Authorization": "Bearer YOUR_SPECSTREAM_API_KEY" }
        }
      }
    }
    ```

3.  3

    ## 3. Restart phi and check the server

    phi loads `mcp.json` when it starts. Quit phi, then check the entry from the shell. `phi mcp list` shows `specstream` with its address, and `phi mcp doctor` checks the config and the connection. Neither runs a search.

    Terminal

    ```bash
    phi mcp list
    phi mcp doctor
    ```

4.  4

    ## 4. Ask phi

    Start `phi` and ask for something current, naming SpecStream. phi sees the server's name in its prompt, lists its tools with `ls mcp://specstream/tools/`, reads one with `read`, and calls it with `write`:

    In phi

    ```text
    Use specstream to find the current stable release of Go and read its release notes.
    ```

## What phi gets

SpecStream's server at `https://api.specstream.ai/mcp` adds these tools under `mcp://specstream/tools/`. phi keeps their schemas out of the model's context until it reads one.

-   `search_web` answers a question from the live web with up to 10 results, for $5 per 1,000 searches. A search that returns nothing costs nothing.
-   `read_pages` returns the main text of up to 20 pages or documents (PDF, Word, Excel) in one call, at $0.80 per 1,000 pages. A page that gives no text is not charged.
-   Deep Search builds a list from a request in plain words. `compile` reads the request, `quote_capacity_work` prices it for free, and `authorize_capacity_work` starts it only after you approve the maximum. `get_find` and `list_find_rows` read the rows.

## Call a tool from the shell

`phi mcp call` runs one tool without the model, which helps in scripts. This call is one search and is charged like any other:

## Approvals in phi

phi treats an MCP call as a write: it goes through phi's permission gate, and in the default `interactive` mode phi asks before it runs. `phi run` uses `headless-strict` unless `permissions.mode` is set, and that mode denies every call that would ask, so a headless run needs a rule in `permissions.rules` that allows it. See phi's [permissions doc (opens in a new tab)](https://github.com/pulseaiclub/phi/blob/main/doc/permissions.md).

Sub-agents get no MCP servers by default, so ask from the main session. Deep Search adds its own gate: nothing paid starts until you approve the price SpecStream quotes.

## Why SpecStream for phi's web access

The Search API scores 97.9 F-score on all 1,000 SimpleQA Verified questions and 64.0 item F1 on all 200 WideSearch tasks. The method is on [benchmarks](https://specstream.ai/benchmarks.md). One server gives phi search, page reading and Deep Search, on one key with one spending limit.

## Cost

Connecting SpecStream to phi is free, and new accounts start with $10 of credit. A search of up to 10 results costs $5 per 1,000, and a page read costs $0.80 per 1,000. Deep Search is priced per delivered row and quoted before it runs, and a run can't cost more than the maximum you approved. See [pricing](https://specstream.ai/pricing.md) and [how billing works](https://specstream.ai/docs/billing.md).

## Remove

Run `phi mcp remove specstream`, or delete the entry from `~/.phi/mcp.json`, and restart phi. Revoke the key under **API keys** in **Agents & API**. Questions: [support@specstream.ai](mailto:support@specstream.ai).

## More

[SpecStream for phi](https://specstream.ai/integrations/phi.md) covers what it does in phi on one page. Every other tool has its guide in [Connect your tools](https://specstream.ai/docs/integrations.md). You see the most a request can cost before it starts, and the matches are paid from your balance. [Billing](https://specstream.ai/docs/billing.md) has the details. For help, email [support@specstream.ai](mailto:support@specstream.ai).
