---
title: "Client Configuration"
description: "Copy-paste MCP config for opencode, Codex, Claude, Cursor, VS Code, and custom clients."
canonical_url: "https://scholarxiv.com/developers/docs/mcp/clients"
markdown_url: "https://scholarxiv.com/developers/docs/mcp/clients.md"
---

# Client Configuration
URL: /developers/docs/mcp/clients
LLM index: /llms.txt
Description: Copy-paste MCP config for opencode, Codex, Claude, Cursor, VS Code, and custom clients.
Related: mcp, mcp/quickstart, mcp/connect

# Client Configuration

Add the ScholarXIV MCP server to your client with these configs.

Replace `sxv_your_api_key_here` with your actual API key from the [Developer Dashboard](/developers/dashboard/apikeys).

<Tabs items={["opencode", "Codex", "Claude Code", "Claude Desktop", "Cursor", "VS Code"]}>
<Tab value="opencode">

Add to `opencode.json` in your project root:

```json title="opencode.json"
{
  "mcp": {
    "scholarxiv": {
      "type": "remote",
      "url": "https://www.scholarxiv.com/api/mcp",
      "headers": {
        "Authorization": "Bearer sxv_your_api_key_here"
      }
    }
  }
}
```

</Tab>
<Tab value="Codex">

Add to `~/.codex/config.toml` (global) or `.codex/config.toml` (project):

```toml title="config.toml"
[mcp_servers.scholarxiv]
url = "https://www.scholarxiv.com/api/mcp"
bearer_token_env_var = "SCHOLARXIV_API_KEY"
```

Set the environment variable:

```bash title=".env"
export SCHOLARXIV_API_KEY=sxv_your_api_key_here
```

Or add via CLI:

```bash title="terminal"
codex mcp add scholarxiv --url https://www.scholarxiv.com/api/mcp --bearer-token-env-var SCHOLARXIV_API_KEY
```

</Tab>
<Tab value="Claude Code">

```bash title="terminal"
claude mcp add --transport http scholarxiv https://www.scholarxiv.com/api/mcp \
  --header "Authorization: Bearer sxv_your_api_key_here"
```

</Tab>
<Tab value="Claude Desktop">

**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

```json title="claude_desktop_config.json"
{
  "mcpServers": {
    "scholarxiv": {
      "url": "https://www.scholarxiv.com/api/mcp",
      "headers": {
        "Authorization": "Bearer sxv_your_api_key_here"
      }
    }
  }
}
```

Restart Claude Desktop after editing.

</Tab>
<Tab value="Cursor">

Add to your project's `.cursor/mcp.json` or global settings:

```json title="mcp.json"
{
  "mcp": {
    "scholarxiv": {
      "type": "url",
      "url": "https://www.scholarxiv.com/api/mcp",
      "headers": {
        "Authorization": "Bearer sxv_your_api_key_here"
      }
    }
  }
}
```

</Tab>
<Tab value="VS Code">

Add to `.vscode/mcp.json` in your workspace:

```json title="mcp.json"
{
  "servers": {
    "scholarxiv": {
      "type": "http",
      "url": "https://www.scholarxiv.com/api/mcp",
      "headers": {
        "Authorization": "Bearer sxv_your_api_key_here"
      }
    }
  }
}
```

</Tab>
</Tabs>

## Custom Client (TypeScript)

Using `@modelcontextprotocol/sdk`:

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

const client = new Client({ name: 'my-app', version: '1.0.0' });

const transport = new StreamableHTTPClientTransport(
  new URL('https://www.scholarxiv.com/api/mcp'),
  {
    requestInit: {
      headers: {
        'Authorization': 'Bearer sxv_your_api_key_here'
      }
    }
  }
);

await client.connect(transport);

// List available tools
const tools = await client.listTools();

// Call a tool
const result = await client.callTool({
  name: 'search_papers',
  arguments: { query: 'protein folding', limit: 5 }
});
```

## Direct HTTP (curl)

Test the endpoint directly:

```bash title="test.sh"
curl -X POST https://www.scholarxiv.com/api/mcp \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sxv_your_api_key_here" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list",
    "params": {}
  }'
```

## Troubleshooting

| Problem | Solution |
|---------|----------|
| Tools not appearing | Restart the client after config changes |
| "Invalid API key" | Verify key starts with `sxv_` and isn't expired |
| Connection refused | Check the URL is `https://www.scholarxiv.com/api/mcp` |
| Config not loading | Validate JSON/TOML (no trailing commas, correct escaping) |
| Rate limited | Wait for hourly window reset or upgrade plan |

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
