@danainnovations/cortex-mcp 1.0.102 → 1.0.103

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.
@@ -9,7 +9,7 @@ import {
9
9
  DEFAULT_SERVER_URL,
10
10
  MCP_NAMES,
11
11
  PROTOCOL_VERSION
12
- } from "./chunk-RB5AKDLX.js";
12
+ } from "./chunk-35KL5IIO.js";
13
13
  export {
14
14
  AVAILABLE_MCPS,
15
15
  CONFIG_DIR_NAME,
@@ -21,4 +21,4 @@ export {
21
21
  MCP_NAMES,
22
22
  PROTOCOL_VERSION
23
23
  };
24
- //# sourceMappingURL=constants-66VQYSV7.js.map
24
+ //# sourceMappingURL=constants-AJADVACN.js.map
package/dist/index.d.ts CHANGED
@@ -207,8 +207,8 @@ declare const AVAILABLE_MCPS: readonly [{
207
207
  }];
208
208
  /** All available MCP names */
209
209
  declare const MCP_NAMES: string[];
210
- /** Shared API key embedded in the package (no user prompt needed) */
211
- declare const DEFAULT_API_KEY = "ctx_07d37a81_9f7be06af38d04753090a4034f907a65ec06cd675ed26f65653898388e2d1709";
210
+ /** @deprecated Shared default key removed users must run `cortex-mcp login` */
211
+ declare const DEFAULT_API_KEY = "";
212
212
 
213
213
  /** Stored credentials from a successful login */
214
214
  interface CortexCredentials {
@@ -221,7 +221,10 @@ interface CortexCredentials {
221
221
  declare function readCredentials(): CortexCredentials | null;
222
222
  /**
223
223
  * Get the effective API key to use.
224
- * Priority: CORTEX_API_KEY env var > stored credentials > config file > default shared key
224
+ * Priority: CORTEX_API_KEY env var > stored credentials > config file
225
+ *
226
+ * Returns empty string if no key is available — callers should check
227
+ * and prompt the user to run `cortex-mcp login`.
225
228
  */
226
229
  declare function getEffectiveApiKey(): string;
227
230
 
package/dist/index.js CHANGED
@@ -104,7 +104,7 @@ var AVAILABLE_MCPS = [
104
104
  ];
105
105
  var MCP_NAMES = AVAILABLE_MCPS.map((m) => m.name);
106
106
  var DEFAULT_MCPS = [...MCP_NAMES];
107
- var DEFAULT_API_KEY = "ctx_07d37a81_9f7be06af38d04753090a4034f907a65ec06cd675ed26f65653898388e2d1709";
107
+ var DEFAULT_API_KEY = "";
108
108
  var CONFIG_DIR_NAME = ".cortex-mcp";
109
109
  var CONFIG_FILE_NAME = "config.json";
110
110
  var CREDENTIALS_FILE_NAME = "credentials.json";
@@ -1094,6 +1094,79 @@ async function startStdioServer(options) {
1094
1094
  }
1095
1095
  initialized = true;
1096
1096
  }
1097
+ const VIBE_CODING_GUIDE_TOOL = {
1098
+ name: "vibe_coding_guide",
1099
+ description: "IMPORTANT: Call this tool FIRST before building any new application. Returns the required Cortex workflow for creating branded, production-ready apps deployed to Vercel with GitHub, Supabase, and Sonance Brand integration. This ensures every app follows the correct pipeline: branded proof-of-concept \u2192 user approval \u2192 infrastructure setup \u2192 code with brand components \u2192 deploy \u2192 verify.",
1100
+ inputSchema: {
1101
+ type: "object",
1102
+ properties: {
1103
+ project_type: {
1104
+ type: "string",
1105
+ description: "Optional: 'new' for greenfield apps, 'existing' for changes to existing projects. Defaults to 'new'."
1106
+ }
1107
+ }
1108
+ }
1109
+ };
1110
+ const VIBE_CODING_GUIDE_RESPONSE = [
1111
+ "# Cortex Vibe Coding Workflow",
1112
+ "",
1113
+ "Follow this pipeline when building apps with Cortex MCP tools.",
1114
+ "",
1115
+ "## New App (Greenfield)",
1116
+ "",
1117
+ "### Phase 1: Design & Approve",
1118
+ "1. Call `sonance_brand__design_app` with the app description to get the branded starter blueprint (CSS, components, layout)",
1119
+ "2. Call `sonance_brand__get_css_theme` for the full CSS variables and Tailwind config",
1120
+ "3. Create a single branded HTML proof-of-concept file and show the user",
1121
+ "4. Ask the user: 'Does this look right? Ready to build the full app?'",
1122
+ "5. Do NOT proceed until the user approves",
1123
+ "",
1124
+ "### Phase 2: Plan Infrastructure",
1125
+ "6. Determine if the app needs a database (user accounts, persistent data \u2192 yes; static content \u2192 no)",
1126
+ "7. Determine if the app needs authentication (multi-user, personalized data \u2192 yes; public content \u2192 no)",
1127
+ "8. Present the plan to the user: 'Your app needs: GitHub repo, Vercel deployment, [Supabase DB + auth / no DB]'",
1128
+ "",
1129
+ "### Phase 3: Build with Brand",
1130
+ "9. Write Next.js + TypeScript code using Sonance Brand components:",
1131
+ " - Call `sonance_brand__get_components_by_category` for pre-built UI components",
1132
+ " - Call `sonance_brand__get_component` for specific components",
1133
+ " - Use brand CSS tokens for all colors/typography \u2014 never hardcode hex values",
1134
+ "10. Structure code modularly: components in /components, utilities in /lib, routes in /app",
1135
+ " - No single file over 300 lines",
1136
+ " - Always use TypeScript (.tsx/.ts)",
1137
+ "",
1138
+ "### Phase 4: Deploy",
1139
+ "11. If auth needed: call `supabase__setup_cortex_auth` \u2014 returns client_id, client_secret, cortex_url",
1140
+ " - Include auth template files: login page, callback route, middleware, sign-out",
1141
+ "12. Create private GitHub repo: `github__create_repository` + `github__push_files`",
1142
+ " - Include .gitignore, .env.example, README.md \u2014 NEVER push .env or secrets",
1143
+ "13. Set ALL env vars on Vercel using `vercel__set_env_vars_batch` BEFORE deploying:",
1144
+ " - Supabase: NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY",
1145
+ " - Auth: NEXT_PUBLIC_CORTEX_URL, NEXT_PUBLIC_CORTEX_CLIENT_ID, CORTEX_CLIENT_ID, CORTEX_CLIENT_SECRET",
1146
+ " - Extract ALL values from tool responses \u2014 NEVER ask the user to copy keys",
1147
+ "14. Deploy: `vercel__deploy` then verify with `vercel__get_deployment`",
1148
+ " - If ERROR: get logs, fix code, push fix, retry until READY",
1149
+ " - NEVER tell the user the app is live without confirming READY status",
1150
+ "15. If auth: register redirect URI with `supabase__add_redirect_uri`",
1151
+ "",
1152
+ "### Phase 5: Quality",
1153
+ "16. Run `security_scan__scan_code_security`, `code_analysis__lint_directory`, `code_review__review_directory`",
1154
+ "17. Call `sonance_brand__evaluate_design` \u2014 must score Tier 3+ (>= 60) before finalizing",
1155
+ "",
1156
+ "## Existing Project",
1157
+ "",
1158
+ "If the user references an existing repo/project ('add auth to...', 'fix the deployment on...'),",
1159
+ "skip the POC and go directly to the requested changes. Still apply:",
1160
+ "- Brand components and CSS tokens for any new UI",
1161
+ "- Env vars before deploying",
1162
+ "- Deployment verification",
1163
+ "- Quality checks and brand evaluation",
1164
+ "",
1165
+ "## Key Rules",
1166
+ "- The user should NEVER manually set env vars, copy keys, or configure auth",
1167
+ "- Always use Next.js + TypeScript, never plain React or HTML for production apps",
1168
+ "- Always use Sonance Brand components \u2014 never write custom Button/Card/Navbar with hardcoded styles"
1169
+ ].join("\n");
1097
1170
  server.setRequestHandler(ListToolsRequestSchema, async () => {
1098
1171
  await ensureInitialized();
1099
1172
  const response = await cortex.listTools();
@@ -1102,12 +1175,18 @@ async function startStdioServer(options) {
1102
1175
  }
1103
1176
  const result = response.result;
1104
1177
  const tools = (result.tools || []).map(overrideUploadToolSchema);
1105
- return { tools };
1178
+ return { tools: [VIBE_CODING_GUIDE_TOOL, ...tools] };
1106
1179
  });
1107
1180
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
1108
1181
  await ensureInitialized();
1109
1182
  const { name, arguments: args } = request.params;
1110
1183
  const typedArgs = args ?? {};
1184
+ if (name === "vibe_coding_guide") {
1185
+ return {
1186
+ content: [{ type: "text", text: VIBE_CODING_GUIDE_RESPONSE }],
1187
+ isError: false
1188
+ };
1189
+ }
1111
1190
  const baseName = name.includes("__") ? name.split("__").pop() : name;
1112
1191
  if (UPLOAD_TOOLS.has(baseName) && typedArgs.file_path) {
1113
1192
  return handleLocalFileUpload(cortex, name, typedArgs);
@@ -1752,7 +1831,7 @@ function getEffectiveApiKey() {
1752
1831
  if (creds?.apiKey) return creds.apiKey;
1753
1832
  const config = readConfig();
1754
1833
  if (config?.apiKey) return config.apiKey;
1755
- return DEFAULT_API_KEY;
1834
+ return "";
1756
1835
  }
1757
1836
 
1758
1837
  // src/client/mcp-namespace.ts