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

# Agent connection troubleshooting

> Fix sign-in, access, and query errors when an MCP assistant cannot reach SourceMedium.

Use this page when your own agent cannot connect to SourceMedium, or a connection that used to work has stopped. For Slack, see [SourceMedium Agent troubleshooting](/docs/ai-analyst/troubleshooting).

The connection URL is `https://mcp.sourcemedium.com/mcp`. The path `/mcp` is required.

<Tip>
  Once you are connected, ask the assistant **"are my connections working?"**. That uses `get_account_health`, which reports each connection's status, data freshness, and whether the fix belongs to you, your provider, or SourceMedium.
</Tip>

## If connecting fails

Sign-in has to finish, including the approval step, before the assistant can call SourceMedium. When it stops earlier, the assistant reports an authorization failure of its own. SourceMedium has no `request_id` for that, because no login arrived. Match what you see below before you remove anything.

| What you see | What it means | What to do |
| - | - | - |
| Claude says **Authorization with the MCP server failed**, often with a reference like `ofid_…` | Claude stopped before sign-in finished. The `ofid_` value is Claude's reference, for Claude support. It is not a SourceMedium `request_id`. | In **Customize → Connectors**, remove SourceMedium. Add a custom connector, paste the URL, click **Connect**, and approve the sign-in. |
| ChatGPT, Codex, Grok Bot, Muse, Hermes, or Cursor errors on Connect or Login, and the SourceMedium sign-in page never opens | The assistant did not finish adding the server. | Delete that plugin or server entry, add the same URL again (or resend the message), and complete sign-in. |
| Claude Code still fails after you remove the server | `claude mcp remove` leaves the saved token. | Run `claude mcp logout sourcemedium`, add the server again, then run `/mcp` and sign in. |
| You signed in with Google, and the assistant still cannot reach SourceMedium | Google signs you in as that Google account's own address. If your invitation went to a different address, such as a work address that forwards to your Gmail, that Google account has no SourceMedium access. | Remove the connector and add it again. On the sign-in page, type the exact address your invitation went to instead of choosing Google, and use the emailed code. |
| You get an email titled **No SourceMedium account for this address** | You tried to sign in with an address that has no SourceMedium account. | Sign in with the exact address your invitation went to. If that address forwards to this inbox, type it on the sign-in page: the code still arrives here. Reply to that email if you need access. |
| You were connected, and a later question returns 401 or **invalid access token** | The saved token expired or was refused. | Sign in again from the assistant. If it still refuses, remove the connection and add it again. In Claude Code, run `claude mcp logout sourcemedium` before you add it. |
| 403 `ACCESS_DENIED` | This account cannot use the organization that was selected, or the organization is inactive. Adding the connector again does not grant access. | Use the membership email. If the organization picker does not appear, open a private window and connect again. If access is still denied, send support the `request_id`. |
| SourceMedium is missing under **Your own agent** on the AI Agents page | Only a successful signed-in request creates that row. | Finish sign-in and ask one question. |
| The assistant answers for the wrong SourceMedium organization | The saved grant is for the other workspace. Signing out inside the assistant keeps that choice. | Open a private window, connect again, and pick the organization. In Claude Code, run `claude mcp logout sourcemedium` first so the old token is gone. Removing the server entry on its own often leaves that token in place. |

There is no disconnect button inside SourceMedium. Stop an assistant by signing out of the connection there. An Admin can also pause the organization, which blocks every assistant at once.

## If it still fails

Remove the connector, plugin, or server completely and add it one more time with the same URL. Sign in and approve once. For Claude Code, run `claude mcp logout sourcemedium` before you add it again.

Then [open a support request](/docs/product-tours/get-support). Include the assistant's error text, any `ofid_` reference Claude showed, and any `request_id` from a SourceMedium error.

## Source and query errors

| Code | Meaning |
| - | - |
| `SOURCE_UNAVAILABLE` | That source is not connected to SourceMedium. Connect the store or ad account in your workspace; warehouse tools still work. |
| `REAUTH_REQUIRED` | Reconnect Shopify or Meta in the [workspace](/docs/product-tours/reconnect-data-source). |
| `SOURCE_REQUIRED` | More than one source matches. Pick a source from the options the tool returned. |
| `SOURCE_NOT_FOUND` | That source handle is not available to this organization. Call `get_data_context` again. |
| `INVALID_REQUEST` | The tool was called with arguments it could not accept, or its SQL failed when it ran (a bad cast, a division by zero). Usually the assistant's mistake, not yours. Ask it to fix the query, or to call `get_data_context` and retry. Resending the same SQL fails the same way. |
| `QUERY_NOT_READ_ONLY` | The SQL is a write. Use a single `SELECT`. |
| `QUERY_SCOPE_DENIED` | The SQL left the datasets `get_data_context` lists, a store-scoped agency grant tried `run_bigquery_sql`, or the table is an external file that is not a Google Sheet. Use `query_metrics`, or stay inside those datasets. |
| `QUERY_TOO_EXPENSIVE` | Narrow the date range or aggregate. The billed-bytes cap is 10 GiB. |
| `QUERY_TIMEOUT` | The query ran longer than 60 seconds. Do not retry the same unbounded query. |
| `RESULT_TOO_LARGE` or `truncated: true` | Narrow the query. Warehouse results cap at 500 rows. |
| `RATE_LIMITED` | You have hit your own request allowance. Wait, then retry. |
| `PROVIDER_RATE_LIMITED` | Shopify or Meta throttled the request. Wait, then retry. |
| `PROVIDER_PERMISSION_DENIED` | Shopify or Meta refused the request, or BigQuery could not open a Google Sheet. For a sheet, the error links the sheet and gives the address SourceMedium opens sheets as. Ask the sheet's owner to share it with that address as a Viewer, then retry. See [Google Sheets tables](/docs/ai-analyst/connect-an-ai-assistant#google-sheets-tables). For Shopify or Meta, check what that account can see in the provider. |
| `PROVIDER_ERROR` | Shopify or Meta failed. Usually transient, so retry once. |
| `INTERNAL_ERROR` | Retry once. If it persists, send support the `request_id`. |

## Shopify and Meta

There is no approval step for Shopify or Meta. If the store or ad account is connected in your SourceMedium workspace, the assistant can read it. If a provider tool answers `SOURCE_UNAVAILABLE`, the source is not connected yet; if it answers `REAUTH_REQUIRED`, [reconnect it](/docs/product-tours/reconnect-data-source). Warehouse questions work either way.

## Related

<CardGroup cols={2}>
  <Card title="Connect your own agent" icon="plug" href="/docs/ai-analyst/connect-an-ai-assistant">
    Connection URL, OAuth, and what the assistant can reach.
  </Card>

  <Card title="MCP tool reference" icon="screwdriver-wrench" href="/docs/ai-analyst/mcp-tools">
    Which tool the assistant should have used, and what each error means it tried.
  </Card>

  <Card title="Connection statuses" icon="heart-pulse" href="/docs/product-tours/connection-statuses">
    Check Shopify or Meta in the workspace before retrying a live-provider tool.
  </Card>
</CardGroup>


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