---
title: "Remote MCP Server: Streamable HTTP vs Local stdio"
description: "A remote MCP server runs over Streamable HTTP: one POST endpoint, auth headers, Origin checks, no sessions. Real responses, and when stdio fits better."
url: https://perceptlayer.com/blog/remote-mcp-server-streamable-http
---

[Blog](https://perceptlayer.com/blog) / [AI agents](https://perceptlayer.com/blog/category/ai-agents)

# Remote MCP Server: Streamable HTTP vs Local stdio

11 Oct 2026 Perceptlayer 7 min read

A remote MCP server is an MCP server that runs on someone else's machine and that your AI client reaches over the network, using the Streamable HTTP transport: every message is an HTTP POST to one URL. Compared with a local stdio server, which your client launches as a subprocess, a remote server needs real authentication, must check the `Origin` header, and since the 2026-07-28 revision of the spec keeps no protocol sessions. This post walks through what changes, with real responses from Perceptlayer's server, and when a local server is still the better choice.

## Key takeaways

-   Streamable HTTP uses one MCP endpoint that accepts POST. Each JSON-RPC request is its own POST, answered with a JSON object or a request-scoped SSE stream.
-   A remote server must validate `Origin` and should authenticate every connection. Perceptlayer's server answers a foreign `Origin` with `403` and takes an API key as `Authorization: Bearer`.
-   Requests under the 2026-07-28 spec mirror the version and method into `MCP-Protocol-Version`, `Mcp-Method` and, for tool calls, `Mcp-Name` headers; a missing header gets a `400` with error `-32020`.
-   Choose stdio when the server needs your local files, tools or network; choose remote when the data lives on a service and many clients share it.

## What makes an MCP server remote?

A server is remote when the client talks to it over HTTP instead of over the standard input and output of a process it launched. The MCP specification defines exactly two standard transports. With stdio, the client starts the server as a subprocess and exchanges newline-delimited JSON-RPC over `stdin` and `stdout`. With Streamable HTTP, the server is an independent process that can serve many clients, and each message is a POST to a single MCP endpoint ( [MCP transports](https://modelcontextprotocol.io/specification/2026-07-28/basic/transports), 2026).

The protocol on top is identical: the same `tools/list`, the same `tools/call`, the same JSON results. What changes is everything around the message: where the server runs, who can reach it, how it knows who you are, and what happens when the network is slow. A Streamable HTTP server can run on `localhost` too, but "remote MCP server" usually means a hosted one, such as `https://perceptlayer.com/mcp`. If you're new to the protocol itself, [What Is an MCP Server?](https://perceptlayer.com/blog/what-is-an-mcp-server) covers the basics.

## How does Streamable HTTP carry MCP messages?

Streamable HTTP maps one JSON-RPC request to one HTTP POST. The server exposes a single endpoint path; the client POSTs each request or notification there; the server answers a request with either `Content-Type: application/json` or an SSE stream scoped to that request, carrying progress notifications before the final response ( [Streamable HTTP transport](https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http), 2026). The 2026-07-28 revision removed the standalone GET stream and protocol-level sessions.

Perceptlayer's server takes the simplest form the spec allows: it answers every request with one JSON object and no SSE. These responses come from a local run of the server's code, not the live endpoint. A GET is refused:

```text
HTTP/1.1 405 Method Not Allowed
Allow: POST
```

Batches are refused too, because the spec has one message per POST:

```json
{"jsonrpc":"2.0","error":{"code":-32600,"message":"Batch requests are not supported. Send one message per POST."}}
```

### Which headers does each request carry?

Under the 2026-07-28 spec, each request carries its protocol version and client capabilities in `params._meta`, and mirrors them into headers so proxies and gateways can route without parsing the body. Every POST needs `MCP-Protocol-Version` and `Mcp-Method`; `tools/call`, `resources/read` and `prompts/get` also need `Mcp-Name`. A request that leaves one out is rejected:

```json
{"jsonrpc":"2.0","id":1,"error":{"code":-32020,"message":"Header mismatch: Mcp-Method header is missing."}}
```

A version the server doesn't support gets a `400` listing the ones it does, which is how a client negotiates:

```json
{"jsonrpc":"2.0","id":1,"error":{"code":-32022,"message":"Unsupported protocol version","data":{"supported":["2026-07-28","2025-11-25","2025-06-18","2025-03-26"],"requested":"2024-11-05"}}}
```

Older clients still work. A client on an earlier revision sends `initialize` first, and the server answers with the version it will speak, its capabilities and its instructions. A request with no version header is treated as the 2025-03-26 revision, which the spec allows.

## How does a remote server know who you are?

A local stdio server inherits your environment: it reads credentials from environment variables or files, and the spec says stdio implementations should do exactly that rather than follow its HTTP authorization flow ( [MCP authorization](https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization), 2026). A remote server can't see your machine, so the credential travels with each request.

The spec's authorization framework for HTTP transports is OAuth 2.1: the MCP server acts as a resource server, and clients discover its authorization server through OAuth Protected Resource Metadata. That fits servers acting on a user's account in another system. A simpler pattern, common for data APIs, is a static key in a header. Perceptlayer's server takes your API key as `Authorization: Bearer` (or `X-API-Key`), which is how Claude Code adds it:

```bash
claude mcp add --transport http perceptlayer https://perceptlayer.com/mcp --header "Authorization: Bearer $API_KEY"
```

We didn't run this command for this post. Listing tools and searching the catalogue need no key; only `call_endpoint` does, and without one it returns a tool error telling the model to add the header. [MCP Server Authentication: API Keys vs OAuth](https://perceptlayer.com/blog/mcp-server-api-key-vs-oauth) compares the two approaches in depth.

## Why does a remote server check the Origin header?

Because a web page in your browser can send requests to any URL, including an MCP server, and the server needs to tell a legitimate client from a hostile page. The spec says Streamable HTTP servers must validate `Origin` on every incoming connection to prevent DNS rebinding attacks, must answer an invalid `Origin` with `403 Forbidden`, and when running locally should bind to `127.0.0.1` rather than all interfaces.

Server-to-server clients, such as Claude Code or an agent SDK, send no `Origin`, so they pass. A browser request from an unknown site is refused. From the local run:

```text
HTTP/1.1 403 Forbidden
{"jsonrpc":"2.0","error":{"code":-32600,"message":"Origin not allowed."}}
```

This matters most for servers on `localhost`. A local HTTP server that skips the check can be driven by any website you visit; a stdio server has no network port to attack at all.

## What changes without sessions?

Without protocol sessions, each request stands alone: the server keeps no per-client state between POSTs, and any server instance can answer any request. That makes remote servers easy to run behind a load balancer or on serverless platforms. Perceptlayer's server is stateless in this sense.

Statelessness doesn't make tool calls idempotent. A `call_endpoint` that times out on your side may still have run, and on Perceptlayer a successful call costs the endpoint's credits (1 for `google-search.search`, from the [Google Search API](https://perceptlayer.com/apis/google-search)) whether or not your client received the reply. Failed calls cost nothing. Two limits shape a remote call's behaviour:

| Limit | Value on Perceptlayer | What to do |
| --- | --- | --- |
| Data source timeout | 60 seconds, then a `timeout` error (not charged) | Set your client's timeout above 60 seconds |
| Response size in MCP | 100,000 characters; longer responses are truncated with a note | Ask for less with a page or limit parameter |
| Request rate | Per account: 1 a second free, at least 5 a second paid | Honour `Retry-After` on a 429 |

[Retry Web API Calls Without Paying Twice](https://perceptlayer.com/blog/retry-web-api-calls-without-paying-twice) covers the timeout case, and [MCP Server Rate Limiting](https://perceptlayer.com/blog/mcp-server-rate-limiting-agents) covers pacing an agent.

## When is a local stdio server the better fit?

Choose stdio when the server's job is on your machine, and remote when the job is on a service. A filesystem server, a git server or a server that drives a local database belongs on stdio: it needs your files and credentials, it should never be reachable from the network, and launching it per client is cheap. A data API, a SaaS integration or anything several people or agents share belongs remote: one deployment, one place to update, no install on each machine.

|  | Local stdio | Remote Streamable HTTP |
| --- | --- | --- |
| Runs | As a subprocess of the client | As a service, often hosted |
| Install | On every machine that uses it | None; a URL in the client config |
| Credentials | From the local environment | A header per request, or OAuth |
| Attack surface | No network port | A public endpoint: needs auth and Origin checks |
| Shared by many clients | No | Yes |
| Updates | Each user upgrades | The operator deploys once |
| Typical use | Files, git, local databases, local tools | Data APIs, SaaS actions, team-wide tools |

Many setups use both: local servers for the codebase, a remote one for live web data. To try a remote server, add Perceptlayer's with the command above, or follow [How to Add an MCP Server to Claude Desktop and Cursor](https://perceptlayer.com/blog/add-mcp-web-data-tools-claude-desktop). The [AI agents docs](https://docs.perceptlayer.com/ai-agents) cover other clients, and you can [get a free API key](https://perceptlayer.com/signup) for the calls.

## APIs in this post

-   [Google Search **1 credit per call** · 7 endpoints](https://perceptlayer.com/apis/google-search)

## Frequently asked questions

### Is a remote MCP server slower than a local one?

Each call adds a network round trip, so yes, by that much. For a data server, the time usually goes on fetching the data, not the transport: a tool that calls the web costs the same either way. Where latency matters, prefer servers that return JSON directly rather than streams you don't need.

### Can a remote MCP server use SSE?

Yes. Under Streamable HTTP, the server may answer any request with an SSE stream scoped to that request, carrying progress notifications before the final response; clients must accept both JSON and SSE. The older HTTP+SSE transport from the 2024-11-05 revision is a different, deprecated design. Perceptlayer's server answers every request with plain JSON.

### How do I secure a remote MCP server I run myself?

Authenticate every request, with OAuth 2.1 as the spec describes or with keys you can revoke. Validate `Origin` and answer unknown origins with `403`. Serve over HTTPS, apply per-account rate limits, and never log request bodies that may contain user data. If it only serves you, bind it to `127.0.0.1`.

### Does a remote MCP server cost anything to call?

That depends on the server. On Perceptlayer's, `tools/list`, `search_endpoints` and `get_endpoint` cost nothing and need no key; `call_endpoint` costs the endpoint's credits, 1 for nearly all endpoints, only on success. Every account gets 100 free credits after verifying an email address; see [pricing](https://perceptlayer.com/pricing).

### Which clients support remote MCP servers?

Clients that implement the Streamable HTTP transport can connect by URL; Claude Code takes `--transport http`, and other clients use a URL field or a config entry. Older clients may only support the legacy handshake, which Perceptlayer's server still answers. Check your client's documentation for how it sends custom headers.

mcp remote mcp server streamable http stdio ai agents

## More from the blog

1.  [AI agents](https://perceptlayer.com/blog/category/ai-agents) 13 Oct 2026 Updated 10 Nov 2026 Perceptlayer 7 min read
    
    ## [What Is an MCP Server? A Working Example with Web Data](https://perceptlayer.com/blog/what-is-an-mcp-server)
    
    An MCP server exposes tools, resources and prompts to AI apps over stdio or Streamable HTTP. See a real tools/list and tools/call, and what each costs.
    
2.  [AI agents](https://perceptlayer.com/blog/category/ai-agents) 26 Oct 2026 Updated 10 Nov 2026 Perceptlayer 7 min read
    
    ## [AI Agent Tools: What an Agent Needs for Web Data](https://perceptlayer.com/blog/ai-agent-tools-web-data)
    
    An agent tool is a name, a description, an input schema and a result. How search, lookup and fetch tools map to three MCP tools, two of them free.
    
3.  [AI agents](https://perceptlayer.com/blog/category/ai-agents) 9 Oct 2026 Updated 10 Nov 2026 Perceptlayer 7 min read
    
    ## [CrewAI Tools: Build a Custom Tool for Live Web Data](https://perceptlayer.com/blog/crewai-custom-tool-web-data)
    
    Build a CrewAI custom tool (a BaseTool subclass) that searches Google for live results, cap it at 5 calls a run, or load MCP tools instead. Tested code.
