---
title: "Build the MCP server without sessions · Agent Wranglers"
url: https://agentwranglers.se/playbook/agents-as-users/mcp-servers/stateless-mcp-server
id: AGT-11
level: Recommended
updated: 2026-10-22
tokens: 997
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Build the MCP server without sessions

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [MCP servers](https://agentwranglers.se/playbook/agents-as-users/mcp-servers.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: AGT-11
- Level: Recommended
- Chapter: [MCP servers](https://agentwranglers.se/playbook/agents-as-users/mcp-servers.md)
- Rule: Answer every MCP request from that request alone. Read the protocol version and client capabilities from its `_meta`, and keep state across calls only behind handles passed as tool arguments.
- Check: Run two server instances behind a round-robin proxy. A scripted client calls `server/discover`, creates a handle and uses it in three more calls. Every call succeeds, whichever instance answers. The server never sends an `Mcp-Session-Id` header.
- How: The 2026-07-28 revision removed the `initialize` handshake and the `Mcp-Session-Id` header. Every request carries `io.modelcontextprotocol/protocolVersion` and `io.modelcontextprotocol/clientCapabilities` in `_meta`. Implement `server/discover`, which the revision requires, so clients can see your versions and capabilities. Then any instance behind a load balancer can answer any request. Prove it as [Run two copies of the app in staging](https://agentwranglers.se/playbook/scaling/stateless-app-servers/two-copies-in-staging.md) says. Ignore an `Mcp-Session-Id` sent by an older client, and answer GET or DELETE on the endpoint with 405. Store cart or draft state under a handle that a tool returns, and check it as [Check the caller's rights on every handle](https://agentwranglers.se/playbook/agents-as-users/mcp-servers/check-handle-owner.md) says. Pick an SDK that supports the revision, as [Use the Model Context Protocol to give agents your tools](https://agentwranglers.se/playbook/stack/ai-software/mcp-for-tools.md) says.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### HTTP example

```http
POST /mcp HTTP/1.1
Host: example.com
Content-Type: application/json
Accept: application/json, text/event-stream
MCP-Protocol-Version: 2026-07-28
Mcp-Method: tools/call
Mcp-Name: add_item

{"jsonrpc":"2.0","id":7,"method":"tools/call","params":{"name":"add_item",
 "arguments":{"basket_id":"bsk_7Hq2","sku":"TENT-2P"},
 "_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}}}
```

## Sources

- [MCP specification 2026-07-28, key changes](https://modelcontextprotocol.io/specification/2026-07-28/changelog)
- [MCP Streamable HTTP transport](https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http)

## Related rules

- SCL-6 [Run two copies of the app in staging](https://agentwranglers.se/playbook/scaling/stateless-app-servers/two-copies-in-staging.md) in Scaling
- AGT-12 [Check the caller's rights on every handle](https://agentwranglers.se/playbook/agents-as-users/mcp-servers/check-handle-owner.md) in Agents as users
- STK-89 [Use the Model Context Protocol to give agents your tools](https://agentwranglers.se/playbook/stack/ai-software/mcp-for-tools.md) in Software choices

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/agents-as-users/mcp-servers/stateless-mcp-server">Agent Wranglers agents as users playbook</a>`. In code you write, add a comment next to it with the same link.

- Next: [Check the caller's rights on every handle](https://agentwranglers.se/playbook/agents-as-users/mcp-servers/check-handle-owner.md)
- [MCP servers](https://agentwranglers.se/playbook/agents-as-users/mcp-servers.md)
