MCP
MCP is in Beta
Features and behavior may change, and you may encounter issues. Please use with caution and review results before relying on them.
Check your MCP availability, monitor monthly usage, and review or export your personal MCP activity.
Base path: /api/v1/mcp
MCP Clients base path: /mcp
| Method | Endpoint | Description |
|---|---|---|
GET |
/api/v1/mcp/configuration |
Get MCP Configuration |
GET |
/api/v1/mcp/usage |
Get MCP Usage |
GET |
/api/v1/mcp/audit |
List MCP Activity |
GET |
/api/v1/mcp/audit/{callId} |
Get MCP Call Details |
GET |
/api/v1/mcp/audit/export |
Export MCP Activity |
Authentication and Access
Use an OAuth bearer token from normal user login. All five endpoints are restricted to the authenticated user in the current tenant. They require no additional permission scopes and reject API-key authentication and impersonation. Administrators cannot use them to read another user's activity.
These endpoints remain available when MCP is disabled or the user lacks mcp:mcp:use. They consume no monthly MCP calls. Responses include Cache-Control: no-store; ordinary HTTP rate limits still apply.
Account API and MCP endpoint
These REST endpoints support account setup and history. Connected assistants use /mcp, which requires an X-API-Key with mcp:mcp:use and the relevant tool scopes. Create, list, and revoke keys through the existing API Keys API. Creating a key requires user:apikeys:write.
Get MCP Configuration
GET /api/v1/mcp/configuration
Requires Authentication - Normal user login. Scopes: none.
Return effective availability and the user's current limits. Server and tenant MCP settings both default to false. A disabled configuration is a successful 200 OK response with enabled: false.
McpConfigurationResponse
| Field | Type | Nullable | Description |
|---|---|---|---|
enabled |
boolean |
No | true when server and tenant enablement, API-key authentication, and the user's MCP permission are all available. |
callsPerMinute |
integer |
No | Effective MCP request limit, shared across the user's keys. Default: 30. |
monthlyCalls |
integer |
No | Effective monthly tool-call allowance. Default: 2000. |
| Status | Description |
|---|---|
200 OK |
Configuration returned, including when MCP is unavailable. |
See Common Errors for authentication and rate-limit responses.
Get MCP Usage
GET /api/v1/mcp/usage
Requires Authentication - Normal user login. Scopes: none.
Return usage for the current UTC calendar month, shared across all of the user's API keys. Each permitted MCP tool invocation consumes one call, including invocations that subsequently fail. Initialization, discovery, and these account API reads consume no monthly calls.
McpUsageResponse
| Field | Type | Nullable | Description |
|---|---|---|---|
used |
integer |
No | Charged tool calls in the current UTC month. |
limit |
integer |
No | Current effective monthly allowance. |
remaining |
integer |
No | limit - used, with a minimum of 0. |
resetsAt |
string (ISO 8601) |
No | Start of the next month at 00:00:00Z. |
{
"used": 42,
"limit": 2000,
"remaining": 1958,
"resetsAt": "2026-10-01T00:00:00Z"
}
Revoking a key, disabling MCP, or expiring activity history does not reset monthly usage. Use this endpoint for accounting; retained activity may cover a shorter period.
| Status | Description |
|---|---|
200 OK |
Current usage and allowance returned. |
See Common Errors for authentication and rate-limit responses.
List MCP Activity
GET /api/v1/mcp/audit
Requires Authentication - Normal user login. Scopes: none.
List personal MCP calls, newest first. The response is a JSON array, with no total or nextPage envelope. Start at page 0 and increment page until fewer than size items are returned. New calls can shift pages while browsing.
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
apiKeyId |
string (UUID) |
No | Filter by key ID. Does not grant access to another user's activity. |
tool |
string |
No | Exact MCP tool name, for example list_files. |
outcome |
string |
No | Match a recorded terminal outcome: PREPARED or REJECTED. Use INCOMPLETE for calls without a terminal event. A call with multiple terminal events may match an earlier outcome; its summary shows the latest state. |
from |
string (ISO 8601) |
No | Inclusive start time. Example: 2026-09-01T00:00:00Z. |
until |
string (ISO 8601) |
No | Exclusive end time. Example: 2026-10-01T00:00:00Z. |
page |
integer |
No | Zero-based page, from 0 to 500. Default: 0. |
size |
integer |
No | Items per page, from 1 to 100. Default: 20. |
curl --get "https://koldan.dixilang.com/api/v1/mcp/audit" \
-H "Authorization: Bearer $JWT" \
--data-urlencode "tool=list_files" \
--data-urlencode "from=2026-09-01T00:00:00Z" \
--data-urlencode "until=2026-10-01T00:00:00Z" \
--data-urlencode "page=0" \
--data-urlencode "size=20"
McpAuditCallResponse[]
| Field | Type | Nullable | Description |
|---|---|---|---|
callId |
string (UUID) |
No | Server-generated call identifier; use it to retrieve the event timeline. |
occurredAt |
string (ISO 8601) |
No | Time the call was associated with the authenticated user. |
apiKeyId |
string (UUID) |
Yes | Key used for the call, when available. |
toolName |
string |
Yes | Tool name; may be absent for protocol operations or early rejections. |
protocolMethod |
string |
Yes | MCP method, such as tools/call or initialize. |
outcome |
string |
No | Latest outcome: PREPARED, REJECTED, or INCOMPLETE. |
errorCode |
string |
Yes | Sanitized machine-readable error code, when present. |
quotaCharged |
boolean |
No | Whether this call consumed one monthly unit. |
durationMs |
integer |
Yes | Recorded duration in milliseconds. |
responseBytes |
integer |
Yes | Recorded response size in bytes. |
incomplete |
boolean |
No | true if no terminal event has been recorded. |
[
{
"callId": "550e8400-e29b-41d4-a716-446655440000",
"occurredAt": "2026-09-21T08:15:00Z",
"apiKeyId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"toolName": "list_files",
"protocolMethod": "tools/call",
"outcome": "PREPARED",
"quotaCharged": true,
"durationMs": 24,
"responseBytes": 1240,
"incomplete": false
}
]
Prepared does not confirm delivery
PREPARED means the response was recorded before release. It does not confirm that the assistant received it. An incomplete call may still be running or may have ended before a terminal event could be recorded. Check quotaCharged independently of the outcome.
| Status | Description |
|---|---|
200 OK |
Matching calls, or [] when no calls match the requested page. |
400 Bad Request |
Invalid parameter format or page/size outside the allowed range. |
See Common Errors for authentication and rate-limit responses.
Get MCP Call Details
GET /api/v1/mcp/audit/{callId}
Requires Authentication - Normal user login. Scopes: none.
Return the retained event timeline for one of your calls, in recorded order. Events include receipt, identification, admission, and response preparation or failure. A call may have fewer events if rejected early or left incomplete.
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
callId |
string (UUID) |
Yes | Identifier from List MCP Activity. |
curl "https://koldan.dixilang.com/api/v1/mcp/audit/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer $JWT"
McpAuditEventResponse[]
| Field | Type | Nullable | Description |
|---|---|---|---|
id |
integer |
No | Event identifier. |
callId |
string (UUID) |
No | Identifier shared by events for this call. |
occurredAt |
string (ISO 8601) |
No | Event timestamp in UTC. |
eventType |
string |
No | For example RECEIVED, IDENTIFIED, ADMITTED, RESULT_PREPARED, REJECTED, EXECUTION_FAILED, or DELIVERY_FAILED. |
correlationId |
string (UUID) |
No | Correlation identifier for troubleshooting. |
apiKeyId |
string (UUID) |
Yes | Key identifier, when known at this event. |
protocolMethod |
string |
Yes | MCP method, when known. |
protocolVersion |
string |
Yes | Recorded protocol version. |
toolName |
string |
Yes | Tool name, when known. |
schemaVersion |
integer |
No | Audit event schema version. Currently 1. |
outcome |
string |
Yes | Outcome at this stage, such as RECEIVED, AUTHENTICATED, ADMITTED, PREPARED, or REJECTED. |
errorCode |
string |
Yes | Sanitized error code. |
charged |
boolean |
No | Whether this event records the monthly quota charge. Do not treat every event as a separate call. |
durationMs |
integer |
Yes | Duration recorded at this stage. |
responseBytes |
integer |
Yes | Response size, when recorded. |
metadata |
object |
No | Event-specific metadata explicitly selected by the tool, such as one input subject, or page/offset, requested size, and returnedSize. Transport stages can add lifecycle fields such as quotaCharged and delivery; keys vary by event. |
The timeline contains no transcript, translation, or summary bodies, credentials, raw headers, arbitrary search text, returned objects, or lists of returned resource identifiers. When present, subject is the input identifier of the object or parent resource on which the tool operated; access must still be checked through that resource's service API.
[
{
"id": 103,
"callId": "550e8400-e29b-41d4-a716-446655440000",
"occurredAt": "2026-09-21T08:15:00.010Z",
"eventType": "ADMITTED",
"correlationId": "550e8400-e29b-41d4-a716-446655440000",
"apiKeyId": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"protocolMethod": "tools/call",
"protocolVersion": "2025-11-25",
"toolName": "list_files",
"schemaVersion": 1,
"outcome": "ADMITTED",
"charged": true,
"durationMs": 10,
"metadata": {}
}
]
| Status | Description |
|---|---|
200 OK |
Event timeline returned. |
400 Bad Request |
Invalid UUID. |
404 Not Found |
No retained call is accessible to the current user and tenant. |
See Common Errors for authentication and rate-limit responses.
Export MCP Activity
GET /api/v1/mcp/audit/export
Requires Authentication - Normal user login. Scopes: none.
Download up to 1,000 matching call summaries, newest first. The export uses the same apiKeyId, tool, outcome, from, and until filters as the activity list. It does not include detailed event timelines.
Export Parameters
| Field | Type | Required | Description |
|---|---|---|---|
format |
string |
No | json or csv, lowercase. Default: json. |
size |
integer |
No | Maximum calls to export, from 1 to 1000. Default: 1000. |
There is no page parameter or total-count field. An export containing exactly size rows may be truncated. Narrow the time range or use the paginated activity endpoint when you need to retrieve further calls.
Response
| Format | Content type | Attachment filename | Content |
|---|---|---|---|
json |
application/json |
mcp-activity.json |
McpAuditCallResponse[], including the same fields as the activity list. |
csv |
text/csv;charset=UTF-8 |
mcp-activity.csv |
Columns: callId, occurredAt, apiKeyId, tool, outcome, quotaCharged, incomplete. |
Both formats use Content-Disposition: attachment. Empty JSON exports contain []; empty CSV exports contain only the header row.
| Status | Description |
|---|---|
200 OK |
Export returned. |
400 Bad Request |
Unsupported format, invalid filter format, or size outside the allowed range. |
See Common Errors for authentication and rate-limit responses.
Common Errors
These responses apply to all endpoints on this page.
| Status | Description |
|---|---|
401 Unauthorized |
Authentication is missing, invalid, or expired. |
403 Forbidden |
Normal user login is required; API-key authentication and impersonation are not accepted. |
429 Too Many Requests |
An applicable HTTP rate limit was exceeded. |