Skip to main content

Connecting Qase MCP through a corporate gateway

Connect your team's AI tools to the hosted Qase MCP server through a gateway your company runs, using an OAuth client that your admins own, scope to your organization and can revoke at any time.

​

​

Overview

An MCP gateway is a server your company runs between your people's AI tools and the MCP servers they use. Instead of each person connecting their AI assistant straight to https://mcp.qase.io/mcp, their assistant connects to your gateway, and the gateway connects to Qase on their behalf.

​

Companies use a gateway to:

  • Decide which MCP servers their people's AI tools can reach.

  • Keep each person's Qase token on the gateway, not on their laptop.

  • Log and audit what AI agents do.

​

When a person signs in to Qase through the gateway, Qase sends them back to the gateway's own address, the redirect URI. Qase only sends people back to addresses it trusts. An MCP gateway in Qase is how your admin tells Qase which addresses those are. It is an OAuth client that belongs to your organization only, with its own secret, expiry date and audit trail.

​

This article walks through the setup from start to finish, using LiteLLM as the gateway. It takes four steps:

  1. Create the gateway in Qase.

  2. Add Qase to LiteLLM.

  3. Connect each person's Qase account.

  4. Point your MCP clients at the gateway.

​

It then covers how access works day to day, how to manage the gateway, and how to fix common problems.

​

​

Before you start

You need a Qase admin, a LiteLLM admin, and a public HTTPS address for LiteLLM.

  • Qase plan: the workspace is on a paid plan or its trial. Free, Non-Profit and Open Source workspaces see an upgrade screen.

  • Qase permission: the person creating the gateway has the Manage MCP gateways security permission. The Administrator role has it by default.

  • LiteLLM: a LiteLLM proxy reachable over HTTPS, with its database enabled, and admin access to its UI or API. LiteLLM stores each person's Qase token in that database.

  • Who can connect: active members of your Qase organization. People outside it cannot authorize the gateway.

​

The steps below use these Qase addresses:

​

Purpose

URL

MCP server

https://mcp.qase.io/mcp

Authorization

https://auth.qase.io/oauth/authorize

Token

https://auth.qase.io/oauth/token

Token revocation

https://auth.qase.io/oauth/revoke

​

​

Creating the gateway in Qase

A Qase admin creates the gateway and copies its secret. Qase shows the secret only once.

  1. Decide the LiteLLM public address first, for example https://litellm.example.com. The redirect URI is that address plus /callback, for example https://litellm.example.com/callback.

  2. In Qase, open Workspace settings → MCP gateways → Create gateway.

  3. Enter a Name. People see it on the consent screen and in Connected apps, for example "Acme LiteLLM".

  4. Under Redirect URIs, enter the LiteLLM callback from step 1. To add callbacks for more LiteLLM instances, such as staging, click Add URI. A gateway takes up to 5.

  5. Set Expires. The default is 90 days and the maximum is 1 year. You can extend it later.

  6. Click Create. Copy the secret, or the ready-made LiteLLM snippet shown with it, and store it in your secret manager.

​

If you lose the secret, rotate it. See Managing the gateway below.

​

