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

# Jeder andere Client

> Das rohe Protokoll, für den Bau Ihres eigenen Agenten.

Alles, was ein Client braucht, ohne Client.

| | |
| - | - |
| Endpunkt | `https://api.minidesk.ai/mcp` |
| Methode | `POST` |
| Transport | Streamable HTTP |
| Protokollversion | `2025-06-18` |
| Authentifizierung | `Authorization: Bearer mdsk_mcp_...` |
| Inhaltstyp | `application/json` |

Anfragen sind JSON-RPC 2.0. Jeder Aufruf ist ein einzelnes POST; es gibt
keine Sitzung, die man öffnen oder am Leben halten müsste.

## initialize

```bash theme={null}
curl -X POST https://api.minidesk.ai/mcp \
  -H "Authorization: Bearer $MINIDESK_MCP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "jsonrpc": "2.0", "id": 1, "method": "initialize" }'
```

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2025-06-18",
    "capabilities": { "tools": {} },
    "serverInfo": { "name": "minidesk", "version": "1.0.0" }
  }
}
```

## tools/list

```bash theme={null}
curl -X POST https://api.minidesk.ai/mcp \
  -H "Authorization: Bearer $MINIDESK_MCP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "jsonrpc": "2.0", "id": 2, "method": "tools/list" }'
```

Liefert jedes Tool mit seinem `name`, seiner `description` und seinem
`inputSchema`. Die Liste ist nach Namen sortiert, also zwischen Aufrufen
stabil.

Entdecken Sie die Oberfläche hier, statt sie fest zu kodieren. Ein Tool
hinzuzufügen ist eine additive Änderung, die wir jederzeit vornehmen
können; das Schema eines bestehenden Tools zu ändern, ist keine.

## tools/call

```bash theme={null}
curl -X POST https://api.minidesk.ai/mcp \
  -H "Authorization: Bearer $MINIDESK_MCP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "list_oldest_unanswered",
      "arguments": { "limit": 5 }
    }
  }'
```

Das Ergebnis sind MCP-Content-Blöcke. Die Tool-Ausgabe ist JSON innerhalb
eines Textblocks, das ist die interoperable Form: Jeder Client kann sie
lesen, und strukturierte Blöcke sind noch nicht breit unterstützt.

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      { "type": "text", "text": "{\n  \"as_of\": \"2026-08-28T14:22:10Z\",\n  \"data\": []\n}" }
    ],
    "isError": false
  }
}
```

Ein Ergebnis zu lesen heißt also, `result.content[0].text` als JSON zu
parsen.

## Fehler

Zwei Schichten, und sie sehen verschieden aus.

**Protokollfehler** kommen als JSON-RPC-Fehler zurück:

| Code | Bedeutung |
| - | - |
| `-32600` | Die Anfrage war kein gültiges JSON-RPC |
| `-32601` | Unbekannte Methode |

**Tool-Fehler** sind eine erfolgreiche JSON-RPC-Antwort mit
`isError: true`, und der Textblock hält `{ "error": "..." }`. Ein
unbekannter Tool-Name ist so einer statt eines stillen No-Ops, weil ein
Client, der glaubt, einen Entwurf abgelegt und ein stilles Erfolgt bekommen
zu haben, das schlechteste verfügbare Ergebnis ist.

**Transportfehler** sind normales HTTP. Ein `401` heißt, das Credential
fehlt, ist falsch geformt, ist widerrufen oder ist ein API-Token statt einem
MCP-Token. Ein `429` heißt, Sie über dem [Rate-Limit](https://docs.minidesk.ai/guides/rate-limits.md)
sind, und `Retry-After` sagt, wann Sie wiederkommen sollen.

## Ein minimaler Client

```js theme={null}
async function callTool(name, args = {}) {
  const response = await fetch("https://api.minidesk.ai/mcp", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.MINIDESK_MCP_TOKEN}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      jsonrpc: "2.0",
      id: Date.now(),
      method: "tools/call",
      params: { name, arguments: args },
    }),
  });

  if (!response.ok) throw new Error(`HTTP ${response.status}`);

  const { result, error } = await response.json();

  if (error) throw new Error(error.message);

  return JSON.parse(result.content[0].text);
}

const summary = await callTool("get_support_summary");
```

## Das offizielle SDK verwenden

Jedes MCP-SDK, das Streamable HTTP spricht, funktioniert. Richten Sie es auf
den Endpunkt und übergeben Sie den Header.

```js 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://api.minidesk.ai/mcp"),
  {
    requestInit: {
      headers: { Authorization: `Bearer ${process.env.MINIDESK_MCP_TOKEN}` },
    },
  },
);

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

const { tools } = await client.listTools();
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.