Open Mode
For development and internal useNo authentication configuration required. All tools are accessible without credentials.
EkaCare OAuth
For production and partner deploymentsAuthenticate via Eka’s OIDC provider (
accounts.eka.care). Required for the hosted remote server at medai-tools.eka.care.Open Mode (Default)
If you start the server without any auth environment variables, it runs in open mode — no login required. You’ll see this in the logs:EkaCare OAuth Mode
For production deployments or when using the hosted server athttps://medai-tools.eka.care/mcp, authentication is handled via EkaCare’s OIDC provider.
How It Works
There are two authentication paths:-
Full OIDC Flow — for external clients (Claude, ChatGPT, Cursor). Your AI client opens a browser window to
accounts.eka.care, you log in, and the client receives an access token automatically. -
Direct Eka Token — for internal integrations. Pass a raw Eka API token via the
Authorizationheader. The server validates it againstapi.eka.careand caches the result in Redis (5-minute TTL for valid tokens, 30-second TTL for invalid ones).
Self-hosted OAuth Setup
To enable EkaCare OAuth on your own instance, set the following environment variables:| Variable | Required | Description |
|---|---|---|
FASTMCP_SERVER_AUTH_EKACARE_BASE_URL | Yes | Public URL of your server instance (e.g. https://medai.yourdomain.com) |
FASTMCP_SERVER_AUTH_EKACARE_CLIENT_ID | Yes | OAuth client ID issued by Eka |
FASTMCP_SERVER_AUTH_EKACARE_CLIENT_SECRET | Yes | OAuth client secret |
FASTMCP_SERVER_AUTH_EKACARE_CLIENT_STORAGE_BE | No | Redis URL for token caching (e.g. redis://localhost:6379/0) — improves validation performance |
.env file:
.env
Token Caching with Redis
Redis is optional but recommended for production. Without it, every tool call triggers a live token validation request toapi.eka.care. With Redis:
- Valid tokens are cached for 5 minutes
- Invalid/expired tokens are cached for 30 seconds (prevents hammering the auth API)
Getting OAuth Credentials
To obtain a Client ID and Secret for a self-hosted deployment, contact: ekaconnect@eka.care Include:- Your organization name
- Deployment URL (the
BASE_URLyou plan to use) - Intended use case
For the hosted server (
https://medai-tools.eka.care/mcp), authentication is managed by Eka — you only need an Eka account. OAuth credentials are only needed for self-hosted deployments.
