---
title: "Send an MCP message - Xata"
description: "Handle a single JSON-RPC 2.0 message from an MCP client, per the MCP Streamable HTTP transport. The server is stateless: every request is self-contained and carries the caller's credential, so there is no session to establish or resume. GET and DELETE on this path return 405 Method Not Allowed. Requests (messages with an id) are answered with the JSON-RPC response, either as application/json or as a text/event-stream carrying the response and any notifications emitted while it runs. Requests must accept both. Notifications and responses (messages without an id) are answered with 202 Accepted and an empty body."
source: "https://xata.io/docs/api-reference/mcp/send-an-mcp-message"
---

Skip to main content

POST

/

mcp

curl --request POST \ --url https://api.xata.tech/mcp \ --header 'Accept: \<accept>' \ --header 'Authorization: \<api-key>' \ --header 'Content-Type: application/json' \ --data ' { "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": { "name": "my-client", "version": "1.0.0" } } } '

```
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      {
        "text": "{\"email\":\"user@example.com\"}",
        "type": "text"
      }
    ],
    "isError": false
  }
}
```

#### Authorizations

​

Authorization

string

header

required

API key authentication using Bearer token format: Bearer \<api_key>

#### Headers

​

Accept

string

default:application/json, text/event-stream

required

Must list both `application/json` and `text/event-stream`.

​

MCP-Protocol-Version

string

Protocol revision negotiated during `initialize`, echoed on every subsequent request. Omitted on the `initialize` request itself.

Example:

`"2025-06-18"`

#### Body

application/json

A JSON-RPC 2.0 message. A request carries `id` and `method` and is answered with a response; a notification carries `method` without `id` and is not. The `method` and `params` values are defined by the MCP specification.

​

jsonrpc

enum\<string>

required

JSON-RPC protocol version. Always `2.0`.

Available options:

`2.0`

​

method

string

required

MCP method, such as `initialize`, `tools/list`, or `tools/call`.

​

id

string (0)

Request identifier, echoed on the response. Omitted for notifications.

​

params

object

Method parameters as defined by the MCP specification.

#### Response

JSON-RPC response to the request

A JSON-RPC 2.0 response. Exactly one of `result` or `error` is present.

​

jsonrpc

enum\<string>

required

JSON-RPC protocol version. Always `2.0`.

Available options:

`2.0`

​

id

string (0)

required

Identifier of the request this responds to.

​

result

object

Method result as defined by the MCP specification.

​

error

object

A JSON-RPC 2.0 error. Failures inside a tool are reported in the tool result with `isError`, not here.

Show child attributes

Was this page helpful?
