--- title: "MCP guide: install" description: Create a OneHazel integration key, add the OneHazel MCP server to Codex, Cursor or Claude Code, and paste one line to start connecting your casino. --- # Install the OneHazel MCP This guide is for the person who sets up a coding agent to connect a casino to OneHazel. You do not need to be an engineer. The agent writes the code. You copy, paste and click. ::: tip What you need before you start - A OneHazel account. You sign in at `https://app.onehazel.com`. - One coding agent on your computer: Codex, Cursor or Claude Code. - Your casino's code, or an empty folder for the adapter, on the same computer. - A key with the Connect scope, `mcp_connect_enabled`. Only **Connect casino** > **Integrate with AI** > **Create integration key** makes one. The **API Keys** page lists it with the label `mcp-connect`. The MCP switch on the **API Keys** page is a different setting and cannot add this scope. Step 1 below creates it. - About ten minutes. ::: ## Step 1. Create your integration key 1. Sign in at `https://app.onehazel.com`. 2. In the left sidebar, click **Connect casino**. 3. Click the **Integrate with AI** tab. 4. Click **Create integration key**. 5. Copy the key now. It is shown only once. ::: info What you should see A key that starts with `oh_live_`. Below it, the **Module status** card shows each module as **Not started**. ::: Only this button gives a key the Connect scope. If your agent ever answers with the sentence below, the key lacks that scope. Come back to this step and create a key here: > This key has no Connect scope. Create one in app.onehazel.com under Connect casino, Integrate with AI (the API Keys page cannot add it). Lost the key? Revoke it on the **API Keys** page and create a new one here. Nothing else depends on that exact key. ## Step 2. Put the key where your agent can read it Your agent reads the key from a setting on your computer called an environment variable. Its name is always `ONEHAZEL_API_KEY`. Never paste the key into the agent's chat, a ticket, a message or any file inside your casino's code folder. **On a Mac:** open Terminal. Press Cmd and Space together, type `Terminal`, and press Return. **On Linux:** open your Terminal app from the applications menu. Type this line, with your key in place of `oh_live_your_key_here`, and press Return: ```bash export ONEHAZEL_API_KEY="oh_live_your_key_here" ``` That is enough. The setting lasts until you close that window, so start your agent from the same window. Optional: to keep it for every new window, add the same line to a file in your home folder. On a Mac that file is `~/.zshrc`. On Linux it is usually `~/.bashrc`. **On Windows:** open PowerShell. Click Start, type `PowerShell`, and press Enter. Type this line, with your key in place of `oh_live_your_key_here`, and press Enter: ```powershell setx ONEHAZEL_API_KEY "oh_live_your_key_here" ``` Then close PowerShell and open a new one. The setting only reaches windows opened after it. Now check it worked, without showing the key. On a Mac or Linux: ```bash echo ${#ONEHAZEL_API_KEY} ``` On Windows: ```powershell $env:ONEHAZEL_API_KEY.Length ``` ::: info What you should see The number `72`. That is the length of a OneHazel key. If you see `0` or nothing, the variable is not set in this window. Any other number means the key was not copied in full. Either way, repeat this step. ::: ## Step 3. Add the OneHazel server to your agent The server address is `https://api.onehazel.com/mcp-server`. Pick your agent and follow its page: - [Codex](/connect/mcp/install/codex) - [Cursor](/connect/mcp/install/cursor) - [Claude Code](/connect/mcp/install/claude-code) The **Integrate with AI** tab shows the same setup for each agent, with your new key already filled in. ::: info What you should see Your agent lists a server called `onehazel`, connected, with tools whose names start with `connect_`. ::: ## Step 4. Paste one line Open a new chat in your agent, inside your casino's code folder. Paste exactly this: ```text Connect my casino to OneHazel. Start with connect_status and follow next_step. ``` ::: info What you should see Your agent calls `connect_status`. It reports your operator id and one line per module. Then it says what it will do next. If you have not named a vendor yet, it asks you this: > Which marketplace connector (a key from connect_list_marketplace) should this casino go live with? Reply with the vendor's key, for example `pateplay`. ::: ## Step 5. Keep the instructions in your code (optional) Ask your agent: "Copy the resource onehazel://agents.md into AGENTS.md." For Claude Code, say CLAUDE.md instead. Every future session then starts the same way. In plain words, the file tells your agent to check the status first and keep going until it needs you. Word for word: > Call connect_status first (pass key when your human named the connector), then follow journey.next_step: do not stop while next_step is set, and stop only when journey.blocked_on is set, ask your human its one question, then do what its after_answer says. ::: info What you should see A new or updated `AGENTS.md` or `CLAUDE.md` file in your casino's code folder, with a section called "OneHazel integration". ::: ## Next Follow [the journey](/connect/mcp/journey) from here to your first live game.