Redirect URI rules:

  • HTTPS only, with no query string (?…) and no fragment (#…).

  • No localhost and no IP addresses.

  • No Qase domains (qase.io and its subdomains). Host the gateway on your own domain.

​

An organization can have up to 10 active gateways.

​

​

Adding Qase to LiteLLM

A LiteLLM admin registers Qase as an OAuth-protected MCP server, using the values from the previous section.

​

1. Set the public address. Set PROXY_BASE_URL to the public HTTPS address of LiteLLM, for example PROXY_BASE_URL=https://litellm.example.com, and restart LiteLLM. Without it, LiteLLM running behind a load balancer or Cloudflare builds an http:// callback, and Qase rejects it.

​

2. Add the server. Paste the snippet Qase showed you into config.yaml:

mcp_servers:
qase:
url: https://mcp.qase.io/mcp
transport: http
auth_type: oauth2
oauth2_flow: authorization_code
authorization_url: https://auth.qase.io/oauth/authorize
token_url: https://auth.qase.io/oauth/token
client_id: CLIENT_ID_FROM_QASE
client_secret: CLIENT_SECRET_FROM_QASE
upstream_resource: auto

3. Or add it at runtime. Use the LiteLLM API with an admin key instead of config.yaml:

curl -X POST https://litellm.example.com/v1/mcp/server \
-H "Authorization: Bearer $LITELLM_MASTER_KEY" \
-H "Content-Type: application/json" \
-d '{
"server_name": "qase",
"alias": "qase",
"url": "https://mcp.qase.io/mcp",
"transport": "http",
"auth_type": "oauth2",
"oauth2_flow": "authorization_code",
"authorization_url": "https://auth.qase.io/oauth/authorize",
"token_url": "https://auth.qase.io/oauth/token",
"credentials": {
"client_id": "CLIENT_ID_FROM_QASE",
"client_secret": "CLIENT_SECRET_FROM_QASE",
"upstream_resource": "auto"
}
}'

Keep oauth2_flow: authorization_code and upstream_resource: auto. Qase requires the resource parameter on every authorization and token request, and auto makes LiteLLM send the MCP URL as that parameter.

The server name becomes part of the client address and a prefix on tool names. With qase, clients connect to https://litellm.example.com/qase/mcp and see tools such as qase-qase_api.

​

​

Connecting each person's Qase account

Each person connects once in the LiteLLM UI. LiteLLM then keeps a Qase token for that LiteLLM user.

  1. Sign in to the LiteLLM Admin UI.

  2. Open MCP Servers → My Connections (the /ui/connect page) and click Connect next to qase. The server's own page has no Connect button.

  3. Sign in to Qase if asked, review the consent screen with your gateway's name, and approve.

  4. LiteLLM returns to its UI and shows the server as connected.

​

The virtual key that the person's MCP client uses must belong to the same LiteLLM user who clicked Connect. LiteLLM looks up the Qase token by that user.

Connect from the LiteLLM UI, not from your MCP client's own sign-in prompt. In our tests with LiteLLM (October 2026), signing in from the client, for example Claude Code's /mcp → Authenticate, did not save the token in LiteLLM, and the client failed on reconnect. Use Connect in the LiteLLM UI until this is fixed in LiteLLM.

​

​

Pointing MCP clients at the gateway

Clients talk to LiteLLM, not to Qase. They need the LiteLLM address and a LiteLLM virtual key, never the Qase client secret.

  1. Create a virtual key for the person in LiteLLM (Virtual Keys → Create, or POST /key/generate). The key must be owned by the same user who connected in the previous section, with access to the qase MCP server.

  2. Add the server to the client. Any MCP client that supports Streamable HTTP and custom headers works. The address is PROXY_BASE_URL/qase/mcp, and the key goes in the x-litellm-api-key header.

​

Claude Code:

claude mcp add --transport http qase-gw https://litellm.example.com/qase/mcp \
--header "x-litellm-api-key: Bearer sk-YOUR_VIRTUAL_KEY"

The same in a JSON client config:

{
"mcpServers": {
"qase-gw": {
"type": "http",
"url": "https://litellm.example.com/qase/mcp",
"headers": { "x-litellm-api-key": "Bearer sk-YOUR_VIRTUAL_KEY" }
}
}
}

To check it works, ask your assistant to list your Qase projects. It calls a tool such as qase-qase_api and returns the projects of your active workspace.

​

​

How access works day to day

Every call acts as the connected person, in their active Qase workspace, with their own Qase permissions. The gateway gives no one extra access.

  • Active workspace: if a person switches Qase to a workspace of another organization, calls return 403 This gateway is not allowed for the current workspace. Switching back restores access. No reconnect is needed.

  • Token refresh: access tokens last 1 hour. LiteLLM refreshes an expired token on the next call, so people normally see nothing. Occasionally one request at the expiry fails with 401, and the retry succeeds.

  • Leaving the organization: when a person is removed or deactivated in your Qase organization, the gateway stops working for them at their next request or refresh.

  • Connected apps: each person sees the gateway under Profile → Connected apps, labelled Corporate gateway, with the organization, callback host, last token issued and last activity. Disconnect revokes that person's tokens immediately. To use the gateway again, they connect again in the LiteLLM UI.

