proctor-mcp-server 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proctor-mcp-server",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Local implementation of Proctor MCP server",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
@@ -20,6 +20,9 @@ export async function* runExam(apiKey, baseUrl, params) {
20
20
  if (params.max_retries !== undefined) {
21
21
  body.max_retries = params.max_retries;
22
22
  }
23
+ if (params.preloaded_credentials) {
24
+ body.preloaded_credentials = params.preloaded_credentials;
25
+ }
23
26
  const response = await fetch(url.toString(), {
24
27
  method: 'POST',
25
28
  headers: {
@@ -30,6 +30,34 @@ export declare function runExam(_server: Server, clientFactory: ClientFactory):
30
30
  type: string;
31
31
  description: "Maximum number of retry attempts (0-10). Default is 0.";
32
32
  };
33
+ preloaded_credentials: {
34
+ type: string;
35
+ description: "Optional pre-loaded OAuth credentials for servers that require authentication.\n\nWhen provided, these credentials are passed to proctor-mcp-client which loads them into its credential store before connecting to the server. This allows testing OAuth-protected servers without requiring interactive login.\n\n**Example:**\n```json\n{\n \"server_key\": \"remotes[0]\",\n \"access_token\": \"eyJhbGciOiJSUzI1NiIs...\",\n \"refresh_token\": \"dGhpcyBpcyBhIHJlZnJl...\",\n \"token_endpoint\": \"https://auth.example.com/oauth/token\",\n \"client_id\": \"abc123\",\n \"client_secret\": \"secret\",\n \"expires_at\": \"2024-12-31T23:59:59Z\"\n}\n```\n\n**Fields:**\n- server_key (required): Server key from mcp.json (e.g., \"remotes[0]\")\n- access_token (required): OAuth access token\n- refresh_token: OAuth refresh token for token renewal\n- token_endpoint: URL for token refresh operations\n- client_id: OAuth client ID\n- client_secret: OAuth client secret\n- expires_at: ISO 8601 timestamp when the access token expires";
36
+ properties: {
37
+ server_key: {
38
+ type: string;
39
+ };
40
+ access_token: {
41
+ type: string;
42
+ };
43
+ refresh_token: {
44
+ type: string;
45
+ };
46
+ token_endpoint: {
47
+ type: string;
48
+ };
49
+ client_id: {
50
+ type: string;
51
+ };
52
+ client_secret: {
53
+ type: string;
54
+ };
55
+ expires_at: {
56
+ type: string;
57
+ };
58
+ };
59
+ required: string[];
60
+ };
33
61
  };
34
62
  required: string[];
35
63
  };
@@ -75,7 +75,41 @@ These underscore-prefixed fields are stripped from the config before execution a
75
75
  The server.json follows the server.json specification and can include: name, title, description, version, websiteUrl, remotes (with url, type, headers), and packages (for stdio servers with identifier, registryType, runtimeHint, environmentVariables, runtimeArguments).`,
76
76
  custom_runtime_image: 'Required if runtime_id is "__custom__". Docker image URL in format: registry/image:tag',
77
77
  max_retries: 'Maximum number of retry attempts (0-10). Default is 0.',
78
+ preloaded_credentials: `Optional pre-loaded OAuth credentials for servers that require authentication.
79
+
80
+ When provided, these credentials are passed to proctor-mcp-client which loads them into its credential store before connecting to the server. This allows testing OAuth-protected servers without requiring interactive login.
81
+
82
+ **Example:**
83
+ \`\`\`json
84
+ {
85
+ "server_key": "remotes[0]",
86
+ "access_token": "eyJhbGciOiJSUzI1NiIs...",
87
+ "refresh_token": "dGhpcyBpcyBhIHJlZnJl...",
88
+ "token_endpoint": "https://auth.example.com/oauth/token",
89
+ "client_id": "abc123",
90
+ "client_secret": "secret",
91
+ "expires_at": "2024-12-31T23:59:59Z"
92
+ }
93
+ \`\`\`
94
+
95
+ **Fields:**
96
+ - server_key (required): Server key from mcp.json (e.g., "remotes[0]")
97
+ - access_token (required): OAuth access token
98
+ - refresh_token: OAuth refresh token for token renewal
99
+ - token_endpoint: URL for token refresh operations
100
+ - client_id: OAuth client ID
101
+ - client_secret: OAuth client secret
102
+ - expires_at: ISO 8601 timestamp when the access token expires`,
78
103
  };
