# Connecting an MCP Client

> Markdown variant of <https://www.skillzdrive.com/docs/guides/connecting>.

Transport options, session management, and platform-specific setup.

## Transport options

| Transport | How to connect | Best for |
|-----------|----------------|----------|
| Streamable HTTP | `POST /api/mcp` with `Accept: text/event-stream` | Claude Code, Claude Desktop, modern MCP clients |
| JSON-only HTTP | `POST /api/mcp` without SSE Accept header | ChatGPT, simple HTTP clients, REST-style integrations |
| Legacy SSE | `GET /api/mcp/sse` → receives endpoint → `POST /message?sessionId=` | Older MCP clients using separated SSE pattern |

Use Streamable HTTP. It's the modern MCP transport and what most
clients use by default.

## Streamable HTTP details

The Streamable HTTP transport uses a single endpoint with different
HTTP methods:

- **`POST /api/mcp`** — send JSON-RPC messages. If the client includes `Accept: text/event-stream`, the response uses SSE format.
- **`GET /api/mcp`** — open an SSE stream for server-initiated messages and notifications.
- **`DELETE /api/mcp`** — terminate a session. Include the `MCP-Session-Id` header.

## Session tracking

The server generates a session ID when you send the `initialize`
request. It's returned in the `MCP-Session-Id` response header.
Include this header in all subsequent requests to maintain your
session.

```http
MCP-Session-Id: <uuid>
```

## CORS configuration

The server sets these CORS headers to support browser-based and
cross-origin clients:

```http
Access-Control-Allow-Methods: GET, POST, DELETE, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization, Accept, MCP-Session-Id, MCP-Protocol-Version
Access-Control-Expose-Headers: MCP-Session-Id
```

Localhost origins are allowed in development for local testing.

## Platform connection guide

| Platform | Config location | Transport |
|----------|-----------------|-----------|
| Claude.ai | Project settings → Integrations → Add MCP Server | Streamable HTTP |
| Claude Code | `~/.claude.json` or `.mcp.json` | Streamable HTTP |
| Claude Desktop | `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) | Streamable HTTP |
| Cursor | `~/.cursor/mcp.json` or `.cursor/mcp.json` | Streamable HTTP |
| ChatGPT | Settings → Connectors → Developer mode | JSON-only HTTP |
| Custom agent | Your code (use MCP SDK) | Streamable HTTP |

## Minimal connection example

### TypeScript

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const client = new Client({ name: "my-agent", version: "1.0.0" });

const transport = new StreamableHTTPClientTransport(
  new URL("https://www.skillzdrive.com/api/mcp"),
  { requestInit: { headers: { Authorization: "Bearer sk_live_YOUR_KEY" } } },
);

await client.connect(transport);
```

### Python

```python
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

async with streamablehttp_client(
    "https://www.skillzdrive.com/api/mcp",
    headers={"Authorization": "Bearer sk_live_YOUR_KEY"},
) as (read_stream, write_stream, _):
    async with ClientSession(read_stream, write_stream) as session:
        await session.initialize()
```

## Protocol version

The `protocolVersion` field (e.g. `2024-11-05`) is the MCP
specification revision date, not the server version. The
SkillzDrive server supports:

- `2025-11-25`
- `2025-06-18`
- `2025-03-26`
- `2024-11-05`
- `2024-10-07`

## Next steps

- [Authentication](https://www.skillzdrive.com/docs/guides/authentication.md): API keys, Bearer tokens, OAuth flows.
- [Quickstart](https://www.skillzdrive.com/docs/quickstart.md): connect and run your first skill in 5 minutes.
- [Custom agent integration](https://www.skillzdrive.com/docs/agent-integration.md).
