@manudota/artist-mcp 0.2.0 → 0.2.1-staging.7
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.js +6 -2
- package/dist/init.js +19 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,10 @@ try {
|
|
|
9
9
|
await runServer();
|
|
10
10
|
break;
|
|
11
11
|
case 'init':
|
|
12
|
-
|
|
12
|
+
if (process.argv[3] && process.argv[3] !== '--local') {
|
|
13
|
+
throw new Error('Usage: artist-mcp init [--local]');
|
|
14
|
+
}
|
|
15
|
+
await runInit({ local: process.argv[3] === '--local' });
|
|
13
16
|
break;
|
|
14
17
|
case 'uninstall':
|
|
15
18
|
await runUninstall();
|
|
@@ -23,7 +26,8 @@ try {
|
|
|
23
26
|
default:
|
|
24
27
|
console.error(`Unknown command "${mode}".\n\n` +
|
|
25
28
|
' artist-mcp run the MCP server over stdio\n' +
|
|
26
|
-
' artist-mcp init
|
|
29
|
+
' artist-mcp init [--local]\n' +
|
|
30
|
+
' connect this machine to your notes\n' +
|
|
27
31
|
' artist-mcp agents install [directory]\n' +
|
|
28
32
|
' install the notes-analysis agent pack\n' +
|
|
29
33
|
' artist-mcp uninstall remove the Claude Desktop entry\n');
|
package/dist/init.js
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import { createInterface } from "node:readline/promises";
|
|
2
2
|
import { stdin, stdout } from "node:process";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
3
4
|
import { call, GraphError } from "./client.js";
|
|
4
5
|
import { configPath, ENTRY_NAME, readConfig, writeConfig } from "./config.js";
|
|
5
6
|
const PACKAGE = "@manudota/artist-mcp";
|
|
6
|
-
|
|
7
|
+
const LOCAL_ENTRY = fileURLToPath(new URL("./index.js", import.meta.url));
|
|
8
|
+
const createServerEntry = ({ key, local = false }) => local
|
|
9
|
+
? {
|
|
10
|
+
command: process.execPath,
|
|
11
|
+
args: [LOCAL_ENTRY],
|
|
12
|
+
env: { ARTIST_MCP_KEY: key },
|
|
13
|
+
}
|
|
14
|
+
: {
|
|
15
|
+
command: "npx",
|
|
16
|
+
args: ["-y", PACKAGE],
|
|
17
|
+
env: { ARTIST_MCP_KEY: key },
|
|
18
|
+
};
|
|
19
|
+
export const runInit = async ({ local = false } = {}) => {
|
|
7
20
|
const rl = createInterface({ input: stdin, output: stdout });
|
|
8
21
|
let key;
|
|
9
22
|
try {
|
|
@@ -29,16 +42,16 @@ export const runInit = async () => {
|
|
|
29
42
|
const path = configPath();
|
|
30
43
|
const config = await readConfig(path);
|
|
31
44
|
const servers = (config.mcpServers ?? {});
|
|
32
|
-
servers[ENTRY_NAME] = {
|
|
33
|
-
command: "npx",
|
|
34
|
-
args: ["-y", PACKAGE],
|
|
35
|
-
env: { ARTIST_MCP_KEY: key },
|
|
36
|
-
};
|
|
45
|
+
servers[ENTRY_NAME] = createServerEntry({ key, local });
|
|
37
46
|
config.mcpServers = servers;
|
|
38
47
|
await writeConfig(path, config);
|
|
39
48
|
console.log(`\nConnected. Wrote "${ENTRY_NAME}" to ${path}`);
|
|
49
|
+
if (local) {
|
|
50
|
+
console.log(`Using local build: ${LOCAL_ENTRY}`);
|
|
51
|
+
}
|
|
40
52
|
console.log("Restart Claude Desktop — it doesn't reload its config on its own.");
|
|
41
53
|
};
|
|
54
|
+
export { createServerEntry };
|
|
42
55
|
export const runUninstall = async () => {
|
|
43
56
|
const path = configPath();
|
|
44
57
|
const config = await readConfig(path);
|