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

# How to Connect

> Connect your AI agent to Jinko in under 2 minutes.

Connect your AI agent to Jinko in under 2 minutes.

One URL and your agent can search flights and hotels, compare prices, and book travel. Flights and hotels share the same trip.

<Note>
  **Production vs sandbox.** The URLs below are **production**. To test the full flow without touching prod data, use the **sandbox** environment. It uses **separate API keys** ([Sandbox keys](/authentication/api-keys#sandbox-keys)):

  | Surface    | Production                             | Sandbox                                        |
  | ---------- | -------------------------------------- | ---------------------------------------------- |
  | MCP        | `https://mcp.builders.gojinko.com/mcp` | `https://mcp.builders.sandbox.gojinko.com/mcp` |
  | REST / SDK | `https://api.gojinko.com`              | `https://api.sandbox.gojinko.com`              |
  | CLI        | default                                | add `--env sandbox`                            |
</Note>

## Connect via MCP OAuth

MCP clients that support OAuth with Dynamic Client Registration (DCR) authenticate automatically. Just provide the endpoint, the client handles discovery, registration, and the browser-based sign-in flow (OAuth 2.1 with PKCE). No configuration needed.

Supported clients: **Claude Desktop**, **Claude Code**, **ChatGPT**, **Cursor**, and any MCP client with OAuth/DCR support.

### Claude Desktop / Claude Web

Go to **Settings > Connectors > Add custom connector**:

| Field | Value                                  |
| ----- | -------------------------------------- |
| Name  | `Jinko Travel`                         |
| URL   | `https://mcp.builders.gojinko.com/mcp` |

Leave OAuth fields empty, Claude handles the auth flow automatically. You'll sign in with your Jinko account on first use.

### Claude Code

```bash theme={null}
claude mcp add --transport http jinko https://mcp.builders.gojinko.com/mcp
```

OAuth will open a browser window for sign-in on first use.

### Cursor

Go to **Settings > MCP Servers > Add Server**:

```json theme={null}
{
  "mcpServers": {
    "jinko": {
      "url": "https://mcp.builders.gojinko.com/mcp"
    }
  }
}
```

### CLI

The CLI uses its own OAuth flow (device authorization via Jinko Auth), this is separate from MCP OAuth.

```bash theme={null}
npm install -g @gojinko/cli
jinko auth login
# → select "OAuth, sign in with browser"
```

The CLI displays a URL and code. Open it in any browser (works over SSH too), approve, and you're authenticated. Tokens are stored locally and refreshed automatically.

<Note>
  CLI tokens cannot be reused as Bearer tokens on the MCP endpoint, they have different issuers. Use an API key (`jnk_*`) for programmatic MCP access.
</Note>

## Connect via API Key

For agents, scripts, CI/CD, or any environment without MCP OAuth support.

<Steps>
  <Step title="Get your key">
    Sign in at [the Jinko dashboard](https://dashboard.gojinko.com/developers/keys), your key starts with `jnk_` and gives you 1,000 requests per month.
  </Step>

  <Step title="Configure your client">
    <Tabs>
      <Tab title="Claude Code">
        ```bash theme={null}
        claude mcp add --transport http jinko https://mcp.builders.gojinko.com/mcp --header "Authorization: Bearer jnk_your_key"
        ```
      </Tab>

      <Tab title="Cursor">
        ```json theme={null}
        {
          "jinko": {
            "transport": "streamable-http",
            "url": "https://mcp.builders.gojinko.com/mcp",
            "headers": {
              "Authorization": "Bearer jnk_your_key"
            }
          }
        }
        ```
      </Tab>

      <Tab title="Codex">
        ```toml theme={null}
        # ~/.codex/config.toml
        [mcp_servers.jinko]
        url = "https://mcp.builders.gojinko.com/mcp"
        bearer_token_env_var = "JINKO_API_KEY"
        ```

        ```bash theme={null}
        export JINKO_API_KEY=jnk_your_key
        ```
      </Tab>

      <Tab title="Openclaw">
        ```json theme={null}
        // ~/.openclaw/openclaw.json
        {
          "mcpServers": {
            "jinko": {
              "type": "remote",
              "url": "https://mcp.builders.gojinko.com/mcp",
              "headers": {
                "Authorization": "Bearer jnk_your_key"
              }
            }
          }
        }
        ```
      </Tab>

      <Tab title="CLI">
        ```bash theme={null}
        jinko auth login --key jnk_your_key
        # Or via environment variable (no login needed)
        export JINKO_API_KEY=jnk_your_key
        ```
      </Tab>

      <Tab title="Other MCP clients">
        Connect to `https://mcp.builders.gojinko.com/mcp` with the `Authorization: Bearer jnk_your_key` header.
      </Tab>
    </Tabs>
  </Step>
</Steps>

## Try it

Ask your agent:

> "Find me a flight from Paris to Barcelona next weekend"

Or try these:

* *"What are the cheapest destinations from London in June?"*
* *"Search direct flights from JFK to LAX on May 15"*
* *"Find roundtrip flights from CDG to NRT, 7 day trip in July"*
* *"Find a 4-star hotel in Barcelona for July 15-18 for 2 adults"*
* *"Build me a Paris weekend: flight from JFK and a hotel near the Louvre"* (multi-domain trip, one checkout)

## Build a booking flow

For full step-by-step walkthroughs with side-by-side **MCP / SDK / CLI** variants, see the [Flight booking guide](/guides/flight-booking), the [Hotel booking guide](/guides/hotel-booking), or the combined [Flight + Hotel guide](/guides/flight-hotel-booking) for a single trip with two items.

## Tips for best results

* **Use real traveler data**, never fabricate names, dates of birth, or passport details
* **Airport codes first**, use IATA airport codes like `CDG`, `JFK`, or `NRT`
* **Roundtrip searches** return both legs in a single offer, no need to search separately
* **JSON format** gives your agent structured data, including the `trip_item_token`

## Need help?

* [Dashboard](https://dashboard.gojinko.com), manage keys and check usage
* [MCP tools reference](/tools/find-destination), all tools, parameters, and response formats
* [CLI reference](/connect/cli), every command with usage and examples
