How to Load Test an MCP Server

An MCP server can pass every functional check and still fail the first time 50 agents use it at once. One slow tool ties up the workers, an upstream API starts rate limiting, and the agents retry, which adds more load.

Most of that failure is invisible to a standard API load test. A tool that fails still returns HTTP 200, with the error inside the JSON-RPC result. And many published MCP load testing guides describe a session handshake that the current version of the protocol no longer uses.

This guide is for testers who already load test web apps and APIs. It covers what a valid MCP request looks like today, how to build a test that catches failed tool calls, and how to run it in LoadView.

Contents

What Is MCP Server Load Testing?

MCP server load testing is the part of MCP performance testing that sends many concurrent Model Context Protocol requests to a remote MCP server and measures how its response times and error rates change as load rises. The load stands in for AI agents calling the server’s tools, often more than one agent per user and several tool calls per task.

The Model Context Protocol connects AI applications such as Claude, ChatGPT and Cursor to external tools and data. A remote MCP server exposes one HTTP endpoint, such as https://example.com/mcp, and every message is a JSON-RPC 2.0 request sent as an HTTP POST. You can load test it like any other API once each request is valid.

How Is MCP Traffic Different From REST API Traffic?

MCP traffic arrives in bursts. An agent sends a few tool calls in quick succession, then goes quiet for several seconds while the model reasons over the results. Infobip’s engineering team describes the same pattern in its January 2026 write-up on load testing its MCP servers.

Two bar charts over 120 seconds: REST API clients send a steady 4 to 8 requests per second, while three AI agents calling an MCP server send short bursts of up to 17 requests per second separated by idle gaps
Illustration: the same average load arrives evenly from REST clients and in bursts from agents.

Other differences change how you build the test.

  • Tool calls vary in cost. One server can expose a get_status tool that answers in 5 ms and a search_tickets tool that runs a database query for two seconds. A test that sends only one tells you little about the other.
  • A failed tool call often returns HTTP 200. The MCP spec separates protocol errors (a JSON-RPC error object) from tool execution errors, which come back as a normal result with "isError": true. A test that checks only status codes counts those as passes.
  • Failed calls cost tokens. When a tool call fails, the agent spends tokens on the failed attempt and often retries.

Our post on load testing AI agents covers the model side of this. But this guide stays on the MCP server.

What Does a Valid MCP Request Look Like?

Under the current spec, revision 2026-07-28, every MCP request is self-contained. There is no initialize handshake and no Mcp-Session-Id header. Each POST carries the protocol version and client details in its own body and mirrors key fields into HTTP headers.

Here is a tools/call request, based on the example in the Streamable HTTP transport page of the MCP specification:

POST /mcp HTTP/1.1
Content-Type: application/json
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
Mcp-Method: tools/call
Mcp-Name: get_weather

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_weather",
    "arguments": { "location": "Seattle, WA" },
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientInfo": { "name": "loadtest", "version": "1.0.0" },
      "io.modelcontextprotocol/clientCapabilities": {}
    }
  }
}

The headers must match the body. If Mcp-Name says get_weather and the body calls get_forecast, or a required header is missing, the server rejects the request with 400 Bad Request and JSON-RPC error -32020 (HeaderMismatch). So every request in your test needs its headers and body kept in sync.

For tool calls and other ordinary requests, the server answers with either a single JSON object or a short Server-Sent Events stream that ends with the final response. It decides per request, and your test has to accept both.

What If the Server Uses an Older MCP Version?

Many deployed servers still run protocol versions 2025-03-26 through 2025-11-25. On those, each virtual user sends an initialize request and a notifications/initialized message, then tool calls that carry the Mcp-Session-Id the server returned. Test them that way, because session storage and sticky routing are common bottlenecks on older servers.

To check which version a server speaks, send a server/discover request. Servers on 2026-07-28 must answer it with their supported versions; older servers return an error.

How to Load Test an MCP Server With LoadView

LoadView runs MCP load tests with its Rest WEB API test type, which sends JSON over HTTP from cloud load injectors and validates each response. The steps assume a server on the 2026-07-28 spec. If you’ve used our API load testing tutorial, most of the setup will look familiar.

Step 1: Write the Goal as a Number

Write a goal the test can pass or fail, such as this one.