104
+ const PreloadedCredentialsSchema = z.object({
105
+ server_key: z.string().min(1),
106
+ access_token: z.string().min(1),
107
+ refresh_token: z.string().optional(),
108
+ token_endpoint: z.string().optional(),
109
+ client_id: z.string().optional(),
110
+ client_secret: z.string().optional(),
111
+ expires_at: z.string().optional(),
112
+ });
79
113
  const RunExamSchema = z.object({
80
114
  runtime_id: z.string().min(1).describe(PARAM_DESCRIPTIONS.runtime_id),
81
115
  exam_id: z.string().min(1).describe(PARAM_DESCRIPTIONS.exam_id),
@@ -83,6 +117,7 @@ const RunExamSchema = z.object({
83
117
  server_json: z.string().optional().describe(PARAM_DESCRIPTIONS.server_json),
84
118
  custom_runtime_image: z.string().optional().describe(PARAM_DESCRIPTIONS.custom_runtime_image),
85
119
  max_retries: z.number().min(0).max(10).optional().describe(PARAM_DESCRIPTIONS.max_retries),
120
+ preloaded_credentials: PreloadedCredentialsSchema.optional().describe(PARAM_DESCRIPTIONS.preloaded_credentials),
86
121
  });
87
122
  export function runExam(_server, clientFactory) {
88
123
  return {
@@ -142,6 +177,20 @@ The mcp_json parameter accepts a JSON object with server configurations. Each se
142
177
  type: 'number',
143
178
  description: PARAM_DESCRIPTIONS.max_retries,
144
179
  },
180
+ preloaded_credentials: {
181
+ type: 'object',
182
+ description: PARAM_DESCRIPTIONS.preloaded_credentials,
183
+ properties: {
184
+ server_key: { type: 'string' },
185
+ access_token: { type: 'string' },
186
+ refresh_token: { type: 'string' },
187
+ token_endpoint: { type: 'string' },
188
+ client_id: { type: 'string' },
189
+ client_secret: { type: 'string' },
190
+ expires_at: { type: 'string' },
191
+ },
192
+ required: ['server_key', 'access_token'],
193
+ },
145
194
  },
146
195
  required: ['runtime_id', 'exam_id', 'mcp_json'],
147
196
  },
@@ -187,6 +236,7 @@ The mcp_json parameter accepts a JSON object with server configurations. Each se
187
236
  server_json: validatedArgs.server_json,
188
237
  custom_runtime_image: validatedArgs.custom_runtime_image,
189
238
  max_retries: validatedArgs.max_retries,
239
+ preloaded_credentials: validatedArgs.preloaded_credentials,
190
240
  })) {
191
241
  if (entry.type === 'log') {
192
242
  const logData = entry.data;
package/shared/types.d.ts CHANGED
@@ -71,6 +71,12 @@ export interface RunExamParams {
71
71
  server_json?: string;
72
72
  custom_runtime_image?: string;
73
73
  max_retries?: number;
74
+ /**
75
+ * Pre-loaded OAuth credentials for servers that require authentication.
76
+ * When provided, these credentials are passed to proctor-mcp-client which
77
+ * loads them into its credential store before connecting to the server.
78
+ */
79
+ preloaded_credentials?: PreloadedCredentials;
74
80
  /**
75
81
  * When true, OAuth credentials obtained via web bridge are not persisted in the database.
76
82
  * Instead, the user receives a one-time copy-to-clipboard page with their credentials.
@@ -117,4 +123,25 @@ export interface CancelExamResponse {
117
123
  export interface ApiError {
118
124
  error: string;
119
125
  }
126
+ /**
127
+ * Pre-loaded OAuth credentials for a server.
128
+ * These credentials are injected into the proctor-mcp-client before exam execution,
129
+ * allowing OAuth-protected servers to be tested without requiring interactive login.
130
+ */
131
+ export interface PreloadedCredentials {
132
+ /** Server key from mcp.json (e.g., "remotes[0]") */
133
+ server_key: string;
134
+ /** OAuth access token */
135
+ access_token: string;
136
+ /** OAuth refresh token (if available) */
137
+ refresh_token?: string;
138
+ /** Token endpoint URL for refresh operations */
139
+ token_endpoint?: string;
140
+ /** OAuth client ID */
141
+ client_id?: string;
142
+ /** OAuth client secret (if applicable) */
143
+ client_secret?: string;
144
+ /** ISO 8601 timestamp when the access token expires */
145
+ expires_at?: string;
146
+ }
120
147
  //# sourceMappingURL=types.d.ts.map