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

# Call Server

> Make a JSON-RPC call to an MCP server

# Call Server

Make a generic JSON-RPC call to an MCP server. This endpoint handles:

* Server URL lookup
* Transport abstraction (SSE responses are buffered to JSON)
* Error normalization

## Request

```bash theme={null}
curl -X POST https://api.mcprank.com/v1/mcp/call \
  -H "X-API-Key: sk_mcp_rank_..." \
  -H "Content-Type: application/json" \
  -d '{
    "server_id": "ai.exa/exa",
    "method": "tools/list"
  }'
```

### Headers

<ParamField header="X-API-Key" type="string" required>
  Your MCP Rank API key
</ParamField>

### Body Parameters

<ParamField body="server_id" type="string" required>
  The MCP Rank server ID (e.g., `ai.exa/exa`)
</ParamField>

<ParamField body="method" type="string" required>
  JSON-RPC method name (e.g., `tools/list`, `tools/call`, `resources/list`)
</ParamField>

<ParamField body="params" type="object">
  Method parameters (optional, depends on method)
</ParamField>

<ParamField body="id" type="string | number">
  JSON-RPC request ID (default: 1)
</ParamField>

## Response

Standard JSON-RPC 2.0 response:

<ResponseField name="jsonrpc" type="string">
  Always "2.0"
</ResponseField>

<ResponseField name="id" type="string | number">
  Request ID from the request
</ResponseField>

<ResponseField name="result" type="any">
  Method result (on success)
</ResponseField>

<ResponseField name="error" type="object">
  Error object (on failure) with `code` and `message`
</ResponseField>

<RequestExample>
  ```bash List Tools theme={null}
  curl -X POST https://api.mcprank.com/v1/mcp/call \
    -H "X-API-Key: sk_mcp_rank_..." \
    -H "Content-Type: application/json" \
    -d '{
      "server_id": "ai.exa/exa",
      "method": "tools/list"
    }'
  ```

  ```bash Call a Tool theme={null}
  curl -X POST https://api.mcprank.com/v1/mcp/call \
    -H "X-API-Key: sk_mcp_rank_..." \
    -H "Content-Type: application/json" \
    -d '{
      "server_id": "ai.exa/exa",
      "method": "tools/call",
      "params": {
        "name": "web_search",
        "arguments": {"query": "latest AI news"}
      }
    }'
  ```

  ```python Python theme={null}
  import httpx

  async with httpx.AsyncClient() as client:
      response = await client.post(
          "https://api.mcprank.com/v1/mcp/call",
          headers={"X-API-Key": "sk_mcp_rank_..."},
          json={
              "server_id": "ai.exa/exa",
              "method": "tools/call",
              "params": {
                  "name": "web_search",
                  "arguments": {"query": "latest AI news"}
              }
          }
      )
      result = response.json()
      print(result["result"])
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
      "content": [
        {
          "type": "text",
          "text": "Here are the latest AI news..."
        }
      ]
    }
  }
  ```

  ```json Error theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
      "code": -32000,
      "message": "Request to MCP server timed out"
    }
  }
  ```
</ResponseExample>

## Common Methods

| Method           | Description              |
| ---------------- | ------------------------ |
| `tools/list`     | List available tools     |
| `tools/call`     | Execute a tool           |
| `resources/list` | List available resources |
| `resources/read` | Read a resource          |
| `prompts/list`   | List available prompts   |
| `prompts/get`    | Get a prompt             |

## Error Codes

| Code   | Meaning                                         |
| ------ | ----------------------------------------------- |
| -32700 | Parse error - invalid JSON                      |
| -32600 | Invalid request                                 |
| -32601 | Method not found                                |
| -32602 | Invalid params                                  |
| -32603 | Internal error                                  |
| -32000 | Server error (timeout, connection failed, etc.) |

## Error Responses

| Status Code | Description                |
| ----------- | -------------------------- |
| 401         | Missing or invalid API key |
| 404         | Server not found           |
| 410         | Server is no longer active |
| 429         | Rate limit exceeded        |
