mastra 0.6.0-alpha.3 → 0.6.0-alpha.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.
@@ -185,20 +185,41 @@ async function writeMergedConfig(configPath) {
185
185
  });
186
186
  }
187
187
  var windsurfGlobalMCPConfigPath = path.join(os.homedir(), ".codeium", "windsurf", "mcp_config.json");
188
+ var cursorGlobalMCPConfigPath = path.join(os.homedir(), ".cursor", "mcp.json");
188
189
  async function installMastraDocsMCPServer({
189
190
  editor,
190
191
  directory
191
192
  }) {
192
- if (editor === `cursor`) await writeMergedConfig(path.join(directory, ".cursor", "mcp.json"));
193
- const windsurfIsInstalled = await globalWindsurfMCPIsAlreadyInstalled();
194
- if (editor === `windsurf` && !windsurfIsInstalled) await writeMergedConfig(windsurfGlobalMCPConfigPath);
193
+ if (editor === `cursor`) {
194
+ await writeMergedConfig(path.join(directory, ".cursor", "mcp.json"));
195
+ }
196
+ if (editor === `cursor-global`) {
197
+ const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor);
198
+ if (alreadyInstalled) {
199
+ return;
200
+ }
201
+ await writeMergedConfig(cursorGlobalMCPConfigPath);
202
+ }
203
+ if (editor === `windsurf`) {
204
+ const alreadyInstalled = await globalMCPIsAlreadyInstalled(editor);
205
+ if (alreadyInstalled) {
206
+ return;
207
+ }
208
+ await writeMergedConfig(windsurfGlobalMCPConfigPath);
209
+ }
195
210
  }
196
- async function globalWindsurfMCPIsAlreadyInstalled() {
197
- if (!existsSync(windsurfGlobalMCPConfigPath)) {
211
+ async function globalMCPIsAlreadyInstalled(editor) {
212
+ let configPath = ``;
213
+ if (editor === "windsurf") {
214
+ configPath = windsurfGlobalMCPConfigPath;
215
+ } else if (editor === "cursor-global") {
216
+ configPath = cursorGlobalMCPConfigPath;
217
+ }
218
+ if (!configPath || !existsSync(configPath)) {
198
219
  return false;
199
220
  }
200
221
  try {
201
- const configContents = await readJSON(windsurfGlobalMCPConfigPath);
222
+ const configContents = await readJSON(configPath);
202
223
  if (!configContents?.mcpServers) return false;
203
224
  const hasMastraMCP = Object.values(configContents.mcpServers).some(
204
225
  (server) => server?.args?.find((arg) => arg?.includes(`@mastra/mcp-docs-server`))
@@ -810,12 +831,22 @@ var interactivePrompt = async () => {
810
831
  initialValue: false
811
832
  }),
812
833
  configureEditorWithDocsMCP: async () => {
813
- const windsurfIsAlreadyInstalled = await globalWindsurfMCPIsAlreadyInstalled();
834
+ const windsurfIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`windsurf`);
835
+ const cursorIsAlreadyInstalled = await globalMCPIsAlreadyInstalled(`cursor`);
814
836
  const editor = await p.select({
815
837
  message: `Make your AI IDE into a Mastra expert? (installs Mastra docs MCP server)`,
816
838
  options: [
817
839
  { value: "skip", label: "Skip for now", hint: "default" },
818
- { value: "cursor", label: "Cursor" },
840
+ {
841
+ value: "cursor",
842
+ label: "Cursor (project only)",
843
+ hint: cursorIsAlreadyInstalled ? `Already installed globally` : void 0
844
+ },
845
+ {
846
+ value: "cursor-global",
847
+ label: "Cursor (global, all projects)",
848
+ hint: cursorIsAlreadyInstalled ? `Already installed` : void 0
849
+ },
819
850
  {
820
851
  value: "windsurf",
821
852
  label: "Windsurf",
@@ -836,6 +867,18 @@ Note: you will need to go into Cursor Settings -> MCP Settings and manually enab
836
867
  `
837
868
  );
838
869
  }
870
+ if (editor === `cursor-global`) {
871
+ const confirm2 = await p.select({
872
+ message: `Global install will add/update ${cursorGlobalMCPConfigPath} and make the Mastra docs MCP server available in all your Cursor projects. Continue?`,
873
+ options: [
874
+ { value: "yes", label: "Yes, I understand" },
875
+ { value: "skip", label: "No, skip for now" }
876
+ ]
877
+ });
878
+ if (confirm2 !== `yes`) {
879
+ return void 0;
880
+ }
881
+ }
839
882
  if (editor === `windsurf`) {
840
883
  const confirm2 = await p.select({
841
884
  message: `Windsurf only supports a global MCP config (at ${windsurfGlobalMCPConfigPath}) is it ok to add/update that global config?
@@ -1 +1 @@
1
- export { create } from '../../chunk-A5NF2IHE.js';
1
+ export { create } from '../../chunk-YW5YUAZU.js';
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #! /usr/bin/env node
2
2
  import { PosthogAnalytics } from './chunk-7OXWUU2Q.js';
3
3
  export { PosthogAnalytics } from './chunk-7OXWUU2Q.js';
4
- import { DepsService, create, checkPkgJson, checkAndInstallCoreDeps, interactivePrompt, init, logger, convertToViteEnvVar, FileService as FileService$1 } from './chunk-A5NF2IHE.js';
5
- export { create } from './chunk-A5NF2IHE.js';
4
+ import { DepsService, create, checkPkgJson, checkAndInstallCoreDeps, interactivePrompt, init, logger, convertToViteEnvVar, FileService as FileService$1 } from './chunk-YW5YUAZU.js';
5
+ export { create } from './chunk-YW5YUAZU.js';
6
6
  import { Command } from 'commander';
7
7
  import { config } from 'dotenv';
8
8
  import { join as join$1, dirname } from 'node:path';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mastra",
3
- "version": "0.6.0-alpha.3",
3
+ "version": "0.6.0-alpha.4",
4
4
  "license": "Elastic-2.0",
5
5
  "description": "cli for mastra",
6
6
  "type": "module",
@@ -54,8 +54,8 @@
54
54
  "yocto-spinner": "^0.1.2",
55
55
  "zod": "^3.24.2",
56
56
  "zod-to-json-schema": "^3.24.3",
57
- "@mastra/deployer": "^0.3.1-alpha.3",
58
- "@mastra/core": "^0.9.1-alpha.3"
57
+ "@mastra/core": "^0.9.1-alpha.3",
58
+ "@mastra/deployer": "^0.3.1-alpha.3"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@microsoft/api-extractor": "^7.52.1",
@@ -73,8 +73,8 @@
73
73
  "typescript": "^5.8.2",
74
74
  "vitest": "^3.0.9",
75
75
  "@internal/lint": "0.0.2",
76
- "@mastra/client-js": "0.1.19-alpha.3",
77
- "@mastra/playground-ui": "5.0.1-alpha.3"
76
+ "@mastra/playground-ui": "5.0.1-alpha.3",
77
+ "@mastra/client-js": "0.1.19-alpha.3"
78
78
  },
79
79
  "scripts": {
80
80
  "build": "npm-run-all --serial build:lib copy-starter-files copy-templates build:playground",