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

# Connect an agent

> Set up the Tashvi API (https://mcp.tashvi.ai/mcp) in Claude Code, Claude Desktop, claude.ai, Cursor, Codex, ChatGPT or any MCP client, with raw curl examples for initialize, tools/list and tools/call.

Every app connects to the same URL with the same key:

* **URL:** `https://mcp.tashvi.ai/mcp`
* **Transport:** Streamable HTTP
* **Header:** `Authorization: Bearer $TASHVI_API_KEY`

## Before you start

1. Make a key at [console.tashvi.ai/keys](https://console.tashvi.ai/keys) and buy credits at [console.tashvi.ai/credits](https://console.tashvi.ai/credits). See the [quickstart](https://docs.tashvi.ai/api/overview.md#quickstart).

2. Put the key in an environment variable, in the shell or profile your app starts from:

   ```bash theme={null}
   export TASHVI_API_KEY=tsk_live_…
   ```

3. Give tool calls at least 240 seconds. A design takes 20 to 90 seconds, and a film or a 3D job waits up to about 3 minutes in one call. The examples below set 330 seconds where the app allows it.

## Claude Code

Add the server for every project:

```bash theme={null}
claude mcp add -s user -t http tashvi https://mcp.tashvi.ai/mcp \
  -H "Authorization: Bearer $TASHVI_API_KEY"
```

This writes the key itself into Claude Code's config. To keep it in the environment instead, put this in a project's `.mcp.json`. Claude Code reads `${TASHVI_API_KEY}` when it starts:

```json .mcp.json theme={null}
{
  "mcpServers": {
    "tashvi": {
      "type": "http",
      "url": "https://mcp.tashvi.ai/mcp",
      "headers": { "Authorization": "Bearer ${TASHVI_API_KEY}" },
      "timeout": 330000
    }
  }
}
```

Run `/mcp` in Claude Code to check that `tashvi` is connected.

## Claude Desktop

Claude Desktop's own connectors use sign-in (see [claude.ai](#claudeai) below). To connect with a key today, use the `mcp-remote` bridge, which needs [Node.js](https://nodejs.org).

**1. Open the config**

In Claude Desktop, go to **Settings → Developer → Edit Config**.

**2. Add Tashvi**

Paste this, with your key in place of the placeholder:

```json claude_desktop_config.json theme={null}
{
  "mcpServers": {
    "tashvi": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote@latest",
        "https://mcp.tashvi.ai/mcp",
        "--transport", "http-only",
        "--header", "Authorization:${AUTH_HEADER}"
      ],
      "env": { "AUTH_HEADER": "Bearer tsk_live_PASTE_YOUR_KEY_HERE" }
    }
  }
}
```

The key goes in `env`, not in `args`: Claude Desktop doesn't escape the space in `Bearer tsk_…` when it passes an argument.

**3. Restart Claude Desktop**

Quit and reopen it. Tashvi's tools are then available in new chats.

## claude.ai

claude.ai connects by sign-in, not with a key. Sign-in is rolling out, so it may not be on for your account yet.

**1. Add the connector**

In claude.ai, go to **Settings → Connectors → Add custom connector**, and enter `https://mcp.tashvi.ai/mcp`.

**2. Connect**

Press **Connect**, sign in to Tashvi, and press **Allow**.

The connector also works in Claude Desktop and the Claude mobile apps on the same account. You can disconnect it in the studio under **Settings → Connected AI apps**.

## Cursor

Add Tashvi to `~/.cursor/mcp.json`:

```json ~/.cursor/mcp.json theme={null}
{
  "mcpServers": {
    "tashvi": {
      "url": "https://mcp.tashvi.ai/mcp",
      "headers": { "Authorization": "Bearer ${env:TASHVI_API_KEY}" }
    }
  }
}
```

If Cursor can't see the variable (it was opened from the dock, not a shell), put the key in the file instead.

## Codex

```bash theme={null}
codex mcp add tashvi --url https://mcp.tashvi.ai/mcp --bearer-token-env-var TASHVI_API_KEY
```

Or add it to `~/.codex/config.toml`. The key stays in the environment either way:

```toml ~/.codex/config.toml theme={null}
[mcp_servers.tashvi]
url = "https://mcp.tashvi.ai/mcp"
bearer_token_env_var = "TASHVI_API_KEY"
startup_timeout_sec = 30
tool_timeout_sec = 330
```

## ChatGPT

ChatGPT connects by sign-in, like claude.ai, and can't send a key. Sign-in is rolling out, so it may not be on for your account yet.

In ChatGPT's settings, turn on developer mode for apps and connectors, create a connector with the URL `https://mcp.tashvi.ai/mcp` and OAuth sign-in, then sign in to Tashvi and press **Allow**.

## Gemini CLI

```bash theme={null}
gemini mcp add -s user -t http tashvi https://mcp.tashvi.ai/mcp \
  -H "Authorization: Bearer $TASHVI_API_KEY"
```

## Any other MCP client

Give it the URL, the Streamable HTTP transport and the header above. That covers Windsurf, Cline, Zed, VS Code and most other hosts that take a remote server with a header.

A client that can only start local (stdio) servers can use the same `mcp-remote` bridge as [Claude Desktop](#claude-desktop).

## Raw HTTP with curl

Every message is one `POST` of a JSON-RPC 2.0 object, and every answer is one JSON object. There's no session to keep, no server-sent event stream, and no batching (send one message per request).

### 1. Initialize

```bash theme={null}
curl -sS https://mcp.tashvi.ai/mcp \
  -H "Authorization: Bearer $TASHVI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{
        "protocolVersion":"2025-06-18","capabilities":{},
        "clientInfo":{"name":"my-script","version":"1.0"}}}'
```

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2025-06-18",
    "capabilities": { "tools": { "listChanged": false }, "resources": { "subscribe": false, "listChanged": false }, "prompts": { "listChanged": false }, "logging": {} },
    "serverInfo": { "name": "tashvi", "title": "Tashvi", "version": "…" },
    "instructions": "Tashvi is a jeweller's AI studio, and seven tools do its work. …"
  }
}
```

Tashvi speaks protocol versions `2024-11-05`, `2025-03-26`, `2025-06-18`, `2025-11-25` and the stateless `2026-07-28`. Ask for one of those and you get it; ask for another and you get `2025-06-18`. A client may then send `notifications/initialized`; it's accepted with `202` and no body.

### 2. List the tools

```bash theme={null}
curl -sS https://mcp.tashvi.ai/mcp \
  -H "Authorization: Bearer $TASHVI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
```

The answer is `result.tools`: each tool's `name`, `title`, `description`, `inputSchema` and `annotations`. Only the tools your key's scopes allow are listed.

### 3. Call a tool

Start with a free call. This one reads the account:

```bash theme={null}
curl -sS https://mcp.tashvi.ai/mcp \
  -H "Authorization: Bearer $TASHVI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{
        "name":"tashvi_library","arguments":{"what":"account"}}}'
```

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [{ "type": "text", "text": "Your plan: pro. Credits: ok." }],
    "structuredContent": { "what": "account", "plan": "pro", "status": "ok" }
  }
}
```

Then a design. This one spends credits ([see prices](https://docs.tashvi.ai/api/pricing.md)) and takes 20 to 90 seconds, so give `curl` a long timeout:

```bash theme={null}
curl -sS --max-time 300 https://mcp.tashvi.ai/mcp \
  -H "Authorization: Bearer $TASHVI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{
        "name":"tashvi_design",
        "arguments":{"request":"An 18k rose gold three-stone ring with oval sapphires"}}}'
```

The result's text has one line per design, `Design 1 (designId …): https://tashvi.ai/d/…`, and the `sessionId` of the design conversation. Send that `sessionId` back with the next request ("make the band thinner") to keep editing the same piece. The result also carries one picture of the design. See [tashvi\_design](https://docs.tashvi.ai/api/tools.md#design-jewelry) for the full shape.

A tool that fails still answers `200` with a JSON-RPC result: `isError` is `true` and `structuredContent` has `error` (a sentence) and `code`. Problems with the key or the request itself come back as HTTP errors. Both are listed in [Errors and limits](https://docs.tashvi.ai/api/errors-and-limits.md).


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