-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathactivity-api.yaml
More file actions
332 lines (323 loc) · 8.97 KB
/
Copy pathactivity-api.yaml
File metadata and controls
332 lines (323 loc) · 8.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
openapi: 3.0.3
info:
title: MCPProxy Activity Log API
description: REST API for querying and exporting activity logs
version: 1.0.0
paths:
/api/v1/activity:
get:
summary: List activity records
description: |
Returns paginated list of activity records with optional filtering.
Records are returned in reverse chronological order (newest first).
operationId: listActivity
tags:
- Activity
security:
- ApiKeyHeader: []
- ApiKeyQuery: []
parameters:
- name: type
in: query
description: Filter by activity type
schema:
type: string
enum: [tool_call, policy_decision, quarantine_change, server_change]
- name: server
in: query
description: Filter by server name
schema:
type: string
- name: tool
in: query
description: Filter by tool name
schema:
type: string
- name: session_id
in: query
description: Filter by MCP session ID
schema:
type: string
- name: status
in: query
description: Filter by status
schema:
type: string
enum: [success, error, blocked]
- name: start_time
in: query
description: Filter activities after this time (RFC3339)
schema:
type: string
format: date-time
- name: end_time
in: query
description: Filter activities before this time (RFC3339)
schema:
type: string
format: date-time
- name: limit
in: query
description: Maximum records to return
schema:
type: integer
minimum: 1
maximum: 100
default: 50
- name: offset
in: query
description: Pagination offset
schema:
type: integer
minimum: 0
default: 0
responses:
'200':
description: List of activity records
content:
application/json:
schema:
$ref: '#/components/schemas/ActivityListResponse'
'400':
description: Invalid filter parameters
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Unauthorized - invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/v1/activity/{id}:
get:
summary: Get activity record details
description: Returns full details for a single activity record
operationId: getActivityDetail
tags:
- Activity
security:
- ApiKeyHeader: []
- ApiKeyQuery: []
parameters:
- name: id
in: path
required: true
description: Activity record ID (ULID)
schema:
type: string
responses:
'200':
description: Activity record details
content:
application/json:
schema:
$ref: '#/components/schemas/ActivityDetailResponse'
'404':
description: Activity record not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Unauthorized - invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/v1/activity/export:
get:
summary: Export activity records
description: |
Export activity records in bulk for compliance/audit.
Supports JSON Lines and CSV formats.
Uses streaming to handle large exports efficiently.
operationId: exportActivity
tags:
- Activity
security:
- ApiKeyHeader: []
- ApiKeyQuery: []
parameters:
- name: format
in: query
description: Export format
required: true
schema:
type: string
enum: [json, csv]
- name: type
in: query
description: Filter by activity type
schema:
type: string
enum: [tool_call, policy_decision, quarantine_change, server_change]
- name: server
in: query
description: Filter by server name
schema:
type: string
- name: start_time
in: query
description: Filter activities after this time (RFC3339)
schema:
type: string
format: date-time
- name: end_time
in: query
description: Filter activities before this time (RFC3339)
schema:
type: string
format: date-time
responses:
'200':
description: Exported activity records
content:
application/x-ndjson:
schema:
type: string
description: JSON Lines format (one JSON object per line)
text/csv:
schema:
type: string
description: CSV format with header row
'400':
description: Invalid format parameter
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Unauthorized - invalid or missing API key
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
securitySchemes:
ApiKeyHeader:
type: apiKey
in: header
name: X-API-Key
ApiKeyQuery:
type: apiKey
in: query
name: apikey
schemas:
ActivityRecord:
type: object
required:
- id
- type
- status
- timestamp
properties:
id:
type: string
description: Unique identifier (ULID format)
example: "01HQWX1Y2Z3A4B5C6D7E8F9G0H"
type:
type: string
enum: [tool_call, policy_decision, quarantine_change, server_change]
description: Type of activity
server_name:
type: string
description: Name of upstream MCP server
example: "github"
tool_name:
type: string
description: Name of tool called
example: "create_issue"
arguments:
type: object
additionalProperties: true
description: Tool call arguments
response:
type: string
description: Tool response (may be truncated)
response_truncated:
type: boolean
description: True if response was truncated
default: false
status:
type: string
enum: [success, error, blocked]
description: Result status
error_message:
type: string
description: Error details if status is error
duration_ms:
type: integer
format: int64
description: Execution duration in milliseconds
timestamp:
type: string
format: date-time
description: When activity occurred
session_id:
type: string
description: MCP session ID for correlation
request_id:
type: string
description: HTTP request ID for correlation
metadata:
type: object
additionalProperties: true
description: Additional context-specific data
ActivityListResponse:
type: object
required:
- success
- data
properties:
success:
type: boolean
example: true
data:
type: object
required:
- activities
- total
- limit
- offset
properties:
activities:
type: array
items:
$ref: '#/components/schemas/ActivityRecord'
total:
type: integer
description: Total matching records
limit:
type: integer
description: Page size used
offset:
type: integer
description: Current offset
ActivityDetailResponse:
type: object
required:
- success
- data
properties:
success:
type: boolean
example: true
data:
$ref: '#/components/schemas/ActivityRecord'
ErrorResponse:
type: object
required:
- success
- error
properties:
success:
type: boolean
example: false
error:
type: string
description: Error message
tags:
- name: Activity
description: Activity log operations