Skip to content

Commit fa14c5a

Browse files
committed
fix(backend): Refactor MCP User Configuration API to use object for user_args
1 parent 5616f7f commit fa14c5a

File tree

10 files changed

+503
-312
lines changed

10 files changed

+503
-312
lines changed

services/backend/api-spec.json

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19890,11 +19890,11 @@
1989019890
"description": "Optional device ID for device-specific configuration"
1989119891
},
1989219892
"user_args": {
19893-
"type": "array",
19894-
"items": {
19893+
"type": "object",
19894+
"additionalProperties": {
1989519895
"type": "string"
1989619896
},
19897-
"description": "User-specific command line arguments"
19897+
"description": "User argument mappings (placeholder -> actual value)"
1989819898
},
1989919899
"user_env": {
1990019900
"type": "object",
@@ -19971,11 +19971,11 @@
1997119971
"description": "Device ID"
1997219972
},
1997319973
"user_args": {
19974-
"type": "array",
19975-
"items": {
19974+
"type": "object",
19975+
"additionalProperties": {
1997619976
"type": "string"
1997719977
},
19978-
"description": "User-specific command line arguments"
19978+
"description": "User argument mappings (placeholder -> actual value)"
1997919979
},
1998019980
"user_env": {
1998119981
"type": "object",
@@ -20194,7 +20194,7 @@
2019420194
],
2019520195
"responses": {
2019620196
"200": {
20197-
"description": "User configurations retrieved successfully",
20197+
"description": "Default Response",
2019820198
"content": {
2019920199
"application/json": {
2020020200
"schema": {
@@ -20226,11 +20226,11 @@
2022620226
"description": "Device ID"
2022720227
},
2022820228
"user_args": {
20229-
"type": "array",
20230-
"items": {
20229+
"type": "object",
20230+
"additionalProperties": {
2023120231
"type": "string"
2023220232
},
20233-
"description": "User-specific command line arguments"
20233+
"description": "User argument mappings (placeholder -> actual value)"
2023420234
},
2023520235
"user_env": {
2023620236
"type": "object",
@@ -20274,8 +20274,7 @@
2027420274
"success",
2027520275
"data"
2027620276
],
20277-
"additionalProperties": false,
20278-
"description": "User configurations retrieved successfully"
20277+
"additionalProperties": false
2027920278
}
2028020279
}
2028120280
}
@@ -20462,7 +20461,7 @@
2046220461
],
2046320462
"responses": {
2046420463
"200": {
20465-
"description": "User configuration retrieved successfully",
20464+
"description": "Default Response",
2046620465
"content": {
2046720466
"application/json": {
2046820467
"schema": {
@@ -20492,11 +20491,11 @@
2049220491
"description": "Device ID"
2049320492
},
2049420493
"user_args": {
20495-
"type": "array",
20496-
"items": {
20494+
"type": "object",
20495+
"additionalProperties": {
2049720496
"type": "string"
2049820497
},
20499-
"description": "User-specific command line arguments"
20498+
"description": "User argument mappings (placeholder -> actual value)"
2050020499
},
2050120500
"user_env": {
2050220501
"type": "object",
@@ -20539,8 +20538,7 @@
2053920538
"success",
2054020539
"data"
2054120540
],
20542-
"additionalProperties": false,
20543-
"description": "User configuration retrieved successfully"
20541+
"additionalProperties": false
2054420542
}
2054520543
}
2054620544
}
@@ -20689,11 +20687,11 @@
2068920687
"description": "Optional device ID for device-specific configuration"
2069020688
},
2069120689
"user_args": {
20692-
"type": "array",
20693-
"items": {
20690+
"type": "object",
20691+
"additionalProperties": {
2069420692
"type": "string"
2069520693
},
20696-
"description": "User-specific command line arguments"
20694+
"description": "User argument mappings (placeholder -> actual value)"
2069720695
},
2069820696
"user_env": {
2069920697
"type": "object",
@@ -20780,11 +20778,11 @@
2078020778
"description": "Device ID"
2078120779
},
2078220780
"user_args": {
20783-
"type": "array",
20784-
"items": {
20781+
"type": "object",
20782+
"additionalProperties": {
2078520783
"type": "string"
2078620784
},
20787-
"description": "User-specific command line arguments"
20785+
"description": "User argument mappings (placeholder -> actual value)"
2078820786
},
2078920787
"user_env": {
2079020788
"type": "object",
@@ -21167,18 +21165,23 @@
2116721165
},
2116821166
"/api/teams/{teamId}/mcp/installations/{installationId}/user-configs/{configId}/args": {
2116921167
"patch": {
21168+
"summary": "Update user configuration arguments",
21169+
"tags": [
21170+
"MCP User Configurations"
21171+
],
21172+
"description": "Updates the user-specific arguments for an MCP server installation configuration. Requires Content-Type: application/json header when sending request body. Supports both cookie-based authentication (for web users) and OAuth2 Bearer token authentication (for CLI users). Requires mcp:read scope for OAuth2 access.",
2117021173
"requestBody": {
2117121174
"content": {
2117221175
"application/json": {
2117321176
"schema": {
2117421177
"type": "object",
2117521178
"properties": {
2117621179
"args": {
21177-
"type": "array",
21178-
"items": {
21180+
"type": "object",
21181+
"additionalProperties": {
2117921182
"type": "string"
2118021183
},
21181-
"description": "User-specific command line arguments"
21184+
"description": "User argument mappings (placeholder -> actual value)"
2118221185
}
2118321186
},
2118421187
"required": [
@@ -21262,11 +21265,11 @@
2126221265
"description": "Device ID"
2126321266
},
2126421267
"user_args": {
21265-
"type": "array",
21266-
"items": {
21268+
"type": "object",
21269+
"additionalProperties": {
2126721270
"type": "string"
2126821271
},
21269-
"description": "User-specific command line arguments"
21272+
"description": "User argument mappings (placeholder -> actual value)"
2127021273
},
2127121274
"user_env": {
2127221275
"type": "object",
@@ -21450,6 +21453,11 @@
2145021453
},
2145121454
"/api/teams/{teamId}/mcp/installations/{installationId}/user-configs/{configId}/env": {
2145221455
"patch": {
21456+
"summary": "Update user configuration environment variables",
21457+
"tags": [
21458+
"MCP User Configurations"
21459+
],
21460+
"description": "Updates the user-specific environment variables for an MCP server installation configuration. Requires Content-Type: application/json header when sending request body. Supports both cookie-based authentication (for web users) and OAuth2 Bearer token authentication (for CLI users). Requires mcp:read scope for OAuth2 access.",
2145321461
"requestBody": {
2145421462
"content": {
2145521463
"application/json": {
@@ -21545,11 +21553,11 @@
2154521553
"description": "Device ID"
2154621554
},
2154721555
"user_args": {
21548-
"type": "array",
21549-
"items": {
21556+
"type": "object",
21557+
"additionalProperties": {
2155021558
"type": "string"
2155121559
},
21552-
"description": "User-specific command line arguments"
21560+
"description": "User argument mappings (placeholder -> actual value)"
2155321561
},
2155421562
"user_env": {
2155521563
"type": "object",

services/backend/api-spec.yaml

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13714,10 +13714,10 @@ paths:
1371413714
type: string
1371513715
description: Optional device ID for device-specific configuration
1371613716
user_args:
13717-
type: array
13718-
items:
13717+
type: object
13718+
additionalProperties:
1371913719
type: string
13720-
description: User-specific command line arguments
13720+
description: User argument mappings (placeholder -> actual value)
1372113721
user_env:
1372213722
type: object
1372313723
additionalProperties:
@@ -13769,10 +13769,10 @@ paths:
1376913769
type: string
1377013770
description: Device ID
1377113771
user_args:
13772-
type: array
13773-
items:
13772+
type: object
13773+
additionalProperties:
1377413774
type: string
13775-
description: User-specific command line arguments
13775+
description: User argument mappings (placeholder -> actual value)
1377613776
user_env:
1377713777
type: object
1377813778
additionalProperties:
@@ -13924,7 +13924,7 @@ paths:
1392413924
- bearerAuth: []
1392513925
responses:
1392613926
"200":
13927-
description: User configurations retrieved successfully
13927+
description: Default Response
1392813928
content:
1392913929
application/json:
1393013930
schema:
@@ -13951,10 +13951,10 @@ paths:
1395113951
type: string
1395213952
description: Device ID
1395313953
user_args:
13954-
type: array
13955-
items:
13954+
type: object
13955+
additionalProperties:
1395613956
type: string
13957-
description: User-specific command line arguments
13957+
description: User argument mappings (placeholder -> actual value)
1395813958
user_env:
1395913959
type: object
1396013960
additionalProperties:
@@ -13986,7 +13986,6 @@ paths:
1398613986
- success
1398713987
- data
1398813988
additionalProperties: false
13989-
description: User configurations retrieved successfully
1399013989
"400":
1399113990
description: Bad Request
1399213991
content:
@@ -14114,7 +14113,7 @@ paths:
1411414113
- bearerAuth: []
1411514114
responses:
1411614115
"200":
14117-
description: User configuration retrieved successfully
14116+
description: Default Response
1411814117
content:
1411914118
application/json:
1412014119
schema:
@@ -14139,10 +14138,10 @@ paths:
1413914138
type: string
1414014139
description: Device ID
1414114140
user_args:
14142-
type: array
14143-
items:
14141+
type: object
14142+
additionalProperties:
1414414143
type: string
14145-
description: User-specific command line arguments
14144+
description: User argument mappings (placeholder -> actual value)
1414614145
user_env:
1414714146
type: object
1414814147
additionalProperties:
@@ -14174,7 +14173,6 @@ paths:
1417414173
- success
1417514174
- data
1417614175
additionalProperties: false
14177-
description: User configuration retrieved successfully
1417814176
"400":
1417914177
description: Bad Request
1418014178
content:
@@ -14276,10 +14274,10 @@ paths:
1427614274
type: string
1427714275
description: Optional device ID for device-specific configuration
1427814276
user_args:
14279-
type: array
14280-
items:
14277+
type: object
14278+
additionalProperties:
1428114279
type: string
14282-
description: User-specific command line arguments
14280+
description: User argument mappings (placeholder -> actual value)
1428314281
user_env:
1428414282
type: object
1428514283
additionalProperties:
@@ -14338,10 +14336,10 @@ paths:
1433814336
type: string
1433914337
description: Device ID
1434014338
user_args:
14341-
type: array
14342-
items:
14339+
type: object
14340+
additionalProperties:
1434314341
type: string
14344-
description: User-specific command line arguments
14342+
description: User argument mappings (placeholder -> actual value)
1434514343
user_env:
1434614344
type: object
1434714345
additionalProperties:
@@ -14600,17 +14598,25 @@ paths:
1460014598
description: Internal Server Error
1460114599
/api/teams/{teamId}/mcp/installations/{installationId}/user-configs/{configId}/args:
1460214600
patch:
14601+
summary: Update user configuration arguments
14602+
tags:
14603+
- MCP User Configurations
14604+
description: "Updates the user-specific arguments for an MCP server installation
14605+
configuration. Requires Content-Type: application/json header when
14606+
sending request body. Supports both cookie-based authentication (for web
14607+
users) and OAuth2 Bearer token authentication (for CLI users). Requires
14608+
mcp:read scope for OAuth2 access."
1460314609
requestBody:
1460414610
content:
1460514611
application/json:
1460614612
schema:
1460714613
type: object
1460814614
properties:
1460914615
args:
14610-
type: array
14611-
items:
14616+
type: object
14617+
additionalProperties:
1461214618
type: string
14613-
description: User-specific command line arguments
14619+
description: User argument mappings (placeholder -> actual value)
1461414620
required:
1461514621
- args
1461614622
additionalProperties: false
@@ -14667,10 +14673,10 @@ paths:
1466714673
type: string
1466814674
description: Device ID
1466914675
user_args:
14670-
type: array
14671-
items:
14676+
type: object
14677+
additionalProperties:
1467214678
type: string
14673-
description: User-specific command line arguments
14679+
description: User argument mappings (placeholder -> actual value)
1467414680
user_env:
1467514681
type: object
1467614682
additionalProperties:
@@ -14795,6 +14801,14 @@ paths:
1479514801
description: Internal Server Error
1479614802
/api/teams/{teamId}/mcp/installations/{installationId}/user-configs/{configId}/env:
1479714803
patch:
14804+
summary: Update user configuration environment variables
14805+
tags:
14806+
- MCP User Configurations
14807+
description: "Updates the user-specific environment variables for an MCP server
14808+
installation configuration. Requires Content-Type: application/json
14809+
header when sending request body. Supports both cookie-based
14810+
authentication (for web users) and OAuth2 Bearer token authentication
14811+
(for CLI users). Requires mcp:read scope for OAuth2 access."
1479814812
requestBody:
1479914813
content:
1480014814
application/json:
@@ -14862,10 +14876,10 @@ paths:
1486214876
type: string
1486314877
description: Device ID
1486414878
user_args:
14865-
type: array
14866-
items:
14879+
type: object
14880+
additionalProperties:
1486714881
type: string
14868-
description: User-specific command line arguments
14882+
description: User argument mappings (placeholder -> actual value)
1486914883
user_env:
1487014884
type: object
1487114885
additionalProperties:

services/backend/src/routes/mcp/user-configurations/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type FastifyInstance } from 'fastify';
2-
import { requireAuthenticationAny, requireOAuthScope } from '../../../middleware/oauthMiddleware';
2+
import { requireAuthenticationAny } from '../../../middleware/oauthMiddleware';
33
import { requireTeamPermission } from '../../../middleware/roleMiddleware';
44
import { McpUserConfigurationService } from '../../../services/mcpUserConfigurationService';
55
import { getDb } from '../../../db';

0 commit comments

Comments
 (0)