@memoraone/mcp 0.1.27 → 0.1.28

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.
Files changed (2) hide show
  1. package/dist/cli.cjs +42 -18
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -30,7 +30,7 @@ var require_package = __commonJS({
30
30
  "package.json"(exports2, module2) {
31
31
  module2.exports = {
32
32
  name: "@memoraone/mcp",
33
- version: "0.1.27",
33
+ version: "0.1.28",
34
34
  type: "module",
35
35
  main: "dist/index.cjs",
36
36
  bin: {
@@ -689,13 +689,16 @@ async function cliCleanup(argv) {
689
689
  var MANAGED_MARKER = "<!-- MemoraOne managed IDE helper -->";
690
690
  var GITIGNORE_MEMORAONE_COMMENT = "# MemoraOne local project binding / API key";
691
691
  var GITIGNORE_MEMORAONE_ENTRY = "memoraone.m1";
692
- var MEMORAONE_MCP_SERVER = {
693
- command: "npx",
694
- args: ["-y", "@memoraone/mcp@latest"],
695
- env: {
696
- MEMORAONE_API_URL: "https://api.memoraone.com"
697
- }
698
- };
692
+ function buildMemoraoneMcpServer(ideType) {
693
+ return {
694
+ command: "npx",
695
+ args: ["-y", "@memoraone/mcp@latest"],
696
+ env: {
697
+ MEMORAONE_API_URL: "https://api.memoraone.com",
698
+ MEMORAONE_IDE_TYPE: ideType
699
+ }
700
+ };
701
+ }
699
702
  function assertUnderRepoRoot(repoRoot, absPath) {
700
703
  const normRoot = path4.resolve(repoRoot) + path4.sep;
701
704
  const normPath = path4.resolve(absPath);
@@ -803,13 +806,20 @@ function mcpJsonHeader() {
803
806
  return `// ${MANAGED_MARKER}
804
807
  `;
805
808
  }
806
- function buildMcpJsonBody(existing) {
809
+ function buildVscodeMcpJsonBody(existing) {
807
810
  const base = existing && typeof existing === "object" ? { ...existing } : { servers: {} };
808
811
  const servers = typeof base.servers === "object" && base.servers !== null && !Array.isArray(base.servers) ? { ...base.servers } : {};
809
- servers.memoraone = { ...MEMORAONE_MCP_SERVER };
812
+ servers.memoraone = buildMemoraoneMcpServer("copilot-vscode");
810
813
  const merged = { ...base, servers };
811
814
  return mcpJsonHeader() + JSON.stringify(merged, null, 2) + "\n";
812
815
  }
816
+ function buildCursorMcpJsonBody(existing) {
817
+ const base = existing && typeof existing === "object" ? { ...existing } : { mcpServers: {} };
818
+ const mcpServers = typeof base.mcpServers === "object" && base.mcpServers !== null && !Array.isArray(base.mcpServers) ? { ...base.mcpServers } : {};
819
+ mcpServers.memoraone = buildMemoraoneMcpServer("cursor");
820
+ const merged = { ...base, mcpServers };
821
+ return mcpJsonHeader() + JSON.stringify(merged, null, 2) + "\n";
822
+ }
813
823
  async function writeManagedMarkdown(repoRoot, relPath, fullContent, opts) {
814
824
  const abs = path4.join(repoRoot, relPath);
815
825
  assertUnderRepoRoot(repoRoot, abs);
@@ -840,8 +850,8 @@ async function writeManagedMarkdown(repoRoot, relPath, fullContent, opts) {
840
850
  await fs4.writeFile(abs, fullContent, "utf8");
841
851
  return "updated";
842
852
  }
843
- async function writeMcpJson(repoRoot, opts) {
844
- const abs = path4.join(repoRoot, ".vscode/mcp.json");
853
+ async function writeIdeMcpJson(repoRoot, relPath, buildBody, opts) {
854
+ const abs = path4.join(repoRoot, relPath);
845
855
  assertUnderRepoRoot(repoRoot, abs);
846
856
  let raw = "";
847
857
  let existed = false;
@@ -852,7 +862,7 @@ async function writeMcpJson(repoRoot, opts) {
852
862
  if (err?.code !== "ENOENT") throw err;
853
863
  }
854
864
  if (!existed) {
855
- const body = buildMcpJsonBody(null);
865
+ const body = buildBody(null);
856
866
  if (opts.dryRun) return "created";
857
867
  await fs4.mkdir(path4.dirname(abs), { recursive: true });
858
868
  await fs4.writeFile(abs, body, "utf8");
@@ -867,7 +877,7 @@ async function writeMcpJson(repoRoot, opts) {
867
877
  parsed = null;
868
878
  }
869
879
  if (!parsed && !opts.force) return "skipped-untracked";
870
- const next = buildMcpJsonBody(parsed);
880
+ const next = buildBody(parsed);
871
881
  if (managed && next === raw) return "skipped";
872
882
  if (opts.dryRun) return "updated";
873
883
  await fs4.mkdir(path4.dirname(abs), { recursive: true });
@@ -945,6 +955,15 @@ description: MemoraOne MCP \u2014 IDE agent instructions
945
955
 
946
956
  ` + cursorRuleBody();
947
957
  if (o.targets.cursor) {
958
+ outcomes[".cursor/mcp.json"] = await writeIdeMcpJson(
959
+ repoRoot,
960
+ ".cursor/mcp.json",
961
+ buildCursorMcpJsonBody,
962
+ {
963
+ force: o.force,
964
+ dryRun: o.dryRun
965
+ }
966
+ );
948
967
  outcomes[".cursor/rules/memoraone-mcp.mdc"] = await writeManagedMarkdown(
949
968
  repoRoot,
950
969
  ".cursor/rules/memoraone-mcp.mdc",
@@ -953,10 +972,15 @@ description: MemoraOne MCP \u2014 IDE agent instructions
953
972
  );
954
973
  }
955
974
  if (o.targets.vscode) {
956
- outcomes[".vscode/mcp.json"] = await writeMcpJson(repoRoot, {
957
- force: o.force,
958
- dryRun: o.dryRun
959
- });
975
+ outcomes[".vscode/mcp.json"] = await writeIdeMcpJson(
976
+ repoRoot,
977
+ ".vscode/mcp.json",
978
+ buildVscodeMcpJsonBody,
979
+ {
980
+ force: o.force,
981
+ dryRun: o.dryRun
982
+ }
983
+ );
960
984
  outcomes[".github/copilot-instructions.md"] = await writeManagedMarkdown(
961
985
  repoRoot,
962
986
  ".github/copilot-instructions.md",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memoraone/mcp",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {