> ## Documentation Index
> Fetch the complete documentation index at: https://redop.useagents.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect over HTTP

> Run a Redop server over HTTP and verify that your MCP endpoint responds at /mcp.

Use HTTP when your server should run as a network service.

## Start the HTTP transport

```ts theme={null}
import { Redop } from "@redopjs/redop";

new Redop({
  serverInfo: {
    name: "http-server",
    version: "0.1.0",
  },
})
  .tool("ping", {
    handler: () => ({ pong: true }),
  })
  .listen(3000);
```

## What Redop serves

* the MCP endpoint is `http://localhost:3000/mcp`
* `POST /mcp` handles JSON-RPC requests
* for MCP `2026-07-28`, traffic is **stateless** — no session header is required
* for older protocol versions, `GET /mcp` opens the event stream and `DELETE /mcp` closes the session

## Verify with curl (MCP 2026-07-28)

Discover capabilities without a session:

```sh theme={null}
curl -i -X POST http://localhost:3000/mcp \
  -H 'Content-Type: application/json' \
  -H 'MCP-Protocol-Version: 2026-07-28' \
  -H 'Mcp-Method: server/discover' \
  --data '{"jsonrpc":"2.0","id":0,"method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}'
```

List tools (note the required `Mcp-Method` header):

```sh theme={null}
curl -X POST http://localhost:3000/mcp \
  -H 'Content-Type: application/json' \
  -H 'MCP-Protocol-Version: 2026-07-28' \
  -H 'Mcp-Method: tools/list' \
  --data '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}'
```

## Verify with curl (legacy sessioned)

Start by verifying that `initialize` responds:

```sh theme={null}
curl -i -X POST http://localhost:3000/mcp \
  -H 'Content-Type: application/json' \
  --data '{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"manual-check","version":"1.0.0"}}}'
```

Copy the `Mcp-Session-Id` response header from that first response.

Use that session ID on follow-up HTTP requests:

```sh theme={null}
curl -X POST http://localhost:3000/mcp \
  -H 'Content-Type: application/json' \
  -H 'MCP-Session-Id: your-session-id' \
  --data '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
```

## Troubleshooting

Turn on transport logging:

```ts theme={null}
.listen({
  port: 3000,
  debug: true,
})
```

## Related pages

* [Listening and Transports](/docs/documentation/listening-and-transports)
* [HTTP Transport Behavior](/docs/reference/http-transport)
* [Verify with local clients](/docs/getting-started/verify-clients)
* [Debug HTTP connections and sessions](/docs/guides/debug-http)
