Connect LiteLLM
1
Open the LiteLLM integration
In ClosedLoop AI, open Integrations → Developer tools → LiteLLM and click Connect.You need integration management permission. A workspace owner or admin can grant this permission to another member.
2
Create and save the credential
Click Create LiteLLM credential. Copy the generated environment variables into your secret manager before leaving the page.
3
Copy the generated LiteLLM configuration
Copy the generated
config.yaml block into LiteLLM. ClosedLoop AI automatically supplies the correct MCP and token URLs for your workspace region.Restart or reload LiteLLM after changing its configuration, then ask it to list the available tools.4
Verify tool discovery
Return to the LiteLLM integration in ClosedLoop AI and click Check again. The integration becomes connected after LiteLLM lists the ClosedLoop AI tools.Then call
find_reference_customers or get_overview through LiteLLM to verify a complete request. LiteLLM may expose a namespaced name such as closedloop_ai-find_reference_customers.private_key_jwt. Use a shared secret for clients that support only client_secret_basic or client_secret_post.
Before you begin
You need:- Integration management permission for LiteLLM, or a workspace owner or admin account for advanced MCP access
- A client that supports HTTP MCP and the OAuth
client_credentialsflow - A secret manager for the private key or shared secret
Set up another machine-to-machine client
1
Choose your regional endpoints
Use every URL from the same row:
Credentials created for one region do not work in the other region.
2
Create a service client
- In ClosedLoop AI, open Settings → MCP access.
- Click Create service client.
- Enter a name that identifies the gateway or workload using it.
- Copy the client ID. If you plan to use shared-secret authentication, also copy the client secret into your secret manager.
3
Configure a shared-secret client
Set these values in your gateway:
Use
client_secret_basic when your gateway lets you choose the client authentication method. ClosedLoop AI also supports client_secret_post.If your gateway sends an OAuth resource value, set it to the exact regional MCP URL. Gateways that omit resource are supported.4
Test the connection
Ask the gateway to list the available tools, then call a read-only tool such as
get_overview.A successful connection does not open a browser. The gateway receives a one-hour token with the mcp:read scope and must fetch a new one when it expires.Use public-key authentication
Public-key authentication keeps the private key in your infrastructure. ClosedLoop AI stores only the public JSON Web Key (JWK).1
Generate a key pair
Generate either an RSA key of at least 2048 bits with public exponent 65537 for Save
RS256, or a P-256 key for ES256. This RSA example requires OpenSSL and Node.js 20 or later:closedloop-mcp-private.pem in your secret manager. The last command prints the public JWK you will register.2
Register the public key
- In ClosedLoop AI, open Settings → MCP access.
- Find the service client and click Add public key.
- Enter a unique key ID, select the matching algorithm, and paste the public JWK.
- Click Register public key.
3
Configure the official TypeScript client
Install the MCP client package:Configure Set
PrivateKeyJwtProvider with the same client ID, algorithm, and regional MCP URL:CLOSEDLOOP_MCP_URL to the exact regional MCP URL and keep the private-key file outside source control.After the first successful public-key connection, revoke the generated shared-secret credential unless another integration still needs it.LiteLLM configuration reference
LiteLLM currently requires a client ID and shared secret for this flow. It does not expose
private_key_jwt configuration.CLOSEDLOOP_MCP_CLIENT_ID and CLOSEDLOOP_MCP_CLIENT_SECRET, then add the configuration to config.yaml:
https://mcp.closedloop.sh and https://mcp.closedloop.sh/token.
LiteLLM fetches, caches, and renews access tokens automatically. To verify the setup, list its tools and call find_reference_customers or get_overview.
Rotate or revoke credentials
- Access tokens expire after one hour. Service-client secrets expire after 180 days.
- ClosedLoop AI notifies workspace owners and admins in Settings → MCP access 30 and 7 days before a secret expires.
- When you rotate a credential, its existing secret remains valid for at most 24 hours. Update the gateway, verify the new secret, then revoke the old credential.
- Revoking a credential immediately invalidates its issued access tokens. Revoking a service client immediately invalidates all its credentials and tokens.
- Public keys do not expire automatically. Register the replacement, test it, then revoke the old key.
- Revoking a public key immediately invalidates every access token issued through that key.
Troubleshooting
MCP Overview
Set up interactive clients and learn how MCP access works.
Core tools reference
Browse core tools and their parameters.