-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
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).
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?
- Run AnythingLLM using Docker Compose on an ARM64 system (e.g., Raspberry Pi 5) using the
:latesttag.- 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:
- Example
- Configure an MCP server in
/path/on/host/anythingllm/storage/plugins/anythingllm_mcp_servers.jsonusing thenpxmethod, ensuring the full path tonpx(found viadocker exec -it anythingllm which npx, likely/usr/bin/npx) is used for thecommandfield.- 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\" }" } } } }
- Example
- Ensure the container is fully restarted (
docker compose down && docker compose up -d). - Navigate to Agent Skills in the UI and attempt to start the configured MCP server (
notionApi). - Observe that the UI correctly displays the
Startup Commandas/usr/bin/npx .... - Check the container logs (
docker logs anythingllm). - Expected: Logs should show an attempt to execute
/usr/bin/npx -y @notionhq/notion-mcp-server. - Actual: Logs show
sh: 1: notion-mcp-server: not foundfollowed by theConnection closederror. - (Optional Confirmation): Rename the key from
"notionApi"to"myNotionTool"in the JSON file, repeat steps 3-7. Observe the logs still showsh: 1: notion-mcp-server: not foundwhen trying to startmyNotionTool.