Skip to content

Commit f474c13

Browse files
committed
Added doc
1 parent f6e998e commit f474c13

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/guides/authentication.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,42 @@ projects:
11851185
# ... other GitHub config
11861186
```
11871187

1188+
## User Context Caching
1189+
1190+
MXCP caches user context information to improve performance and reduce load on OAuth providers. When a user is authenticated, their user information (username, email, provider details) is cached to avoid making API calls to the OAuth provider on every tool execution.
1191+
1192+
### Cache TTL Configuration
1193+
1194+
You can configure the cache duration using the `cache_ttl` setting:
1195+
1196+
```yaml
1197+
projects:
1198+
my_project:
1199+
profiles:
1200+
dev:
1201+
auth:
1202+
provider: github
1203+
cache_ttl: 300 # Cache user context for 5 minutes (default: 300 seconds)
1204+
1205+
clients:
1206+
- client_id: "${CLIENT_ID}"
1207+
# ... client config
1208+
```
1209+
1210+
**Configuration Options:**
1211+
1212+
- `cache_ttl`: Cache duration in seconds for user context information
1213+
- **Default**: 300 seconds (5 minutes)
1214+
- **Purpose**: Reduces API calls to OAuth providers, improving performance and avoiding rate limits
1215+
- **Range**: Any positive integer (recommended: 60-1800 seconds)
1216+
1217+
**Security Considerations:**
1218+
1219+
- Cached user context expires automatically after the TTL period
1220+
- User information is cached in memory only (not persisted to disk)
1221+
- Cache is cleared when the server restarts
1222+
- Shorter TTL values provide more up-to-date user information but increase API calls
1223+
11881224
## Authorization Configuration
11891225

11901226
MXCP supports configurable scope-based authorization to control access to your endpoints and tools. You can specify which OAuth scopes are required for accessing your server's resources.

0 commit comments

Comments
 (0)