voice-mcp-server 0.1.13 → 0.1.15

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/build/index.js CHANGED
@@ -2,7 +2,8 @@
2
2
  import { spawn, spawnSync } from "node:child_process";
3
3
  import { join, dirname } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
- import { existsSync } from "node:fs";
5
+ import { existsSync, mkdirSync } from "node:fs";
6
+ import { homedir } from "node:os";
6
7
  // Get the directory of the current module
7
8
  const __filename = fileURLToPath(import.meta.url);
8
9
  const __dirname = dirname(__filename);
@@ -10,7 +11,9 @@ const __dirname = dirname(__filename);
10
11
  const projectRoot = join(__dirname, "..");
11
12
  // Path to the Python script
12
13
  const pythonScriptPath = join(projectRoot, "src", "mcp_server.py");
13
- const venvPath = join(projectRoot, "venv");
14
+ // Store the virtual environment in the user's App Support directory to avoid EACCES permission errors
15
+ const appSupportDir = join(homedir(), "Library", "Application Support", "VoiceMCP");
16
+ const venvPath = join(appSupportDir, "venv");
14
17
  const venvPythonPath = join(venvPath, "bin", "python3");
15
18
  const requirementsPath = join(projectRoot, "requirements.txt");
16
19
  /**
@@ -31,8 +34,12 @@ function cleanEnv() {
31
34
  function ensurePythonEnvironment() {
32
35
  if (!existsSync(venvPath)) {
33
36
  console.error("Voice MCP: Initializing Python virtual environment. This may take a minute...");
37
+ // Ensure Application Support directory exists
38
+ if (!existsSync(appSupportDir)) {
39
+ mkdirSync(appSupportDir, { recursive: true });
40
+ }
34
41
  // Create the virtual environment
35
- const venvResult = spawnSync("python3", ["-m", "venv", "venv"], {
42
+ const venvResult = spawnSync("python3", ["-m", "venv", venvPath], {
36
43
  cwd: projectRoot,
37
44
  stdio: "ignore",
38
45
  env: cleanEnv()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "voice-mcp-server",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "An MCP server to allow LLMs to speak and listen via bidirectional voice loops",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -3,7 +3,8 @@
3
3
  import { spawn, spawnSync } from "node:child_process";
4
4
  import { join, dirname } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
- import { existsSync } from "node:fs";
6
+ import { existsSync, mkdirSync } from "node:fs";
7
+ import { homedir } from "node:os";
7
8
 
8
9
  // Get the directory of the current module
9
10
  const __filename = fileURLToPath(import.meta.url);
@@ -14,7 +15,10 @@ const projectRoot = join(__dirname, "..");
14
15
 
15
16
  // Path to the Python script
16
17
  const pythonScriptPath = join(projectRoot, "src", "mcp_server.py");
17
- const venvPath = join(projectRoot, "venv");
18
+
19
+ // Store the virtual environment in the user's App Support directory to avoid EACCES permission errors
20
+ const appSupportDir = join(homedir(), "Library", "Application Support", "VoiceMCP");
21
+ const venvPath = join(appSupportDir, "venv");
18
22
  const venvPythonPath = join(venvPath, "bin", "python3");
19
23
  const requirementsPath = join(projectRoot, "requirements.txt");
20
24
 
@@ -38,8 +42,13 @@ function ensurePythonEnvironment() {
38
42
  if (!existsSync(venvPath)) {
39
43
  console.error("Voice MCP: Initializing Python virtual environment. This may take a minute...");
40
44
 
45
+ // Ensure Application Support directory exists
46
+ if (!existsSync(appSupportDir)) {
47
+ mkdirSync(appSupportDir, { recursive: true });
48
+ }
49
+
41
50
  // Create the virtual environment
42
- const venvResult = spawnSync("python3", ["-m", "venv", "venv"], {
51
+ const venvResult = spawnSync("python3", ["-m", "venv", venvPath], {
43
52
  cwd: projectRoot,
44
53
  stdio: "ignore",
45
54
  env: cleanEnv()
package/src/mcp_server.py CHANGED
@@ -84,7 +84,7 @@ def ensure_daemon_running():
84
84
  logging.info("Daemon is down, attempting to boot detached process...")
85
85
  # Boot the daemon detached
86
86
  project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
87
- python_exec = os.path.join(project_root, "venv", "bin", "python3")
87
+ python_exec = os.path.join(app_support_dir, "venv", "bin", "python3")
88
88
  daemon_script = os.path.join(project_root, "src", "daemon", "audio_server.py")
89
89
 
90
90
  subprocess.Popen(