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

# MCP Protocol Overview

> Technical reference for the MCP JSON-RPC 2.0 protocol endpoints served by GetMCP.

## What is the MCP Protocol?

The [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) is an open standard for communication between AI clients (Claude, Cursor, Windsurf) and tool servers. GetMCP implements the MCP specification using the **Streamable HTTP** transport.

## Endpoint

Each GetMCP server exposes a single HTTP endpoint:

```
https://yoursite.com/mcp/{slug}
```

| URL Part | Description                                      |
| -------- | ------------------------------------------------ |
| `{slug}` | The server's URL slug (e.g., `my-weather-tools`) |

## Transport: Streamable HTTP

All MCP requests use the Streamable HTTP transport:

| Method    | Purpose                                          |
| --------- | ------------------------------------------------ |
| `POST`    | Send JSON-RPC requests (the primary method)      |
| `GET`     | Open an SSE stream for server-initiated messages |
| `DELETE`  | Terminate a session                              |
| `OPTIONS` | CORS preflight                                   |

### Headers

**Required for POST requests:**

```
Content-Type: application/json
```

**Optional session tracking:**

```
Mcp-Session-Id: {session_id}
```

If `Mcp-Session-Id` is not provided, a new session ID is generated and returned in the response.

**Authentication (if server requires it):**

```
Authorization: Bearer {api_key}
```

## JSON-RPC 2.0

All POST request bodies and responses follow the [JSON-RPC 2.0](https://www.jsonrpc.org/specification) specification.

### Request Format

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_weather",
    "arguments": {
      "city": "London"
    }
  }
}
```

### Response Format

**Success:**

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {"type": "text", "text": "..."}
    ]
  }
}
```

**Error:**

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32601,
    "message": "Method not found: unknown/method"
  }
}
```

### Batch Requests

GetMCP supports JSON-RPC batch requests — send an array of request objects and receive an array of responses:

```json theme={null}
[
  {"jsonrpc": "2.0", "id": 1, "method": "ping", "params": {}},
  {"jsonrpc": "2.0", "id": 2, "method": "tools/list", "params": {}}
]
```

### Notifications

Requests without an `id` field are notifications. GetMCP processes them but returns no response (HTTP 202).

```json theme={null}
{
  "jsonrpc": "2.0",
  "method": "notifications/initialized",
  "params": {}
}
```

## Supported Methods

| Method                                                         | Description                                                 |
| -------------------------------------------------------------- | ----------------------------------------------------------- |
| [`initialize`](/api-reference/mcp-protocol/initialize)         | Negotiate protocol version and get server capabilities      |
| [`ping`](/api-reference/mcp-protocol/ping)                     | Check server connectivity                                   |
| [`tools/list`](/api-reference/mcp-protocol/tools-list)         | List all available tools                                    |
| [`tools/call`](/api-reference/mcp-protocol/tools-call)         | Execute a specific tool                                     |
| [`resources/list`](/api-reference/mcp-protocol/resources-list) | List all available resources                                |
| [`resources/read`](/api-reference/mcp-protocol/resources-read) | Read the content of a resource by URI                       |
| [`prompts/list`](/api-reference/mcp-protocol/prompts-list)     | List all available prompt templates                         |
| [`prompts/get`](/api-reference/mcp-protocol/prompts-get)       | Retrieve a rendered prompt with argument values substituted |

## Error Codes

| Code     | Description                                    |
| -------- | ---------------------------------------------- |
| `-32700` | Parse error — invalid JSON                     |
| `-32600` | Invalid request — malformed JSON-RPC structure |
| `-32601` | Method not found                               |
| `-32602` | Invalid params                                 |
| `-32603` | Internal error — server-side exception         |
