The setup
@mondaydotcomorg/monday-api-mcp— for workspace automation (platform API)
@mondaydotcomorg/monday-api-mcp@latest--mode apps — for the apps framework
~/.cursor/mcp.json. For a single instance, the docs work fine. But things get interesting when you have multiple instances.Problem 1: The ENOTEMPTY race condition
npx package, Cursor starts them all simultaneously at launch. Each one tries to install/update the package into the same shared npx cache directory — and they collide:npm error ENOTEMPTY: directory not empty, rename
'~/.npm/_npx/<hash>/node_modules/hono'
-> '~/.npm/_npx/<hash>/node_modules/.xxx'Solution: Give each server its own isolated npm cache directory using npm_config_cache in the env block:
"env": {
"npm_config_cache": "${userHome}/.npm/_npx-<mcp-name>"
}
Problem 2: Tokens hardcoded in mcp.json
"args": ["@mondaydotcomorg/monday-api-mcp", "-t", "<toke>n..."]This works, but your API tokens end up in plain text in a config file. Not ideal.
envFile option for stdio servers that loads a .env file into the process environment, and ${env:VAR_NAME} interpolation in config fields. The catch: ${env:VAR_NAME} in args is resolved at config-parse time from the system environment, before envFile is loaded. So this doesn't work as expected:"args": ["-t", "${env:MONDAY_PROD_TOKEN}"] // resolves to empty stringSolution: Use /bin/sh -c "..." as the command so the shell expands variables at runtime, after envFile has been loaded into the process environment:
{
"command": "/bin/sh",
"args": ["-c", "npx @mondaydotcomorg/monday-api-mcp -t $MONDAY_PROD_TOKEN --enable-dynamic-api-tools true"],
"envFile": "${userHome}/.config/mcp/secrets",
"env": {
"npm_config_cache": "${userHome}/.npm/_npx-<mcp-name>"
}
}
~/.config/mcp/secrets file (chmod 600):MONDAY_DEV_TOKEN=eyJ...
MONDAY_PROD_TOKEN=eyJ...
PATH=/path/to/your/node/bin:/usr/bin:/bin> Note: ${userHome} does work in envFile, even though it's not explicitly listed in the Cursor docs.
Problem 3: Node version management
env.PATH. This is brittle — it breaks whenever you update Node, and you have to repeat it in every server config.PATH in the secrets file alongside your tokens. It becomes a single place to update, and it's automatically loaded by envFile for every server:MONDAY_PROD_TOKEN=eyJ...
PATH=/Users/yourname/.nvm/versions/node/v20.18.3/bin:/usr/bin:/bin
{
"mcpServers": {
"monday-api-dev": {
"command": "/bin/sh",
"args": ["-c", "npx @mondaydotcomorg/monday-api-mcp -t $MONDAY_DEV_TOKEN --enable-dynamic-api-tools true"],
"envFile": "${userHome}/.config/mcp/secrets",
"env": { "npm_config_cache": "${userHome}/.npm/_npx-monday-api-dev" }
},
"monday-api-prod": {
"command": "/bin/sh",
"args": ["-c", "npx @mondaydotcomorg/monday-api-mcp -t $MONDAY_PROD_TOKEN --enable-dynamic-api-tools true"],
"envFile": "${userHome}/.config/mcp/secrets",
"env": { "npm_config_cache": "${userHome}/.npm/_npx-monday-api-prod" }
},
"monday-apps-dev": {
"command": "/bin/sh",
"args": ["-c", "npx @mondaydotcomorg/monday-api-mcp@latest -t $MONDAY_DEV_TOKEN --mode apps"],
"envFile": "${userHome}/.config/mcp/secrets",
"env": { "npm_config_cache": "${userHome}/.npm/_npx-monday-apps-dev" }
},
"monday-apps-prod": {
"command": "/bin/sh",
"args": ["-c", "npx @mondaydotcomorg/monday-api-mcp@latest -t $MONDAY_PROD_TOKEN --mode apps"],
"envFile": "${userHome}/.config/mcp/secrets",
"env": { "npm_config_cache": "${userHome}/.npm/_npx-monday-apps-prod" }
}
}
}
| Problem | Solution |
|---|---|
ENOTEMPTY cache collision | Unique npm_config_cache per server |
| Tokens in config file | envFile + shell variable expansion |
${env:VAR} in args is empty | Use /bin/sh -c "... $VAR ..." instead |
| Node version hardcoded everywhere | Put PATH in the secrets file |
| Repeated tokens across servers | One secrets file, shared by all servers |
Hope this saves someone the debugging time. Happy to answer questions!