KlyHub Docs
Troubleshooting

MCP connection lost or token expired

Your AI client lost its connection to KlyHub — here's how to reconnect.

MCP connection lost or token expired

Your AI client lost its connection to KlyHub. This is almost always an expired access token, and reconnecting takes about a minute. This page walks you through it.

What you'll see

When an access token expires, the symptoms look like one of these:

  • Your AI client shows repeated "Authorization required" prompts, or asks you to sign in again in a loop.
  • A tool call that worked yesterday now returns an authorization error instead of data.
  • The klyhub server appears in the tools list but every call fails.

None of this means your data is gone or your account is at risk. The token your AI client uses to call KlyHub simply has a limited lifetime, and the one it's holding has run out.

Why this happens

KlyHub issues short-lived access tokens to MCP clients for security — a leaked token can only be used for a limited window. When a token expires, the KlyHub MCP server replies with an HTTP 401 response carrying a WWW-Authenticate header. That header is the standard way an OAuth-protected server tells a client "your token is no longer valid — get a new one."

A well-behaved MCP client reads the WWW-Authenticate hint and refreshes its token automatically. In practice, some AI clients do not yet persist or refresh their tokens reliably, so the refresh quietly fails and you see the "Authorization required" loop instead. When that happens, the fix is to reconnect manually.

How to reconnect

The reconnect flow clears the stale token and issues a fresh one:

  1. Open your KlyHub workspace and go to Settings → MCP clients.
  2. Find the client that lost its connection (for example, Claude Desktop) and click Disconnect.
  3. Click Connect again for that same client.
  4. Approve the OAuth scopes on accounts.klyhub.com — the same consent screen you saw during first setup.
  5. KlyHub shows you a fresh config snippet. If your client's config URL is unchanged, you usually don't need to edit anything — but if KlyHub gives you a new snippet, paste it in.
  6. Fully restart your AI client so it picks up the new token.

After the restart, run a quick query to confirm the connection is back:

"Using the klyhub tools, list the three most recently updated entries in my Market layer."

If you get a normal answer, you're reconnected.

Still not working?

If reconnecting did not fix it, check these:

  • Wrong URL — confirm the config URL matches mcp.klyhub.com/v1/<your-slug> exactly, including HTTPS and the /v1/ prefix.
  • Every call returns 403, not 401 — a 403 is different from the WWW-Authenticate 401 described above. It usually means your tenant is in read-only state (failed billing or scheduled deletion). Check the banner at the top of your KlyHub workspace.
  • Client never shows the tools — see the Connect Claude Desktop guide to re-verify the config file path and JSON shape.

If none of that helps, email us at support@klyhub.com and include the name of your AI client and roughly when the connection stopped working.

MCP connection lost or token expired · KlyHub