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

# Portkey MCP Gateway

Add SpecStream to your Portkey organization's MCP Registry, and every workspace you choose reaches it at one Portkey address, behind Portkey's access control and logs. Portkey signs in to SpecStream with one shared API key, or with each user's own SpecStream account over OAuth.

[SpecStream for Portkey MCP GatewayAgent frameworks & builders](https://specstream.ai/integrations/portkey-mcp.md)

## What you need

-   A Portkey organization where you are an Org Admin or Org Owner, and a workspace to give the server to.
-   A SpecStream account. New accounts start with $10 of credit, no card. [Create one](https://specstream.ai/signup?utm_source=portkey-mcp).

1.  1

    ## 1. Choose how Portkey signs in to SpecStream

    Portkey keeps two sign ins apart. Your users and agents sign in to Portkey with a Portkey API key or Portkey's OAuth. Portkey then signs in to SpecStream with the **Auth Type** you set on the server. SpecStream takes two of Portkey's types:

    **Headers**: one SpecStream API key for everyone in the workspaces you choose. Every call spends from that key, up to its spending limit.

    **OAuth 2.1**: each user signs in to SpecStream once, and every call runs on that user's own SpecStream account, balance and limits. SpecStream lets a client register itself, so Portkey needs no client ID or secret.

2.  2

    ## 2. Create a SpecStream API key (Headers only)

    In SpecStream, open [Agents & API](https://specstream.ai/workspace/agents?tab=keys&utm_source=portkey-mcp), choose **API keys**, then **Create API key**, and give it a total spending limit above 0. Every Portkey user of this server spends from the key, so the limit is the ceiling for all of them. Copy the key from the next screen: SpecStream shows it once.

3.  3

    ## 3. Add SpecStream to the MCP Registry

    In Portkey, open **MCP Registry** in your organization settings and click **Add MCP Server**. Fill in:

    **Name**: `SpecStream`

    **Slug**: `specstream`

    **Server URL**: `https://api.specstream.ai/mcp`

    **Server Type**: HTTP. SpecStream serves Streamable HTTP.

    **Auth Type**: **Headers**, with the header `Authorization` and the value `Bearer` followed by a space and your SpecStream key. Or **OAuth 2.1**, with nothing else to fill in.

4.  4

    ## 4. Give workspaces access, then test

    Under **Workspace Provisioning** in the same form, select the workspaces that may use SpecStream. Click **Test Connection**, then **Add Server**. To change access later, open the server in **MCP Registry** and toggle workspaces on its **Access Control** tab.

    Open the server's **Capabilities** tab. It lists the SpecStream tools, such as `search_web`, `read_pages` and `compile`. If it is empty, check the key in the header, or sign in to SpecStream when an OAuth server asks.

5.  5

    ## 5. Connect a client through Portkey

    In the workspace, open **MCP** in the sidebar and copy SpecStream's connection URL. It looks like `https://mcp.portkey.ai/specstream/mcp`. A client that signs in to Portkey with OAuth needs only the URL. A backend or an agent sends a workspace API key with **MCP Invoke** permission in `x-portkey-api-key`:

    MCP client config

    ```json
    {
      "mcpServers": {
        "specstream": {
          "url": "https://mcp.portkey.ai/specstream/mcp",
          "headers": {
            "x-portkey-api-key": "YOUR_PORTKEY_API_KEY"
          }
        }
      }
    }
    ```

6.  6

    ## 6. Ask

    Ask the client something recent. It calls `search_web` through Portkey, and the call shows in Portkey's MCP logs with the tool, the user and the time:

    Prompt

    ```text
    What did the European Central Bank decide at its last meeting? Search the web and name the pages.
    ```

7.  7

    ## 7. Or add it with the Admin API

    `POST /v1/mcp-integrations` takes the same fields, with an admin API key in `x-portkey-api-key`. `name`, `url`, `auth_type` and `transport` are required. For **Headers**, the key goes in `configurations.custom_headers`; for OAuth, send `"auth_type": "oauth_auto"` and no `configurations`:

    Terminal

    ```bash
    curl -X POST https://api.portkey.ai/v1/mcp-integrations \
      -H "x-portkey-api-key: $PORTKEY_ADMIN_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "organisation_id": "YOUR_ORGANISATION_ID",
        "name": "SpecStream",
        "slug": "specstream",
        "url": "https://api.specstream.ai/mcp",
        "auth_type": "headers",
        "transport": "http",
        "configurations": {
          "custom_headers": {"Authorization": "Bearer YOUR_SPECSTREAM_KEY"}
        }
      }'
    ```

## What the tools do

The tools a Portkey user reaches most:

-   `search_web` answers a question from the live web with up to 10 results, each with its URL. It takes `{"q": "<the question>"}`.
-   `read_pages` returns the main text of up to 20 pages or documents (PDF, Word, Excel), read live. It takes `{"urls": ["<url>"]}`.
-   `compile` reads a request for many records into its conditions and the facts to bring back, and `quote_capacity_work` prices it. Both cost nothing.
-   `authorize_capacity_work` starts a paid Deep Search run, and only with `confirm_max_cents` equal to the approved maximum. `get_find` follows it and `list_find_rows` reads the rows, each value with its source URL and read time.

## Keep paid runs off a shared server

With **Headers**, every user spends from one key. To give them search and page reading and nothing that starts a run, open **Capabilities** on the server in **MCP Registry** and turn off `authorize_capacity_work`. Portkey hides a capability you turn off and returns an error if it is called directly. A workspace manager can do the same for one workspace on the server's **Capabilities** tab under **MCP**.

## Cost

Adding SpecStream to Portkey costs nothing on the SpecStream side. Each `search_web` call is one Search API call at $5 per 1,000 searches of up to 10 results. Each page `read_pages` reads is $0.80 per 1,000 pages, and a page with no text is not charged. Neither needs a quote or an approval: they come out of the key's or the user's balance, up to its spending limit.

Reading a request and pricing it cost nothing. A Deep Search run charges each delivered row 5¢, 15¢ or $1, depending on how much the row needs, plus 5¢ for a person's email and 15¢ for a phone, never more than the approved maximum. A run that finds nothing costs nothing. [Balance, quotes, and billing](https://specstream.ai/docs/billing.md) has the details.

## Other gateways

The same server works behind the LiteLLM proxy with one entry in `config.yaml`: see [the LiteLLM MCP Gateway guide](https://specstream.ai/docs/integrations/litellm-mcp.md). Every SpecStream tool is described in the [agent guide](https://specstream.ai/docs/mcp.md).

## Disconnect

Delete the SpecStream server in **MCP Registry**, or turn off the workspaces on its **Access Control** tab. To end its access on the SpecStream side, revoke the key under **Agents & API**. Your saved results stay in your workspace. Questions go to [support@specstream.ai](mailto:support@specstream.ai).

## More

[SpecStream for Portkey MCP Gateway](https://specstream.ai/integrations/portkey-mcp.md) covers what it does in Portkey MCP Gateway 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).
