@alpic-ai/api 0.0.0-staging.ffd67d5 → 0.0.0-staging.g07a9dac

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/dist/index.mjs CHANGED
@@ -1,72 +1,17 @@
1
+ import { z } from "zod";
1
2
  import { oc } from "@orpc/contract";
2
3
  import ms from "ms";
3
- import { z } from "zod";
4
- //#region src/schemas.ts
5
- const RESERVED_KEYS = [
6
- "_HANDLER",
7
- "_X_AMZN_TRACE_ID",
8
- "AWS_DEFAULT_REGION",
9
- "AWS_REGION",
10
- "AWS_EXECUTION_ENV",
11
- "AWS_LAMBDA_FUNCTION_NAME",
12
- "AWS_LAMBDA_FUNCTION_MEMORY_SIZE",
13
- "AWS_LAMBDA_FUNCTION_VERSION",
14
- "AWS_LAMBDA_INITIALIZATION_TYPE",
15
- "AWS_LAMBDA_LOG_GROUP_NAME",
16
- "AWS_LAMBDA_LOG_STREAM_NAME",
17
- "AWS_ACCESS_KEY",
18
- "AWS_ACCESS_KEY_ID",
19
- "AWS_SECRET_ACCESS_KEY",
20
- "AWS_SESSION_TOKEN",
21
- "AWS_LAMBDA_RUNTIME_API",
22
- "LAMBDA_TASK_ROOT",
23
- "LAMBDA_RUNTIME_DIR",
24
- "START_COMMAND",
25
- "ENVIRONMENT_ID",
26
- "PROJECT_BUILD_IMAGES_REPOSITORY_URI",
27
- "ENVIRONMENT_LAMBDA_FUNCTION_ARN",
28
- "SOURCE_REPOSITORY",
29
- "SOURCE_BRANCH",
30
- "SOURCE_REPOSITORY_CREDENTIALS",
31
- "RUNTIME",
32
- "ROOT_DIRECTORY",
33
- "BUILD_ARG_INSTALL_COMMAND",
34
- "BUILD_ARG_BUILD_COMMAND",
35
- "BUILD_ARG_BUILD_OUTPUT_DIR",
36
- "BUILD_ARG_START_COMMAND",
37
- "ALPIC_HOST",
38
- "ALPIC_CUSTOM_DOMAINS"
39
- ];
40
- const environmentVariableSchema = z.object({
41
- key: z.string().min(2, "Key must be at least 2 characters").regex(/^[a-zA-Z]([a-zA-Z0-9_])+$/, "Key must start with a letter and contain only letters, numbers, and underscores").refine((key) => !RESERVED_KEYS.includes(key), "This key is reserved and cannot be used as an environment variable key"),
42
- value: z.string().min(1, "Value is required"),
43
- isSecret: z.boolean().default(false)
44
- });
45
- const environmentVariablesSchema = z.array(environmentVariableSchema);
46
- const buildSettingsSchema = z.object({
47
- installCommand: z.string().optional(),
48
- buildCommand: z.string().optional(),
49
- buildOutputDir: z.string().optional(),
50
- startCommand: z.string().optional()
51
- });
52
- const runtimeSchema = z.enum([
53
- "python3.13",
54
- "python3.14",
55
- "node22",
56
- "node24"
57
- ]);
58
- const transportSchema = z.enum([
59
- "stdio",
60
- "sse",
61
- "streamablehttp"
62
- ]);
63
- const analysisStatusSchema = z.enum([
4
+ const platformSchema = z.enum(["chatgpt", "claudeai"]);
5
+ const PLATFORM_LABELS = {
6
+ chatgpt: "ChatGPT",
7
+ claudeai: "Claude.ai"
8
+ };
9
+ const auditStatusSchema = z.enum([
64
10
  "pending",
65
11
  "partial",
66
12
  "completed",
67
13
  "failed"
68
14
  ]);
69
- const platformSchema = z.enum(["chatgpt", "claudeai"]);
70
15
  const checkSeveritySchema = z.enum([
71
16
  "error",
72
17
  "warning",
@@ -86,6 +31,8 @@ const checkDetailSchema = z.object({
86
31
  });
87
32
  const checkResultSchema = z.object({
88
33
  checkId: z.string(),
34
+ checkName: z.string(),
35
+ description: z.string(),
89
36
  status: z.enum([
90
37
  "pass",
91
38
  "fail",
@@ -117,12 +64,529 @@ const auditReportSchema = z.object({
117
64
  widgetScreenshotKeys: z.object({
118
65
  chatgpt: z.string().optional(),
119
66
  claudeai: z.string().optional()
120
- }).optional(),
121
- widgetScreenshots: z.object({
122
- chatgpt: z.object({ url: z.string() }).optional(),
123
- claudeai: z.object({ url: z.string() }).optional()
67
+ })
68
+ });
69
+ const widgetScreenshotSchema = z.object({ url: z.string() });
70
+ const auditReportWithScreenshotsSchema = auditReportSchema.extend({ widgetScreenshots: z.object({
71
+ chatgpt: widgetScreenshotSchema.optional(),
72
+ claudeai: widgetScreenshotSchema.optional()
73
+ }) });
74
+ z.enum([
75
+ "ongoing",
76
+ "deployed",
77
+ "failed",
78
+ "canceled"
79
+ ]);
80
+ z.object({
81
+ timestamp: z.coerce.date().optional(),
82
+ content: z.string().optional()
83
+ });
84
+ z.object({
85
+ id: z.string(),
86
+ createdAt: z.coerce.date(),
87
+ environmentId: z.string(),
88
+ content: z.string(),
89
+ source: z.enum(["model", "user"])
90
+ });
91
+ z.object({
92
+ content: z.string(),
93
+ source: z.enum(["model", "user"])
94
+ });
95
+ const intentCategoryColorSchema = z.enum([
96
+ "red",
97
+ "orange",
98
+ "yellow",
99
+ "green",
100
+ "blue",
101
+ "purple",
102
+ "pink",
103
+ "gray"
104
+ ]);
105
+ intentCategoryColorSchema.options;
106
+ const intentCategorySchema = z.object({
107
+ id: z.string(),
108
+ createdAt: z.coerce.date(),
109
+ environmentId: z.string(),
110
+ name: z.string(),
111
+ color: intentCategoryColorSchema
112
+ });
113
+ z.object({
114
+ id: z.string(),
115
+ name: z.string(),
116
+ color: intentCategoryColorSchema,
117
+ intentCount: z.number().int().nonnegative()
118
+ });
119
+ z.object({
120
+ id: z.string(),
121
+ createdAt: z.coerce.date(),
122
+ environmentId: z.string(),
123
+ toolName: z.string(),
124
+ message: z.string(),
125
+ categories: z.array(intentCategorySchema)
126
+ });
127
+ const signalCategorySchema = z.object({
128
+ id: z.string(),
129
+ name: z.string(),
130
+ color: intentCategoryColorSchema
131
+ });
132
+ z.discriminatedUnion("kind", [
133
+ z.object({
134
+ kind: z.literal("new"),
135
+ category: signalCategorySchema,
136
+ currentCount: z.number().int().nonnegative(),
137
+ currentShare: z.number()
138
+ }),
139
+ z.object({
140
+ kind: z.literal("resurging"),
141
+ category: signalCategorySchema,
142
+ currentCount: z.number().int().nonnegative(),
143
+ daysQuiet: z.number(),
144
+ currentShare: z.number()
145
+ }),
146
+ z.object({
147
+ kind: z.literal("spike"),
148
+ category: signalCategorySchema,
149
+ currentCount: z.number().int().nonnegative(),
150
+ previousCount: z.number().int().nonnegative(),
151
+ currentShare: z.number(),
152
+ previousShare: z.number(),
153
+ changeRatio: z.number()
154
+ }),
155
+ z.object({
156
+ kind: z.literal("declining"),
157
+ category: signalCategorySchema,
158
+ currentCount: z.number().int().nonnegative(),
159
+ previousCount: z.number().int().nonnegative(),
160
+ currentShare: z.number(),
161
+ previousShare: z.number(),
162
+ changeRatio: z.number()
163
+ })
164
+ ]);
165
+ z.discriminatedUnion("kind", [z.object({
166
+ kind: z.literal("existing"),
167
+ categoryId: z.string(),
168
+ categoryName: z.string(),
169
+ intentIds: z.array(z.string())
170
+ }), z.object({
171
+ kind: z.literal("new"),
172
+ categoryName: z.string(),
173
+ intentIds: z.array(z.string())
174
+ })]);
175
+ z.object({
176
+ id: z.string(),
177
+ teamId: z.string(),
178
+ email: z.string(),
179
+ expiresAt: z.coerce.date(),
180
+ createdAt: z.coerce.date(),
181
+ updatedAt: z.coerce.date()
182
+ });
183
+ z.enum([
184
+ "INFO",
185
+ "WARNING",
186
+ "DEBUG",
187
+ "ERROR"
188
+ ]);
189
+ const runtimeSchema = z.enum([
190
+ "python3.13",
191
+ "python3.14",
192
+ "node22",
193
+ "node24"
194
+ ]);
195
+ const transportSchema = z.enum([
196
+ "stdio",
197
+ "sse",
198
+ "streamablehttp"
199
+ ]);
200
+ const toolDefinitionSchema = z.object({
201
+ name: z.string(),
202
+ title: z.string().optional().describe("Human-friendly name for the tool, used in the UI. If not provided, `name` will be used."),
203
+ description: z.string().optional(),
204
+ annotations: z.object({
205
+ readOnlyHint: z.boolean().optional(),
206
+ destructiveHint: z.boolean().optional(),
207
+ openWorldHint: z.boolean().optional(),
208
+ idempotentHint: z.boolean().optional()
124
209
  }).optional()
125
210
  });
211
+ const positiveTestCaseSchema = z.object({
212
+ scenario: z.string(),
213
+ userPrompt: z.string(),
214
+ toolTriggered: z.string().optional(),
215
+ expectedOutput: z.string().optional()
216
+ }).partial().describe("Each case: Scenario, User prompt, Tool triggered, Expected output.");
217
+ /** Accepts either a valid email or URL. */
218
+ const supportChannelSchema = z.string().refine((value) => z.email().safeParse(value).success || z.url().safeParse(value).success, { error: "Must be a valid email or URL" });
219
+ const chatgptCategorySchema = z.enum([
220
+ "BUSINESS",
221
+ "COLLABORATION",
222
+ "DESIGN",
223
+ "DEVELOPER_TOOLS",
224
+ "EDUCATION",
225
+ "ENTERTAINMENT",
226
+ "FINANCE",
227
+ "FOOD",
228
+ "LIFESTYLE",
229
+ "NEWS",
230
+ "PRODUCTIVITY",
231
+ "SHOPPING",
232
+ "TRAVEL"
233
+ ]);
234
+ const chatgptAuthenticationSchema = z.enum(["No auth needed", "OAuth 2.0"]);
235
+ const chatgptAllowedCountriesSchema = z.enum(["Allow all", "Restrict to specific countries"]);
236
+ const negativeTestCaseSchema = z.object({
237
+ scenario: z.string(),
238
+ userPrompt: z.string()
239
+ }).partial().describe("Each case: Scenario + User prompt (the app should NOT trigger).");
240
+ const chatgptToolJustificationSchema = z.object({
241
+ toolName: z.string(),
242
+ readOnlyJustification: z.string(),
243
+ openWorldJustification: z.string(),
244
+ destructiveJustification: z.string()
245
+ }).describe("Per-tool justification of each MCP annotation value (one sentence per hint).");
246
+ const chatgptTranslationSchema = z.object({
247
+ locale: z.string(),
248
+ tagline: z.string().optional(),
249
+ description: z.string().optional()
250
+ }).describe("Locale-scoped override for tagline + description. English (US) is the default.");
251
+ /**
252
+ * Field order mirrors the ChatGPT (OpenAI) submission spreadsheet, grouped by section.
253
+ * When adding/removing/reordering fields, keep this in sync with the sheet.
254
+ */
255
+ const chatgptSubmissionFormDataSchema = z.object({
256
+ logoLight: z.string().describe("Logo icon for light mode. Square PNG, no borders or rounded corners (clients apply circular cropping)."),
257
+ logoDark: z.string().describe("Logo icon for dark mode. Square PNG. Same specs as the light icon."),
258
+ appName: z.string().describe("The name users will see in ChatGPT and in the Apps Directory."),
259
+ tagline: z.string().max(30).describe("Plain-language phrase focused on function and user value. 30 chars max."),
260
+ description: z.string().describe("Clear, engaging description highlighting what the app does and why people will love it. Appears publicly on the directory page."),
261
+ category: chatgptCategorySchema.describe("Category from the OpenAI taxonomy."),
262
+ developerName: z.string().describe("Developer name shown publicly on the app's directory page."),
263
+ companyUrl: z.url().describe("Your company's main website URL."),
264
+ supportChannel: supportChannelSchema.describe("Customer support URL or email address."),
265
+ privacyPolicyUrl: z.url().describe("URL to your privacy policy."),
266
+ termsOfServiceUrl: z.url().describe("URL to the app's terms of service."),
267
+ demoRecordingUrl: z.url().describe("URL to a video demonstrating the app, recorded via OpenAI Developer Mode. Cover all main use cases on web, iOS, and Android."),
268
+ appCommerceAndPurchasing: z.boolean().describe("Checkbox: 'My app links or directs users out of ChatGPT to make purchases.' Defaults to false. Verify the app does not offer digital goods."),
269
+ serverUrl: z.url().describe("URL of the MCP server."),
270
+ authentication: chatgptAuthenticationSchema.describe("OAuth 2.0 or No auth. OAuth configuration is auto-discovered from the MCP server's metadata."),
271
+ tools: z.array(toolDefinitionSchema).describe("List of tools exposed by the MCP server (auto-populated from the production server's manifest)."),
272
+ toolJustifications: z.array(chatgptToolJustificationSchema).describe("Per-tool justification of `readOnlyHint`, `openWorldHint`, and `destructiveHint` annotation values."),
273
+ testCases: z.array(positiveTestCaseSchema).describe("At least 5 positive test cases. Each: Scenario, User prompt, Tool triggered, Expected output. Coverage over all major use cases."),
274
+ negativeTestCases: z.array(negativeTestCaseSchema).describe("3 negative test cases — prompts where the app should NOT trigger but the model might think it's relevant."),
275
+ screenshots: z.array(z.url()).describe("URLs of in-app screenshots. Widget apps must show the widget UI; non-widget apps show the model response. Min 1, max 4. First three are public."),
276
+ translations: z.array(chatgptTranslationSchema).describe("Per-locale translation of tagline + description. English (US) is the default."),
277
+ allowedCountries: chatgptAllowedCountriesSchema.describe("'Allow all' or restrict to a specific list. See OpenAI's supported countries list."),
278
+ releaseNotes: z.string().describe("Publicly displayed on the app details page.")
279
+ });
280
+ chatgptSubmissionFormDataSchema.pick({
281
+ appName: true,
282
+ developerName: true,
283
+ serverUrl: true,
284
+ tools: true,
285
+ authentication: true
286
+ });
287
+ chatgptSubmissionFormDataSchema.pick({
288
+ tagline: true,
289
+ description: true,
290
+ category: true,
291
+ testCases: true,
292
+ negativeTestCases: true,
293
+ toolJustifications: true
294
+ });
295
+ const claudeCategorySchema = z.enum([
296
+ "Business & Productivity",
297
+ "Communication",
298
+ "Data & Analytics",
299
+ "Development tools",
300
+ "Financial Services",
301
+ "Consumer Health",
302
+ "Health & Life Sciences",
303
+ "Media & Entertainment",
304
+ "Commerce & Shopping"
305
+ ]);
306
+ z.enum([
307
+ "No auth needed",
308
+ "OAuth 2.0",
309
+ "Custom URL"
310
+ ]);
311
+ const claudeMcpUrlTypeSchema = z.enum(["Universal URL", "Custom MCP URLs"]);
312
+ z.enum(["Static OAuth Client", "Dynamic OAuth Client (DCR / CIMD)"]);
313
+ const claudeReadWriteCapabilitiesSchema = z.enum([
314
+ "Read only",
315
+ "Write only",
316
+ "Read + write"
317
+ ]);
318
+ const claudeTransportSchema = z.enum(["Streamable HTTP", "SSE"]);
319
+ const claudeThirdPartySchema = z.enum([
320
+ "Web access (open web fetch / scraping / arbitrary URLs)",
321
+ "Third-party AI model integration",
322
+ "Third-party data retrieval (via workflow / aggregator)",
323
+ "Third-party data modification (via workflow / aggregator)",
324
+ "N/A"
325
+ ]);
326
+ const claudeDataHandlingSchema = z.enum([
327
+ "Server only accesses data explicitly requested by user",
328
+ "No data is stored beyond session requirements",
329
+ "Data transmission is encrypted (HTTPS / TLS)",
330
+ "GDPR compliant (if applicable)"
331
+ ]);
332
+ const claudeSponsoredContentSchema = z.enum([
333
+ "No, there is no sponsored content or advertisements",
334
+ "Yes, there are banner ads or other paid visual elements",
335
+ "Yes, returned content or ranking is impacted by sponsorship or ad placement"
336
+ ]);
337
+ /**
338
+ * Field order mirrors the Claude (Anthropic) submission spreadsheet, grouped by section.
339
+ * When adding/removing/reordering fields, keep this in sync with the sheet.
340
+ */
341
+ const claudeSubmissionFormDataSchema = z.object({
342
+ companyName: z.string().describe("Enter your company's legal name or the name under which your product is publicly known. This is used for internal tracking and may appear in directory listings."),
343
+ companyUrl: z.url().describe("Your company's main website URL, e.g. https://mycompany.com. Must be a valid URL with https://. This should be the root domain of the company behind this MCP server."),
344
+ primaryContactName: z.string().describe("Full name of the person Anthropic should contact about this submission. This person will receive review feedback, approval notices, and any follow-up questions."),
345
+ primaryContactEmail: z.email().describe("Business email for the primary contact. Must be a valid email address. Anthropic uses this to communicate about your submission status, required changes, and post-listing issues. Avoid using personal email addresses."),
346
+ primaryContactRole: z.string().optional().describe("The job title or role of the primary contact (e.g. 'CTO', 'Developer Relations Lead', 'Founder'). Optional but helps Anthropic route questions to the right person."),
347
+ anthropicPointOfContact: z.string().optional().describe("If you have a direct contact at Anthropic (e.g. from a partnership or sales conversation), enter their name here. This is optional but can greatly help expedite the review process. Leave blank if you don't have one."),
348
+ appName: z.string().describe(`The public display name for your connector as it will appear in the Connectors Directory.
349
+
350
+ Rules:
351
+ (1) Do NOT include the words 'MCP' or 'Server' — these are auto-rejected.
352
+ (2) Use your brand/product name, e.g. 'Notion', 'Linear', 'Slack'.
353
+ (3) You must own or have the right to use this brand name. For example, don't call it 'Google Drive Helper' if you're not Google.`),
354
+ mcpUrlType: claudeMcpUrlTypeSchema.describe(`Choose how your server URL works:
355
+ • 'Universal URL': one single URL that all users connect to (most common). Example: https://mcp.myapp.com
356
+ • 'Custom MCP URLs': each user gets their own unique URL (e.g. based on their workspace or instance).
357
+ If you choose this, you'll need to provide both a signup URL and a regex pattern that matches valid server URLs for your service.`),
358
+ serverUrl: z.url().describe(`If 'Universal URL': enter the full https:// URL where your MCP server is hosted and reachable. Example: https://mcp.myapp.com/
359
+ If 'Custom MCP URLs': provide (1) the signup/onboarding URL where users create an account, and (2) a regex pattern that matches all valid server URLs for your service (e.g. https://[a-z0-9-]+\\.myapp\\.com/mcp). The server must be publicly accessible without VPN or whitelisting required.`),
360
+ tagline: z.string().max(55).describe(`A very short, punchy description shown below your server name in the directory listing. Max 55 characters including spaces.
361
+ Think of it as a subtitle or elevator pitch fragment. Example: 'Manage tasks and projects in Linear' or 'Search and read your Notion workspace'. Avoid generic phrases like 'The best MCP server for...'`),
362
+ description: z.string().describe(`A 50–100 word description of what your MCP server does. This appears in the connector's detail page inside Claude. Write it from a user perspective: what can users do with this connector? What are the key features/tools? Avoid marketing fluff. Be specific. Example: 'Connect Claude to your Linear workspace. Create and update issues, search projects, manage teams, and track engineering cycles, all from within Claude.' Anthropic reviewers check this for accuracy against your actual tools.`),
363
+ testCases: z.array(positiveTestCaseSchema).describe(`Provide at least 3 concrete use cases, each with an example prompt a user could type to Claude. These are critical: Anthropic reviewers literally test your server using these prompts. Good examples are specific and demonstrate real value.
364
+ Best format: [Use case]: [exact prompt]"
365
+ Example for a task manager:
366
+ 1. Create a task: 'Create a task called Review Q3 report, due Friday, assigned to Alice'
367
+ 2. Search tasks: 'Show me all open bugs in the Mobile project'
368
+ 3. Update status: 'Mark the Deploy v2.1 task as done'"`),
369
+ connectionRequirements: z.string().describe(`Describe any prerequisites a user must have before they can connect your server. Be exhaustive. Examples of things to mention:
370
+ • Account type required (free vs paid plan)
371
+ • Admin permissions or specific roles needed
372
+ • Geographic restrictions (e.g. 'US only' or 'Not available in EU')
373
+ • If users need to provide their own server URL or instance domain
374
+ • Any setup steps needed before connecting (e.g. 'Enable API access in your account settings')
375
+ If there are genuinely no special requirements, write exactly: 'No special requirements.'`),
376
+ readWriteCapabilities: claudeReadWriteCapabilitiesSchema.describe(`Select the option that best describes what your server can do:
377
+
378
+ 'Read Only': your tools only fetch/retrieve data (GET operations). Claude cannot modify anything via your server.
379
+ 'Write Only': your tools only create/update/delete data (rare).
380
+ 'Read + Write': your tools can both retrieve AND modify data (most common for full-featured connectors).
381
+
382
+ Note: Anthropic rejects catch-all tools that accept both safe (GET) and unsafe (POST, PUT, DELETE) HTTP methods via a parameter e.g. a single api_request(method, endpoint) tool. Each tool should have a fixed, specific purpose. `),
383
+ isMcpApp: z.boolean().describe(`Select 'Yes' if your MCP server renders interactive UI elements (aka widgets or views) inside the Claude conversation.
384
+ Select 'No' if your server only returns text/data responses.
385
+ If 'Yes', you will also be required to provide screenshots of your UI (see Promotional Images section). MCP Apps are displayed with a special badge in the directory.`),
386
+ thirdPartyConnectionsAndWebAccess: z.array(claudeThirdPartySchema).describe(`Multi-select all that apply to your server's behavior:
387
+ • 'Web access' — your server fetches arbitrary URLs, scrapes websites, or makes open-ended HTTP requests to the web (not just your own API).
388
+ • 'Third-party AI model integration' — your server calls another AI model (e.g. OpenAI, Gemini, Cohere) as part of its processing.
389
+ • 'Third-party data retrieval' — your server retrieves data via a workflow or aggregator platform (e.g. Zapier, Make, n8n) rather than calling your own API directly.
390
+ • 'Third-party data modification' — your server modifies data via such a platform.
391
+ • 'N/A' — your server only calls your own first-party API and does nothing else. Select this only if none of the above apply.`),
392
+ dataHandling: z.array(claudeDataHandlingSchema).describe(`Multi-select all data handling practices that accurately apply to your server. You must select at least 3. Key points:
393
+ • 'Server only accesses data explicitly requested by user' — your server doesn't silently read unrelated user data.
394
+ • 'No data is stored beyond session requirements' — you don't log or retain conversation data after the session.
395
+ • 'Data transmission is encrypted (HTTPS/TLS)' — all data in transit is encrypted. This should always apply for remote servers.
396
+ • 'GDPR compliant' — if you operate in the EU or serve EU users, check this only if you are genuinely compliant. Don't check it without having proper data processing agreements and procedures in place.
397
+ Note: These are attestations — you are legally agreeing to these practices by submitting the form.`),
398
+ personalDataHealthAccess: z.boolean().describe(`Select 'Yes' ONLY if your connector gives users access to their own personal health information — such as medical records, lab results, diagnoses, prescriptions, wearable health metrics (heart rate, sleep data, etc.), or mental health data.
399
+ Select 'No' for the vast majority of business/productivity/dev tools. When in doubt, select 'No'. This field triggers additional compliance review if 'Yes'.`),
400
+ categories: z.array(claudeCategorySchema).describe(`Select the category or categories that best describe your connector. This determines where it appears in the directory's browse experience. Choose the most specific fit:
401
+ • Business & Productivity — project management, CRM, HR, office tools
402
+ • Communication — email, chat, messaging, notifications
403
+ • Data & Analytics — dashboards, reporting, databases, BI tools
404
+ • Development tools — code repositories, CI/CD, issue trackers, monitoring
405
+ • Financial Services — accounting, invoicing, fintech (note: financial transaction execution is not permitted)
406
+ • Consumer Health — fitness, wellness, personal health tracking
407
+ • Health & Life Sciences — clinical, pharma, medical professional tools
408
+ • Media & Entertainment — content, publishing, streaming
409
+ • Commerce & Shopping — e-commerce, inventory, orders
410
+ Multiple categories are allowed if genuinely applicable.`),
411
+ sponsoredContentsOrAdvertisement: claudeSponsoredContentSchema.describe(`Be honest here — advertising is not permitted in the Connectors Directory per Anthropic's policy. Select the option that accurately describes your server:
412
+ • 'No, there is no sponsored content or advertisements' — the results your server returns are not influenced by paid placement or sponsorship. This is what almost all connectors should select.
413
+ • 'Yes, there are banner ads or other paid visual elements' — your UI includes visual ads. NOTE: this will likely lead to rejection, as Anthropic prohibits advertising in Claude.
414
+ • 'Yes, the returned content or ranking of returned content is impacted by sponsorship or ad placement' — paid results affect what you return. NOTE: this also likely leads to rejection.
415
+ If your server returns organic results from a platform that has ads in its own UI (but your API results are not affected by ads), select 'No'.`),
416
+ transportSupport: z.array(claudeTransportSchema).describe(`Select all transport protocols your server supports:
417
+ • 'Streamable HTTP' — the modern, recommended transport. Anthropic strongly recommends implementing this. This is the future-proof option and should be your default.
418
+ • 'SSE (Server-Sent Events)' — the older transport. SSE may be deprecated by Anthropic later in 2025/2026. If you currently only support SSE, you should plan to migrate to Streamable HTTP.
419
+ If you support both, select both. If you're building from scratch, implement Streamable HTTP only.`),
420
+ serverDocumentationLink: z.url().describe(`A public URL pointing to documentation that helps users understand and use your connector. This is displayed in the Directory listing and must be publicly accessible without login. Minimum requirements for the docs page:
421
+ • What the connector does and its key capabilities
422
+ • How to connect/set it up (step by step)
423
+ • What each tool does (or at least the main ones)
424
+ • How to troubleshoot common issues
425
+ • A support contact or channel
426
+ Acceptable formats: a dedicated docs page, a help center article, a README on GitHub, or a blog post — as long as it's comprehensive. Note: Anthropic requires public documentation to be live by your publish date.`),
427
+ privacyPolicyUrl: z.url().describe(`URL to your privacy policy. This is mandatory and displayed in the directory listing. Missing or incomplete privacy policies result in immediate rejection. Your privacy policy must cover:
428
+ • What data you collect (and how)
429
+ • How you use the collected data
430
+ • Where and how long you store it
431
+ • Whether you share data with third parties (and who)
432
+ • How users can contact you about data concerns
433
+ The policy must be publicly accessible. If you don't have one yet, create one before submitting — there are free generators online, but make sure it accurately reflects your actual practices. If you're GDPR-compliant, your policy should reflect that.`),
434
+ supportChannel: supportChannelSchema.describe(`A URL or email address where users can get help with your connector. This is displayed in the Directory listing. Acceptable options:
435
+ • Email address (e.g. support@myapp.com)
436
+ • Link to a GitHub Issues page
437
+ • Link to a help center or support article
438
+ • Link to a Discord/Slack community
439
+ • Link to your documentation's troubleshooting section
440
+ Also uses this to notify you of security or compliance issues, so make sure it's actively monitored.`),
441
+ testingCredentials: z.string().describe(`Provide login credentials for a test account that Anthropic reviewers can use to verify your server works end-to-end. Critical requirements:
442
+ • The account must have sample/demo data loaded — reviewers need to actually test your tools with real data.
443
+ • No 2FA — reviewers can't receive SMS codes. Disable 2FA on this account.
444
+ • If your service uses Google OAuth or another OAuth that requires email verification, use mcp-review@anthropic.com as the account email — Anthropic has access to this inbox.
445
+ • Credentials must remain valid for at least 30 days from submission.
446
+ • If your service requires API keys instead of a password, provide those.
447
+ Format suggestion: Username/email: xxx | Password: xxx | Any other notes`),
448
+ tools: z.array(toolDefinitionSchema).describe(`A comma-separated list of all tools your MCP server exposes. Use the format: tool_name (Human-Readable Name). The tool_name is the internal identifier (snake_case, max 64 characters). The Human-Readable Name is what users see.
449
+ Example: list_issues (List Issues), create_issue (Create Issue), update_issue (Update Issue), delete_issue (Delete Issue), search_issues (Search Issues)
450
+ Reviewers test every single tool you list here — don't list tools that don't work. Also: do not have a single catch-all tool like api_request(method, endpoint) — Anthropic rejects these. Each action should be its own purpose-built tool.`),
451
+ toolTitlesAnnotationsConfirmed: z.boolean().describe(`This is a compliance confirmation — check both boxes only if you have actually implemented these in your server code:
452
+ • 'I've specified user-friendly titles for all tools' — every tool has a 'title' annotation (a human-readable label, different from the tool name).
453
+ • 'I've specified accurate tool annotations for all tools' — every tool has the correct annotation: readOnlyHint: true for read operations (search, get, list, fetch), OR destructiveHint: true for write operations (create, update, delete, send).
454
+ This is the #1 reason submissions get rejected (30% of all rejections). Do not check these boxes without actually having implemented the annotations. See MCP spec for how to add them.`),
455
+ logoLight: z.string().describe(`Your connector's logo as displayed in the directory. Requirements:
456
+ • Format: SVG only
457
+ • Aspect ratio: square (1:1)
458
+ • Should work on both light and dark backgrounds (or you can provide separate light/dark versions)
459
+ • Provide via URL (Google Drive link is fine) or upload directly
460
+ Tip: use a simple, recognizable icon — not a full wordmark. The logo appears at small sizes in the directory grid.`),
461
+ screenshots: z.array(z.url()).describe(`Screenshots or promotional images of your connector in action within Claude. Strongly recommended for all connectors, and required for MCP Apps (interactive UI). Guidelines:
462
+ • 3–5 images is ideal
463
+ • Minimum 1000px width, PNG format preferred
464
+ • Crop to just the relevant part of the Claude interface (the tool response area)
465
+ • Show your connector doing something impressive and useful — real data, real results
466
+ • If you're an MCP App, include screenshots of your interactive UI elements
467
+ • Videos are also welcome
468
+ These images appear in your directory listing and are a key factor in driving user installs.`)
469
+ });
470
+ claudeSubmissionFormDataSchema.pick({
471
+ companyName: true,
472
+ appName: true,
473
+ mcpUrlType: true,
474
+ serverUrl: true,
475
+ tools: true,
476
+ readWriteCapabilities: true,
477
+ isMcpApp: true,
478
+ transportSupport: true,
479
+ primaryContactEmail: true,
480
+ primaryContactName: true
481
+ });
482
+ claudeSubmissionFormDataSchema.pick({
483
+ tagline: true,
484
+ description: true,
485
+ categories: true,
486
+ testCases: true
487
+ });
488
+ const submissionMetaFieldsSchema = z.object({
489
+ id: z.string(),
490
+ environmentId: z.string(),
491
+ createdAt: z.coerce.date(),
492
+ updatedAt: z.coerce.date()
493
+ });
494
+ const claudeSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
495
+ platform: z.literal("claudeai"),
496
+ formData: claudeSubmissionFormDataSchema.partial()
497
+ });
498
+ const chatgptSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
499
+ platform: z.literal("chatgpt"),
500
+ formData: chatgptSubmissionFormDataSchema.partial()
501
+ });
502
+ z.discriminatedUnion("platform", [claudeSubmissionSchemaInternal, chatgptSubmissionSchemaInternal]);
503
+ z.union([claudeSubmissionFormDataSchema.partial(), chatgptSubmissionFormDataSchema.partial()]);
504
+ const subscriptionPlanSchema = z.enum([
505
+ "pro",
506
+ "business",
507
+ "enterprise"
508
+ ]);
509
+ z.object({ plan: subscriptionPlanSchema.nullable() });
510
+ const customerCreditsSchema = z.object({
511
+ balanceInCents: z.number(),
512
+ expiresAt: z.number().nullable(),
513
+ currency: z.string()
514
+ });
515
+ const customerUsageSchema = z.object({
516
+ amountInCents: z.number(),
517
+ currency: z.string(),
518
+ periodEnd: z.number()
519
+ });
520
+ const partnerDiscountSchema = z.object({ endsAt: z.number() });
521
+ z.object({
522
+ customerCredits: customerCreditsSchema.nullable(),
523
+ customerUsage: customerUsageSchema.nullable(),
524
+ partnerDiscount: partnerDiscountSchema.nullable()
525
+ });
526
+ //#endregion
527
+ //#region src/schemas.ts
528
+ const RESERVED_KEYS = [
529
+ "_HANDLER",
530
+ "_X_AMZN_TRACE_ID",
531
+ "AWS_DEFAULT_REGION",
532
+ "AWS_REGION",
533
+ "AWS_EXECUTION_ENV",
534
+ "AWS_LAMBDA_FUNCTION_NAME",
535
+ "AWS_LAMBDA_FUNCTION_MEMORY_SIZE",
536
+ "AWS_LAMBDA_FUNCTION_VERSION",
537
+ "AWS_LAMBDA_INITIALIZATION_TYPE",
538
+ "AWS_LAMBDA_LOG_GROUP_NAME",
539
+ "AWS_LAMBDA_LOG_STREAM_NAME",
540
+ "AWS_ACCESS_KEY",
541
+ "AWS_ACCESS_KEY_ID",
542
+ "AWS_SECRET_ACCESS_KEY",
543
+ "AWS_SESSION_TOKEN",
544
+ "AWS_LAMBDA_RUNTIME_API",
545
+ "LAMBDA_TASK_ROOT",
546
+ "LAMBDA_RUNTIME_DIR",
547
+ "START_COMMAND",
548
+ "ENVIRONMENT_ID",
549
+ "PROJECT_BUILD_IMAGES_REPOSITORY_URI",
550
+ "ENVIRONMENT_LAMBDA_FUNCTION_ARN",
551
+ "SOURCE_REPOSITORY",
552
+ "SOURCE_BRANCH",
553
+ "SOURCE_REPOSITORY_CREDENTIALS",
554
+ "RUNTIME",
555
+ "ROOT_DIRECTORY",
556
+ "BUILD_ARG_INSTALL_COMMAND",
557
+ "BUILD_ARG_BUILD_COMMAND",
558
+ "BUILD_ARG_BUILD_OUTPUT_DIR",
559
+ "BUILD_ARG_START_COMMAND",
560
+ "ALPIC_HOST",
561
+ "ALPIC_CUSTOM_DOMAINS",
562
+ "ALPIC_INTENT_META_KEY"
563
+ ];
564
+ const environmentVariableSchema = z.object({
565
+ key: z.string().min(2, "Key must be at least 2 characters").regex(/^[a-zA-Z]([a-zA-Z0-9_])+$/, "Key must start with a letter and contain only letters, numbers, and underscores").refine((key) => !RESERVED_KEYS.includes(key), "This key is reserved and cannot be used as an environment variable key"),
566
+ value: z.string().min(1, "Value is required"),
567
+ isSecret: z.boolean().default(false)
568
+ });
569
+ const environmentVariablesSchema = z.array(environmentVariableSchema);
570
+ const updateEnvironmentVariableSchema = environmentVariableSchema.partial({
571
+ value: true,
572
+ isSecret: true
573
+ });
574
+ const buildSettingsSchema = z.object({
575
+ installCommand: z.string().optional(),
576
+ buildCommand: z.string().optional(),
577
+ buildOutputDir: z.string().optional(),
578
+ startCommand: z.string().optional()
579
+ });
580
+ const playgroundHeaderSchema = z.object({
581
+ name: z.string().min(1).max(100),
582
+ description: z.string().max(200),
583
+ isRequired: z.boolean().default(false),
584
+ isSecret: z.boolean().default(false)
585
+ });
586
+ const playgroundExamplePromptSchema = z.object({
587
+ title: z.string().min(1).max(100),
588
+ prompt: z.string().min(1).max(500)
589
+ });
126
590
  const serverFieldsSchema = z.object({
127
591
  $schema: z.string(),
128
592
  name: z.string(),
@@ -215,7 +679,7 @@ const getEnvironmentContractV1 = oc.route({
215
679
  name: z.string(),
216
680
  sourceBranch: z.string().nullable(),
217
681
  mcpServerUrl: z.string(),
218
- domains: z.array(z.url()),
682
+ domains: z.array(z.hostname()),
219
683
  createdAt: z.coerce.date(),
220
684
  projectId: z.string()
221
685
  }));
@@ -361,7 +825,7 @@ const updateEnvironmentVariableContractV1 = oc.route({
361
825
  environmentVariableId: z.string().describe("The ID of the environment variable"),
362
826
  key: environmentVariableSchema.shape.key,
363
827
  value: environmentVariableSchema.shape.value.optional(),
364
- isSecret: environmentVariableSchema.shape.isSecret
828
+ isSecret: environmentVariableSchema.shape.isSecret.optional()
365
829
  })).output(z.object({ success: z.literal(true) }));
366
830
  const deleteEnvironmentVariableContractV1 = oc.route({
367
831
  path: "/v1/environment-variables/{environmentVariableId}",
@@ -372,7 +836,7 @@ const deleteEnvironmentVariableContractV1 = oc.route({
372
836
  successDescription: "The environment variable has been deleted successfully"
373
837
  }).errors({ NOT_FOUND: {} }).input(z.object({ environmentVariableId: z.string().describe("The ID of the environment variable") })).output(z.object({ success: z.literal(true) }));
374
838
  const deleteProjectContractV1 = oc.route({
375
- path: "/v1/projects/:projectId",
839
+ path: "/v1/projects/{projectId}",
376
840
  method: "DELETE",
377
841
  summary: "Delete a project",
378
842
  description: "Delete a project and all its environments",
@@ -481,6 +945,41 @@ const getLogsContractV1 = oc.route({
481
945
  })),
482
946
  nextToken: z.string().nullable()
483
947
  }));
948
+ const getLatestLogsContractV1 = oc.route({
949
+ path: "/v1/environments/{environmentId}/latest-logs",
950
+ method: "GET",
951
+ summary: "Get latest logs",
952
+ description: "Get the N most recent logs for an environment",
953
+ tags: ["environments"],
954
+ successDescription: "The latest logs"
955
+ }).errors({
956
+ NOT_FOUND: {},
957
+ BAD_REQUEST: {}
958
+ }).input(z.object({
959
+ environmentId: z.string().describe("The ID of the environment"),
960
+ limit: z.coerce.number().int().min(1).max(1e3).default(100).describe("Number of most recent log entries to return"),
961
+ level: z.array(z.enum([
962
+ "INFO",
963
+ "ERROR",
964
+ "WARNING",
965
+ "DEBUG"
966
+ ])).optional().describe("Filter by log level"),
967
+ search: z.string().optional().describe("Filter pattern to search for in log content")
968
+ })).output(z.object({ logs: z.array(z.object({
969
+ timestamp: z.coerce.date(),
970
+ type: z.enum([
971
+ "START",
972
+ "END",
973
+ "INFO",
974
+ "ERROR",
975
+ "WARNING",
976
+ "DEBUG"
977
+ ]),
978
+ requestId: z.string(),
979
+ content: z.string().optional(),
980
+ method: z.string().optional(),
981
+ durationInMs: z.number().optional()
982
+ })) }));
484
983
  const getDeploymentLogsContractV1 = oc.route({
485
984
  path: "/v1/deployments/{deploymentId}/logs",
486
985
  method: "GET",
@@ -590,35 +1089,78 @@ const getServerInfoContractV1 = oc.route({
590
1089
  projectId: z.string(),
591
1090
  domain: z.string()
592
1091
  })).output(z.object({ serverFields: serverFieldsSchema }));
1092
+ const playgroundServerMetadataOutputSchema = z.object({
1093
+ name: z.string(),
1094
+ description: z.string(),
1095
+ headers: z.array(z.object({
1096
+ name: z.string(),
1097
+ description: z.string(),
1098
+ isRequired: z.boolean(),
1099
+ isSecret: z.boolean()
1100
+ })),
1101
+ examplePrompts: z.array(playgroundExamplePromptSchema)
1102
+ });
1103
+ const playgroundOutputSchema = z.object({
1104
+ isPlaygroundEnabled: z.boolean(),
1105
+ serverMetadata: playgroundServerMetadataOutputSchema.nullable()
1106
+ });
1107
+ const getPlaygroundContractV1 = oc.route({
1108
+ path: "/v1/environments/{environmentId}/playground",
1109
+ method: "GET",
1110
+ summary: "Get playground configuration",
1111
+ description: "Get the playground configuration for an environment",
1112
+ tags: ["environments"],
1113
+ successDescription: "The playground configuration"
1114
+ }).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(playgroundOutputSchema);
1115
+ const upsertPlaygroundContractV1 = oc.route({
1116
+ path: "/v1/environments/{environmentId}/playground",
1117
+ method: "PUT",
1118
+ summary: "Update playground configuration",
1119
+ description: "Update the playground configuration for an environment. All fields are optional — only provided fields are updated.",
1120
+ tags: ["environments"],
1121
+ successDescription: "The updated playground configuration"
1122
+ }).errors({
1123
+ NOT_FOUND: {},
1124
+ BAD_REQUEST: {}
1125
+ }).input(z.object({
1126
+ environmentId: z.string().describe("The ID of the environment"),
1127
+ isPlaygroundEnabled: z.boolean().optional(),
1128
+ name: z.string().min(1).max(100).optional(),
1129
+ description: z.string().min(1).max(500).optional(),
1130
+ headers: z.array(playgroundHeaderSchema).optional(),
1131
+ examplePrompts: z.array(playgroundExamplePromptSchema).max(3).optional()
1132
+ })).output(playgroundOutputSchema);
593
1133
  const createBeaconContractV1 = oc.route({
594
- path: "/v1/beacon/analyses",
1134
+ path: "/v1/beacon/audits",
595
1135
  method: "POST",
596
- summary: "Create a beacon analysis",
597
- description: "Analyze an MCP server for spec compliance and AI client compatibility",
1136
+ summary: "Create a beacon audit",
1137
+ description: "Audit an MCP server for spec compliance and AI client compatibility",
598
1138
  tags: ["beacon"],
599
- successDescription: "The analysis has been created"
1139
+ successDescription: "The audit has been created"
600
1140
  }).errors({
601
1141
  NOT_FOUND: {},
602
- BAD_REQUEST: {}
1142
+ BAD_REQUEST: {},
1143
+ DNS_RESOLUTION_FAILED: { status: 400 }
603
1144
  }).input(z.object({
604
- targetUrl: z.string().url().describe("The HTTPS URL of the MCP server to analyze"),
605
- teamId: z.string().optional().describe("The team ID to associate the analysis with"),
606
- projectId: z.string().optional().describe("The project ID to associate the analysis with")
1145
+ targetUrl: z.url().describe("The HTTPS URL of the MCP server to audit"),
1146
+ teamId: z.string().optional().describe("The team ID to associate the audit with"),
1147
+ projectId: z.string().optional().describe("The project ID to associate the audit with"),
1148
+ excludeCategories: z.array(checkCategorySchema).optional().describe("Check categories to exclude from the audit")
607
1149
  })).output(z.object({ id: z.string() }));
608
1150
  const getBeaconContractV1 = oc.route({
609
- path: "/v1/beacon/analyses/{analysisId}",
1151
+ path: "/v1/beacon/audits/{auditId}",
610
1152
  method: "GET",
611
- summary: "Get a beacon analysis",
612
- description: "Get a beacon analysis by ID, including the report if completed",
1153
+ summary: "Get a beacon audit",
1154
+ description: "Get a beacon audit by ID, including the report if completed",
613
1155
  tags: ["beacon"],
614
- successDescription: "The analysis details"
615
- }).errors({ NOT_FOUND: {} }).input(z.object({ analysisId: z.string().describe("The ID of the analysis") })).output(z.object({
1156
+ successDescription: "The audit details"
1157
+ }).errors({ NOT_FOUND: {} }).input(z.object({ auditId: z.string().describe("The ID of the audit") })).output(z.object({
616
1158
  id: z.string(),
617
1159
  targetUrl: z.string(),
618
- status: analysisStatusSchema,
1160
+ status: auditStatusSchema,
619
1161
  durationMs: z.number().nullable(),
620
1162
  createdAt: z.coerce.date(),
621
- report: auditReportSchema.nullable()
1163
+ report: auditReportWithScreenshotsSchema.nullable()
622
1164
  }));
623
1165
  const contract = {
624
1166
  teams: { list: { v1: listTeamsContractV1 } },
@@ -633,7 +1175,8 @@ const contract = {
633
1175
  create: { v1: createEnvironmentContractV1 },
634
1176
  get: { v1: getEnvironmentContractV1 },
635
1177
  deploy: { v1: deployEnvironmentContractV1 },
636
- getLogs: { v1: getLogsContractV1 }
1178
+ getLogs: { v1: getLogsContractV1 },
1179
+ getLatestLogs: { v1: getLatestLogsContractV1 }
637
1180
  },
638
1181
  environmentVariables: {
639
1182
  list: { v1: listEnvironmentVariablesContractV1 },
@@ -648,6 +1191,10 @@ const contract = {
648
1191
  create: { v1: createProjectContractV1 },
649
1192
  delete: { v1: deleteProjectContractV1 }
650
1193
  },
1194
+ playground: {
1195
+ get: { v1: getPlaygroundContractV1 },
1196
+ upsert: { v1: upsertPlaygroundContractV1 }
1197
+ },
651
1198
  tunnels: { getTicket: { v1: getTunnelTicketContractV1 } },
652
1199
  distribution: {
653
1200
  publish: { v1: publishServerContractV1 },
@@ -659,4 +1206,4 @@ const contract = {
659
1206
  }
660
1207
  };
661
1208
  //#endregion
662
- export { analysisStatusSchema, auditReportSchema, buildSettingsSchema, checkDetailSchema, checkResultSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, platformSchema, runtimeSchema, serverFieldsSchema, transportSchema };
1209
+ export { PLATFORM_LABELS, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };