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

# Raw HTTP

> Call the MCP server directly over JSON-RPC for testing or custom clients.

The server implements the MCP **streamable HTTP** transport. You can drive it directly with
JSON-RPC 2.0 over HTTP — useful for testing, scripting, or building a custom client.

<Info>
  In production you'll almost always use an MCP SDK or client rather than raw HTTP. This page is
  for debugging and understanding the wire format.
</Info>

## Request shape

* **Method:** `POST` (GET is also accepted)
* **URL:** `https://salesgraph.com/api/mcp`
* **Headers:**
  * `Authorization: Bearer <your key>`
  * `Content-Type: application/json`
  * `Accept: application/json, text/event-stream`
* **Body:** a JSON-RPC 2.0 message

## List tools

```bash theme={null}
curl -s https://salesgraph.com/api/mcp \
  -H "Authorization: Bearer $SALESGRAPH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list"
  }'
```

## Call a tool

Invoke a tool with `tools/call`, passing the tool `name` and its `arguments`:

```bash theme={null}
curl -s https://salesgraph.com/api/mcp \
  -H "Authorization: Bearer $SALESGRAPH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": {
      "name": "research",
      "arguments": { "topic": "Stripe" }
    }
  }'
```

The result's `content` is an array of text blocks containing markdown:

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [
      { "type": "text", "text": "# Stripe\n\n..." }
    ]
  }
}
```

<Note>
  The transport may stream the response as Server-Sent Events, which is why the `Accept` header
  includes `text/event-stream`. SDKs handle this for you.
</Note>

## Use an SDK instead

For real clients, use the official MCP SDK and a streamable HTTP transport:

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

const transport = new StreamableHTTPClientTransport(
  new URL("https://salesgraph.com/api/mcp"),
  {
    requestInit: {
      headers: { Authorization: `Bearer ${process.env.SALESGRAPH_API_KEY}` },
    },
  },
);

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

const tools = await client.listTools();
const result = await client.callTool({
  name: "competitors",
  arguments: { company: "Notion" },
});
```
