You connect an AI client to the Evalanche MCP in three steps: create API access, retrieve a bearer token, and store the token in the AI client.
Note!
The Evalanche MCP supports only the current MCP protocol, Streamable HTTP. Older transport methods such as SSE are not supported. OAuth login in the browser is not possible. Authentication is performed using a bearer token.
Prerequisites
- MCP server URL for your instance:
https://<YOUR-DOMAIN>/api/mcp - For Claude Desktop: Node.js 18 or higher
1. Create API access
- Open Settings → Applications and access.
- Create new access of type API (REST).
- Assign a unique name, for example
MCP – Claude Desktop – Max Mustermann. - Save the access. The system generates a Client ID and a Client Secret.
Warning!
The client secret is displayed only once. Save it in a password manager. Create separate access for each person and AI client.
2. Retrieve a bearer token
Request a token using the client ID and client secret (OAuth 2.0 Client Credentials).
macOS and Linux
curl -X POST \ -H "Accept: application/json" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "scope=api:restpreview&client_id=<CLIENT-ID>&client_secret=<CLIENT-SECRET>" \ "https://<YOUR-DOMAIN>/api/auth/v1/flow/client"
Windows PowerShell
$body = @{
scope = "api:restpreview"
client_id = "<CLIENT-ID>"
client_secret = "<CLIENT-SECRET>"
}
(Invoke-RestMethod -Method Post `
-Uri "https://<YOUR-DOMAIN>/api/auth/v1/flow/client" `
-ContentType "application/x-www-form-urlencoded" `
-Body $body).access_tokenResponse
{
"access_token": "<ACCESS-TOKEN>",
"token_type": "Bearer",
"expires_in": <SECONDS>
}Copy the value from access_token. expires_in specifies the validity period in seconds.
3. Store the token in the AI client
Claude Desktop
- In Claude Desktop, open Settings → Developer → Edit Configuration. This opens the file
claude_desktop_config.json. - Insert the following entry and replace the domain and token.
- Save the file and restart Claude Desktop.
{
"mcpServers": {
"evalanche-core": {
"command": "npx",
"args": [
"-y",
"mcp-remote@0.15.2",
"https://<YOUR-DOMAIN>/api/mcp",
"--protocol",
"auto",
"--transport",
"http-only",
"--header",
"Authorization: Bearer <INSERT-TOKEN>"
]
}
}
}| Parameter | Meaning |
|---|---|
mcp-remote@0.15.2 | Connects Claude Desktop to the remote server. The fixed version prevents unexpected changes. |
--transport http-only | Forces Streamable HTTP. Without this parameter, the client also attempts SSE. |
--protocol auto | Automatically negotiates the protocol version with the server. |
--header | Passes the bearer token with every request. |
After restarting, evalanche-core appears under the connectors. Test the connection with: “Show me my mailing templates.”
Claude Code
claude mcp add --transport http evalanche-core https://<YOUR-DOMAIN>/api/mcp \ --header "Authorization: Bearer <INSERT-TOKEN>"
Cursor
{
"mcpServers": {
"evalanche-core": {
"url": "https://<YOUR-DOMAIN>/api/mcp",
"headers": { "Authorization": "Bearer <INSERT-TOKEN>" }
}
}
}VS Code
{
"servers": {
"evalanche-core": {
"type": "http",
"url": "https://<YOUR-DOMAIN>/api/mcp",
"headers": { "Authorization": "Bearer <INSERT-TOKEN>" }
}
}
}Warning!
Enter only the token, never the client secret. Configuration files containing tokens must not be stored in repositories or shared folders.
4. Renew the token
After expires_in expires, the MCP responds with HTTP 401. Retrieve a new token as described in step 2, replace it in the configuration, and restart the AI client.
Custom agents and backend integrations
Your application retrieves the token itself using POST /api/auth/v1/flow/client, sends it with every MCP request, and automatically renews it shortly before it expires or after HTTP 401.
import os, time, requests
AUTH_URL = "https://<YOUR-DOMAIN>/api/auth/v1/flow/client"
_token, _expires_at = None, 0
def get_token():
global _token, _expires_at
if _token and time.time() < _expires_at - 60:
return _token
r = requests.post(AUTH_URL, data={
"scope": os.environ["MCP_SCOPE"],
"client_id": os.environ["MCP_CLIENT_ID"],
"client_secret": os.environ["MCP_CLIENT_SECRET"],
}, headers={"Accept": "application/json"}, timeout=10)
r.raise_for_status()
data = r.json()
_token, _expires_at = data["access_token"], time.time() + data["expires_in"]
return _tokenTroubleshooting
| Message | Cause and solution |
|---|---|
invalid_client | Client ID or client secret is incorrect. Check the credentials. |
invalid_scope | Scope is invalid. Use api:restpreview. |
HTTP 401 | Token is missing or has expired. Retrieve a new token. |
HTTP 403 | The access does not have permission for the function. |
| Connection drops / protocol error | --transport http-only is missing, or an outdated mcp-remote version is being used. Adopt the configuration shown above. |
npx not found | Node.js is not installed. Install Node.js 18 or higher and restart the client. |
| No tools visible | Check the server URL, JSON syntax, and header. Restart the AI client. |