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

# Connect an agent

> Point Cursor, Claude, ChatGPT, or any MCP client at your Mora organization.

Most MCP clients only need the endpoint URL. They discover that Mora requires authorization, open a browser for you to sign in, and store the resulting token themselves, so there is no key to copy or rotate.

```
https://api.mora.com/api/mcp
```

<Note>
  You can copy the URL from **Settings → API & MCP → Connect your agent**.
</Note>

## What happens when you connect

1. You add the URL to your MCP client.
2. The client opens your browser and asks you to sign in to Mora (if you aren't already).
3. If you belong to more than one organization, Mora asks you to **Choose an organization** for the agent to work in.
4. You review the request and click **Authorize**. The authorization screen has an organization switcher if you want to change your pick.
5. The client stores the token and refreshes it on its own. Mora's tools appear in the agent's tool list.

<Info>
  The token is bound to the organization you selected. To point the agent at a different organization, reconnect and choose the other one, see [Switching organizations](#switching-organizations).
</Info>

## Cursor

Add Mora to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` in a project:

```json theme={null}
{
  "mcpServers": {
    "mora": {
      "url": "https://api.mora.com/api/mcp"
    }
  }
}
```

Save the file, then open **Cursor Settings → Tools & MCP**. Mora appears with a **Needs authentication** label, click **Connect** and complete the sign-in in your browser.

## Claude Code

```bash theme={null}
claude mcp add --transport http mora https://api.mora.com/api/mcp
```

Then start a session and run `/mcp` to complete the browser sign-in. Add `--scope user` to make the server available in every project.

## Claude desktop & web

In Claude's settings, open **Connectors**, add a custom connector, and paste the URL above. Claude will walk you through the Mora sign-in and consent screens.

## ChatGPT

In ChatGPT's settings, open **Connectors** and add the URL above as a custom MCP connector. Availability depends on your ChatGPT plan.

## Any other client

Mora implements the standard MCP authorization spec (OAuth 2.1 with PKCE and dynamic client registration) over Streamable HTTP. Any compliant client works with just the URL. For clients that cannot sign in through a browser, use an [API key](/mcp/api-keys) instead.

## Verify the connection

Ask your agent something that requires Mora, for example:

> List the datasources in my Mora organization.

It should call `list_datasources` and return the datasources you see under **Settings → Datasources**. From there, try:

> Search the Mora catalog for tables about orders, then run a query counting orders per month.

## Switching organizations

Access is granted per organization. To move an agent from one organization to another:

1. Disconnect or remove the Mora server in your MCP client (this discards the stored token).
2. Add it again and start the sign-in.
3. On the authorization screen, use the organization switcher to select the organization you want, then click **Authorize**.

You can also connect the same client twice under different names if you need two organizations at once, each connection holds its own token.

## Troubleshooting

<AccordionGroup>
  <Accordion title="The client asks for a client ID and secret">
    Leave them blank. Mora registers clients automatically. If the client requires values, it may not support dynamic registration, use an [API key](/mcp/api-keys) instead.
  </Accordion>

  <Accordion title="The tools appear but every call fails with an authorization error">
    Your access was revoked or the token was issued for an organization you are no longer a member of. Reconnect and sign in again. If you were removed from the organization, ask an owner or admin to re-invite you.
  </Accordion>

  <Accordion title="The agent is looking at the wrong organization">
    The token is bound to the organization chosen at sign-in. Reconnect and pick the right one on the authorization screen. See [Switching organizations](#switching-organizations).
  </Accordion>

  <Accordion title="A query comes back as 'still running'">
    The query exceeded the 60-second response budget while the datasource stayed healthy. It keeps running in the background, but the agent won't get rows inline. Narrow it with filters, a smaller date range, or a smaller `LIMIT`.
  </Accordion>

  <Accordion title="Nothing shows up in the client at all">
    Confirm the URL ends in `/api/mcp`, that the entry uses `url` (not a local `command`), and restart the client. Some clients only re-read their config on startup.
  </Accordion>
</AccordionGroup>

## Related

* [MCP overview](/mcp/overview)
* [Tool reference](/mcp/tools)
* [API keys](/mcp/api-keys)
