[GH-ISSUE #3671] [BUG]: MCP backend ignores configured 'command' and executes wrong command (Docker, RPi5/ARM64) #2370

Closed
opened 2026-02-22 18:29:23 -05:00 by yindo · 1 comment
Owner

Originally created by @LinusAurel on GitHub (Apr 17, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3671

How are you running AnythingLLM?

Docker (local)

What happened?

I am trying to add the Notion MCP server to AnythingLLM running via Docker on a Raspberry Pi 5 (ARM64 architecture), using the mintplexlabs/anythingllm:latest image. I configured it according to the Notion MCP documentation using the npx method in plugins/anythingllm_mcp_servers.json.

The AnythingLLM UI correctly reads the configuration and displays the intended startup command (e.g., Command: /usr/bin/npx, Arguments: -y @notionhq/notion-mcp-server).

Image

However, when attempting to start the MCP server (either automatically or manually via the UI), the backend fails to execute the configured command. The container logs (docker logs anythingllm) consistently show the backend attempting to run a command derived directly from the MCP key name, ignoring the specified command and args.

Specifically, for an MCP named notionApi, the logs show:

[backend] info: [MCPCompatibilityLayer] Attempting to start MCP server: notionApi
sh: 1: notion-mcp-server: not found
[backend] info: [MCPCompatibilityLayer] Failed to start MCP server: notionApi {"error":"MCP error -32000: Connection closed",...}

This happens even when the configuration explicitly defines command as /usr/bin/npx.

To confirm this, I renamed the MCP key in the configuration file to myNotionTool. The logs then showed:

[backend] info: [MCPCompatibilityLayer] Attempting to start MCP server: myNotionTool
sh: 1: notion-mcp-server: not found
[backend] info: [MCPCompatibilityLayer] Failed to start MCP server: myNotionTool {"error":"MCP error -32000: Connection closed",...}

This proves the backend correctly reads the MCP key (myNotionTool) but still ignores the configured command (/usr/bin/npx) and attempts to execute the wrongly derived command (notion-mcp-server).

This suggests a bug in the backend's MCP launcher component where the command and args fields from anythingllm_mcp_servers.json are not being used for process execution.

Are there known steps to reproduce?

  1. Run AnythingLLM using Docker Compose on an ARM64 system (e.g., Raspberry Pi 5) using the :latest tag.
    • Example docker-compose.yml:
      services:
        anythingllm:
          image: mintplexlabs/anythingllm:latest
          container_name: anythingllm
          ports:
            - "3001:3001"
          volumes:
            - /path/on/host/anythingllm/storage:/app/server/storage # Adjust path as needed
            - /path/on/host/anythingllm/storage/.env:/app/server/.env # Adjust path as needed
            - anythingllm_uploads:/app/server/uploads
            - anythingllm_hotdir:/app/client/hotdir
          environment:
            - STORAGE_DIR=/app/server/storage
            - UPLOAD_DIR=/app/server/uploads
            - VECTOR_DB=lancedb # Or your choice
            # Add other env vars as needed
          restart: unless-stopped
      volumes:
        anythingllm_uploads:
        anythingllm_hotdir:
      
  2. Configure an MCP server in /path/on/host/anythingllm/storage/plugins/anythingllm_mcp_servers.json using the npx method, ensuring the full path to npx (found via docker exec -it anythingllm which npx, likely /usr/bin/npx) is used for the command field.
    • Example anythingllm_mcp_servers.json:
      {
        "mcpServers": {
          "notionApi": {
            "command": "/usr/bin/npx",
            "args": ["-y", "@notionhq/notion-mcp-server"],
            "env": {
              "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer YOUR_NTN_TOKEN_HERE\", \"Notion-Version\": \"2022-06-28\" }"
            }
          }
        }
      }
      
  3. Ensure the container is fully restarted (docker compose down && docker compose up -d).
  4. Navigate to Agent Skills in the UI and attempt to start the configured MCP server (notionApi).
  5. Observe that the UI correctly displays the Startup Command as /usr/bin/npx ....
  6. Check the container logs (docker logs anythingllm).
  7. Expected: Logs should show an attempt to execute /usr/bin/npx -y @notionhq/notion-mcp-server.
  8. Actual: Logs show sh: 1: notion-mcp-server: not found followed by the Connection closed error.
  9. (Optional Confirmation): Rename the key from "notionApi" to "myNotionTool" in the JSON file, repeat steps 3-7. Observe the logs still show sh: 1: notion-mcp-server: not found when trying to start myNotionTool.
Originally created by @LinusAurel on GitHub (Apr 17, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3671 ### How are you running AnythingLLM? Docker (local) ### What happened? I am trying to add the Notion MCP server to AnythingLLM running via Docker on a Raspberry Pi 5 (ARM64 architecture), using the `mintplexlabs/anythingllm:latest` image. I configured it according to the Notion MCP documentation using the `npx` method in `plugins/anythingllm_mcp_servers.json`. The AnythingLLM **UI correctly reads the configuration** and displays the intended startup command (e.g., `Command: /usr/bin/npx`, `Arguments: -y @notionhq/notion-mcp-server`). <img width="667" alt="Image" src="https://github.com/user-attachments/assets/5ef093fd-f390-4b80-a8fc-9be07a9f2d00" /> However, when attempting to start the MCP server (either automatically or manually via the UI), the backend **fails to execute the configured command**. The container logs (`docker logs anythingllm`) consistently show the backend attempting to run a command derived directly from the MCP key name, ignoring the specified `command` and `args`. Specifically, for an MCP named `notionApi`, the logs show: ``` [backend] info: [MCPCompatibilityLayer] Attempting to start MCP server: notionApi sh: 1: notion-mcp-server: not found [backend] info: [MCPCompatibilityLayer] Failed to start MCP server: notionApi {"error":"MCP error -32000: Connection closed",...} ``` This happens even when the configuration explicitly defines `command` as `/usr/bin/npx`. To confirm this, I renamed the MCP key in the configuration file to `myNotionTool`. The logs then showed: ``` [backend] info: [MCPCompatibilityLayer] Attempting to start MCP server: myNotionTool sh: 1: notion-mcp-server: not found [backend] info: [MCPCompatibilityLayer] Failed to start MCP server: myNotionTool {"error":"MCP error -32000: Connection closed",...} ``` This proves the backend correctly reads the MCP *key* (`myNotionTool`) but *still* ignores the configured `command` (`/usr/bin/npx`) and attempts to execute the wrongly derived command (`notion-mcp-server`). This suggests a bug in the backend's MCP launcher component where the `command` and `args` fields from `anythingllm_mcp_servers.json` are not being used for process execution. ### Are there known steps to reproduce? 1. Run AnythingLLM using Docker Compose on an ARM64 system (e.g., Raspberry Pi 5) using the `:latest` tag. * Example `docker-compose.yml`: ```yaml services: anythingllm: image: mintplexlabs/anythingllm:latest container_name: anythingllm ports: - "3001:3001" volumes: - /path/on/host/anythingllm/storage:/app/server/storage # Adjust path as needed - /path/on/host/anythingllm/storage/.env:/app/server/.env # Adjust path as needed - anythingllm_uploads:/app/server/uploads - anythingllm_hotdir:/app/client/hotdir environment: - STORAGE_DIR=/app/server/storage - UPLOAD_DIR=/app/server/uploads - VECTOR_DB=lancedb # Or your choice # Add other env vars as needed restart: unless-stopped volumes: anythingllm_uploads: anythingllm_hotdir: ``` 2. Configure an MCP server in `/path/on/host/anythingllm/storage/plugins/anythingllm_mcp_servers.json` using the `npx` method, ensuring the full path to `npx` (found via `docker exec -it anythingllm which npx`, likely `/usr/bin/npx`) is used for the `command` field. * Example `anythingllm_mcp_servers.json`: ```json { "mcpServers": { "notionApi": { "command": "/usr/bin/npx", "args": ["-y", "@notionhq/notion-mcp-server"], "env": { "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer YOUR_NTN_TOKEN_HERE\", \"Notion-Version\": \"2022-06-28\" }" } } } } ``` 3. Ensure the container is fully restarted (`docker compose down && docker compose up -d`). 4. Navigate to Agent Skills in the UI and attempt to start the configured MCP server (`notionApi`). 5. Observe that the UI correctly displays the `Startup Command` as `/usr/bin/npx ...`. 6. Check the container logs (`docker logs anythingllm`). 7. **Expected:** Logs should show an attempt to execute `/usr/bin/npx -y @notionhq/notion-mcp-server`. 8. **Actual:** Logs show `sh: 1: notion-mcp-server: not found` followed by the `Connection closed` error. 9. **(Optional Confirmation):** Rename the key from `"notionApi"` to `"myNotionTool"` in the JSON file, repeat steps 3-7. Observe the logs *still* show `sh: 1: notion-mcp-server: not found` when trying to start `myNotionTool`.
yindo added the possible bug label 2026-02-22 18:29:23 -05:00
yindo closed this issue 2026-02-22 18:29:23 -05:00
Author
Owner

@timothycarambat commented on GitHub (Apr 18, 2025):

Ah, will add this to Docker MCP documentation. When you add a single env option it will automatically remove the default envs managed by the MCP SDK.

In this case, simply add back the PATH and NODE_PATH envs:

{
  "mcpServers": {
    "notionApi": {
      "command": "/usr/bin/npx",
      "args": [
        "-y",
        "@notionhq/notion-mcp-server"
      ],
      "env": {
        "NODE_PATH": "/usr/bin/node",
        "PATH": "/usr/bin/node:/usr/local/bin:/usr/bin:/bin",
        "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer YOUR_NTN_TOKEN_HERE\", \"Notion-Version\": \"2022-06-28\" }"
      }
    }
  }
}
@timothycarambat commented on GitHub (Apr 18, 2025): Ah, will add this to Docker MCP documentation. When you add a single `env` option it will automatically remove the default `env`s managed by the MCP SDK. In this case, simply add back the PATH and NODE_PATH envs: ```json { "mcpServers": { "notionApi": { "command": "/usr/bin/npx", "args": [ "-y", "@notionhq/notion-mcp-server" ], "env": { "NODE_PATH": "/usr/bin/node", "PATH": "/usr/bin/node:/usr/local/bin:/usr/bin:/bin", "OPENAPI_MCP_HEADERS": "{\"Authorization\": \"Bearer YOUR_NTN_TOKEN_HERE\", \"Notion-Version\": \"2022-06-28\" }" } } } } ```
yindo changed title from [BUG]: MCP backend ignores configured 'command' and executes wrong command (Docker, RPi5/ARM64) to [GH-ISSUE #3671] [BUG]: MCP backend ignores configured 'command' and executes wrong command (Docker, RPi5/ARM64) 2026-06-05 14:46:10 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#2370