At 150 concurrent virtual users for 15 minutes, search_tickets returns a p95 response time under 2 seconds, get_status stays under 300 ms, and fewer than 1% of tool calls fail, counting results with isError.

Set the threshold for each tool, not for the endpoint. Slow tools and fast tools share one URL, and an average across both hides the slow one. To pick the concurrency, start from the number of users who run agent tasks at your busiest time, times the agents each task starts. Our guide to concurrent user testing has more on choosing a concurrency target.

Step 2: Pick the Tool Calls to Load

Pick the calls agents make most, and include at least one expensive tool.

  • tools/list, which agents call to see what the server offers. Its result includes a ttlMs caching hint, so clients call it less often than tools.
  • Two or three tools/call requests for your busiest tools, with production arguments, including one that hits your slowest backend.

Vary the arguments where the tool’s cost depends on them. A search for a rare term and a search that returns 5,000 rows are different loads.

Step 3: Configure Each Request

In LoadView, create a Rest WEB API test and enter the MCP endpoint URL with POST as the request type. Add each call as its own target with Add Target. Targets run in the order they appear, so the sequence matches what one agent does.

Set up each target in this order.

  1. Add the headers: Content-Type, Accept: application/json, text/event-stream, MCP-Protocol-Version, Mcp-Method and, for tool calls, Mcp-Name.
  2. Paste the JSON-RPC body, with _meta fields that match the headers.
  3. Add authentication. If the server takes an OAuth bearer token, add a get-token request as the first target and pass the token on through a context parameter, as our guide to load testing OAuth web APIs shows.
  4. Set Flag as Error Responses That Exceed to the longest wait an agent would accept, such as 10 seconds for a slow tool. A tool call that takes 40 seconds isn’t a success, even if it eventually returns.

If a tool returns a handle that a later call needs, such as a job ID, pass it to the next target through a context parameter, the same way as the token. Servers on the 2026-07-28 spec use these handles instead of sessions.

Before running load, send server/discover to confirm the server supports 2026-07-28, then send each request once and read the response. A 400 with -32020 means a header and the body disagree. If the server answers a tool call with an SSE stream instead of JSON, check that the stored response contains the final result before you add load.

Step 4: Validate the Result, Not Just the Status Code

Set the expected response code to 200, then add Content Validation so a failed tool call counts as an error. LoadView’s content validation checks the response body for keywords, with & for AND, | for OR and ! for NOT.

For each tool call, require a value that only appears when the tool worked, and reject the error markers:

{["temperature"&!"isError\":true"&!"\"error\""]}

Also count a resultType of input_required as a failure. It means the server is waiting for input from the client, which a load test can’t provide.

Adjust the strings to what your server returns. Some servers write "isError": false on every success, and some put a space after the colon, so copy the exact text from the test response in Step 3. Avoid a keyword that also appears in the server’s error messages, because it would validate nothing.

Table of three MCP responses: a successful tool call passes both checks, a tool call that returns HTTP 200 with isError true passes a status code check but fails content validation, and a 400 HeaderMismatch fails both
A status code check passes a failed tool call. Content validation catches it.

Step 5: Set the Load Curve

Use a Load Step Curve for the first run. Start at 10 virtual users, step up to your target over 10 minutes, hold for 15 minutes, then ramp down. The ramp shows where response times start to bend, and the hold shows whether they stay there.

Then add a spike run that jumps from a low base to the target in under a minute, which is closer to what happens when a team rolls out a new agent. LoadView’s load curves include the step, goal and dynamic options. Our comparison of load testing vs. stress testing covers when to keep pushing past the target.

Agents also pause between bursts while the model reasons. A virtual user that runs its targets back to back sends more tool calls per minute than an agent does, so compare tests by tool calls per second, not just by user count.

Step 6: Choose Where the Load Comes From

Pick load injector locations near the agents that call the server. One nearby region is enough for a hosted agent platform in one cloud. If users run agents from desktop apps worldwide, spread the load across the geo-distributed network and compare regions.

Step 7: Run the Test and Read the Results

Read the results for each target, not just the overall chart. LoadView’s performance reports show response times and error codes for each session, with waterfall charts and a copy of the server response.

Look at the error types first. A 400 with -32020 is a header mismatch, and a 400 with UnsupportedProtocolVersionError means the server doesn’t support the version you sent. A 404 with -32601 is an unknown method. A 429 points to rate limiting, a 5xx or timeout to the server running out of capacity, and a content validation failure to a tool that returned an error inside a 200.

