Allow per-project MCP server configuration and support environment variables inside MCP configuration.
Wolfgang Miller
There is currently a global MCP configuration file for all MCP servers.
Some servers like the Postgres one require connection strings.
Those are normally project dependent. I have to change them manually every time I change project.
Additionally I do not want to store sensitive data in MCP configuration.
Would be great if environment variables are supported like
{
"mcpServers": {
"postgresql": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"${MY_CONNECT_STRING}"
]
}
}
}
Ernesto Jaboneta
Any progress on this?
A
AniyaMM
As early as April 1st, RooCode already supported this. They are open-source tools, and Cursor has long since adopted it. If you can't implement this feature, could you please quickly replicate it? This is a very important feature.
O
Olivier Reuland
Agreed, per-project MCP are critical for security as well. This allows creating PATs that have the least-privilege scope. Right now I am forced to use super PATs that have access to all my reports, all my databases, all my backends, etc. This is not ideal.
The
mcp_config.json
should simply be the content of the global one + local one. If there is a conflct the local wins. To disable an MCP locally simply set it to {}, e.g. the following would disable sequential-thinking locally:
"sequential-thinking": {}
Scott Burns
But yes, per-project MCP would be grand.
Scott Burns
You can use both
"env"
and "inheritEnv"
: "mcp-example": {
"command": "uv",
"args": [
"arg1",
"arg2"
],
"env": {
"MCP_DEBUG": "true",
"MCP_LOG_LEVEL": "DEBUG",
"UV_PROJECT": "blah blah"
},
"inheritEnv": [
"VARIABLE_TAKEN_FROM_PARENT_PROCESS"
]
A
AniyaMM
Scott BurnsIs it difficult to implement workspace-specific MCPs? Why have Cursor and Cline supported this feature for a long time, while you haven't launched it yet? This is a very important feature, and are you still trying to teach users how to adapt to this awkward operation? If you can't do it, can't you just copy from other products? Please remember, Windsurf is a commercial tool, and if you don't work hard to improve the user experience but instead try to educate your users, you will definitely lose to your competitors. Please update this feature as soon as possible; we urgently need it!
A
AniyaMM
Scott Burnsthis is Cursor's
Scott Burns
AniyaMM I don't work for Windsurf.