​

​

Managing the gateway

Every action is in Workspace settings → MCP gateways, in each gateway's menu, and each one is recorded under Workspace → Logs.

​

Action

Available when

Effect on connected people

Rename, edit redirect URIs

Active, Expiring

None. A removed URI stops accepting new sign-ins

Rotate secret

Active, Expiring

Existing connections keep working, but the old secret stops working at once. Update client_secret in LiteLLM right away, or refreshes fail within the hour

Extend

Active, Expiring, Expired

None. Up to 1 year from today. Extending an expired gateway brings it back

Revoke

Active, Expiring

Every token issued through the gateway stops working at once. Cannot be undone; create a new gateway instead

Delete

Revoked, Expired

Removes the gateway from the list

When you update the secret through the LiteLLM API, send client_id and client_secret together in credentials. In our tests, a secret-only update broke the next refresh and everyone had to reconnect.

Status and expiry:

  • Active: more than 14 days left.

  • Expiring: less than 14 days left. Qase emails the workspace owner, the gateway's creator and everyone with Manage MCP gateways, and the page shows a banner.

  • Expired: the expiry date has passed, and Qase revokes the gateway's tokens automatically. Extend it to bring it back.

  • Revoked: an admin revoked it.

​

The Connected column shows how many people have connected through the gateway. Last activity shows the last call made through it.

​

​

Troubleshooting

Most problems come from the redirect URI, an out-of-date secret in LiteLLM, or the person's active workspace.

​

Symptom

Cause

Fix

Redirect URI is not acceptable for a gateway when creating or editing

The URI is not HTTPS, has a query or fragment, points to localhost or an IP, or uses a Qase domain

Use https://YOUR_GATEWAY_DOMAIN/callback

Sign-in fails after consent, and the callback in the address bar starts with http://

PROXY_BASE_URL is not set in LiteLLM

Set it to the public HTTPS address and restart LiteLLM

invalid_target from the token endpoint

The request has no resource parameter

Set upstream_resource: auto on the LiteLLM server

invalid_client from the token endpoint

Wrong client secret, or the secret was rotated

Copy the current secret into LiteLLM, or rotate it and update LiteLLM

403 This gateway is not allowed for the current workspace

The person's active Qase workspace belongs to another organization

Switch back to a workspace of your organization in Qase

One 401 about once an hour, and the next call works

The access token expired and LiteLLM refreshed it after the failure

Retry. Nothing to fix

Every call fails with 401, and the tool may say The access token was rejected: it has expired or was revoked

The token was revoked: the person disconnected, the gateway was revoked or expired, or the secret was rotated and LiteLLM was not updated

Fix the gateway or secret, then reconnect in the LiteLLM UI. LiteLLM still lists the old connection as active, so disconnect it there first if Connect is not offered

The MCP client keeps asking to sign in, or says credentials were rejected on reconnect

The client signed in through its own prompt, and LiteLLM did not save the token for the key's user

Connect in the LiteLLM UI, and use a virtual key of the same LiteLLM user

The MCP gateways page is missing

The workspace is not on a paid plan or its trial, or you lack Manage MCP gateways

Ask a workspace Administrator to check the plan and your role

​

​

FAQ

Does this replace connecting directly to the hosted MCP server?

​

No. People can still connect their AI tools straight to https://mcp.qase.io/mcp, as described in Qase MCP Server. A gateway is for companies that want to route that traffic through their own infrastructure.

​

Can I use a gateway other than LiteLLM?

​

This guide covers LiteLLM, the gateway we have tested. If your company uses a different gateway, contact Qase support before you set it up.

​

Can one gateway in Qase serve both production and staging LiteLLM?

​

Yes. A gateway takes up to 5 redirect URIs. If you want to rotate or revoke staging without touching production, create a separate gateway for each. An organization can have up to 10 active gateways.

Did this answer your question?