Which Metrics Matter in an MCP Load Test?

The metrics that matter are response time per tool, failed tool calls and throughput at your target concurrency.

Metric What it tells you What to watch for
p95 response time per tool How long agents wait for each tool Fast tools slowing down when slow tools are busy
Failed tool calls HTTP errors plus isError results and JSON-RPC errors A rate that rises with load, even with zero 5xx responses
Throughput Completed tool calls per second Throughput that stops growing while users keep rising
Error mix Which layer fails first 429s from a gateway, 503s from the server, timeouts
Server resources CPU, memory, connections and worker pools Memory that climbs during a long hold

For memory and connection leaks, run a soak test that holds moderate load for a few hours. Our guide to endurance testing covers how long to run one.

What Breaks MCP Servers Under Load?

These are common ways MCP servers fail under load, each with the test result that catches it.

A Slow Tool Blocks the Fast Ones

A support MCP server built on FastMCP runs search_tickets against PostgreSQL and get_status from memory. At 80 concurrent users the searches hold every worker, and get_status goes from 20 ms to 3 seconds without any code change.

What catches it: separate targets for each tool in LoadView, with a response time threshold per tool. The fast tool’s p95 rises at the same load step as the slow tool’s.

An Upstream API Starts Rate Limiting

A tool wraps the GitHub REST API. Under load, GitHub returns rate limit errors, and the MCP server passes them back as tool results with isError: true. But every response is HTTP 200, so a status code check reports a clean run.

What catches it: content validation that rejects isError. LoadView logs each one as an error, and the stored server response shows the rate limit message.

A Proxy Buffers the SSE Response

The server streams progress notifications for a long tool call, but it sits behind nginx with response buffering on. The client receives nothing until the whole response is ready. The MCP spec recommends that servers send X-Accel-Buffering: no on SSE responses for this reason.

What catches it: a second LoadView test against the server’s origin URL, bypassing nginx. If the same tool responds much faster there, the proxy is adding the delay.

Sessions Break Behind a Load Balancer

Servers still on a 2025 protocol version can fail this way. The server keeps sessions in memory on each pod, and Kubernetes scales from two pods to six during the test. Requests with an Mcp-Session-Id from one pod land on another, which doesn’t know the session and returns 404.

What catches it: a step test long enough for the autoscaler to add pods, with each virtual user running its own initialize and reusing its session. 404 errors that start when the pod count changes point to routing, not capacity.

The Bottom Line

Load test an MCP server the way agents use it. Send valid headers on every request, use separate targets for fast and slow tools, and count isError results as failures. Start with a step test to your target concurrency, add a spike test, then a soak test before launch.

You can build the test in LoadView’s API load testing tool. Plus, new accounts get 5 free load tests, enough for a baseline, a step test and a spike test.

Frequently Asked Questions

Do I Need to Call Initialize Before Each MCP Tool Call?

Not on servers that use the 2026-07-28 spec. That revision removed the initialize handshake and the Mcp-Session-Id header, so every request carries its protocol version in _meta and the MCP-Protocol-Version header. Servers on versions 2025-03-26 through 2025-11-25 still need initialize, and each virtual user should run its own. Send server/discover to find out which version a server supports.

Can I Load Test an MCP Server With JMeter, k6 or Postman?

Yes. Any tool that sends HTTP POST requests with custom headers and checks the response body can load test a remote MCP server. Infobip extended k6 with its own MCP extension. LoadView runs JSON requests directly and can also run existing JMeter test plans and Postman collections.

Does an MCP Load Test Use LLM Tokens?

No. The test calls the MCP server directly, so no model is involved. The exception is a tool that calls an LLM itself, such as one that summarizes documents, which spends tokens on every call during the test.

Can I Load Test a stdio MCP Server?

Not over the network. A stdio server runs as a subprocess of one client, so there is no endpoint for other users to call. Load test a server that uses the Streamable HTTP transport instead, which is the transport remote MCP servers use.

How Many Concurrent Users Should an MCP Load Test Use?

Start from the number of people who run agent tasks at your busiest time, multiply by the agents each task starts, and add a margin for growth. Then step past that number to find where response times or failed tool calls start to rise.