What is the schema definition of mcp.json? What are its capabilities?
What directory or environment does it execute the command within?
Can we interpolate variables (like $pwd) within the command?
Is there support for relative pathing within project-level mcp.json files?
Crazy this hasn’t been answered. I have the same questions. I cannot see the MCP GUI , it just opens an mcp.json blank file and then I get this, no documentation on it either
Hi the cursor team has changed 0.48 MCP handling
They explain the MCP setup here
As some users create separate threads this has been already answered elsewhere. By the time 0.48 was released the Docu page was already updated.
Hope this helps.
thanks. i was confused wondering how to enable the UI for the mcp adding. got it working now.
Yes previous version had UI.
Another doubt, has any property that is possible to disable the pattern the MCP.
Ex: If I leave configured about 10 mcps, but just want to manually activate when use something. Something like: “Startup: ‘Enable’ | ‘Disable’”
Doubt? thats in the UI enable disable button, use refresh to check if its working after enabling
More to the point, here are three of my original questions:
What directory or environment does it execute the command within?
Can we interpolate variables (like $pwd) within the command?
Is there support for relative pathing within project-level mcp.json files?
The ability to specify “.env” files helps a bit in this regard.
But these other questions are especially relevant for for project-level mcp.json files. Why? Because if you want an MCP to boot with a particular project, you want to be able to access project-level resources (like perhaps the script that runs the server), and therefore the directory from which the server command is launched becomes relevant.
What directory or environment does it execute the command within?
- Any directory the terminal of Agent is currently in.
- By default that would be the project directory unless there is special reason to leave that.
Can we interpolate variables (like $pwd) within the command?
- Any command that would run in terminal the MCP start code in Cursor can execute..
- So yes also interpolation or any other features of your OS terminal / user terminal that you can use yourself. There is technically not really a limit. In the most complex case it would write itself a shell script and propose to execute that.
- The command is in fact run in terminal.
Is there support for relative pathing within project-level mcp.json files?
- There is no reason that I know of why relative paths would not work in terminal or MCP.json. While i may have not tried it directly I have seen here relative paths.
- In teminal and depending on language used or the MCP server language (node, python or others as wel, technically any language thas has cli or http can be used for MCP servers) you can pass the current working directory assuming that the MCP server was coded to accept it.
- In many cases there are hardcoded directories in the MCP server code so using project directory to run mcp server may not work as expected but that is dependent on the MCP server code.
- Additionally unless you develop an MCP server (which would be great), adding the mcp server within project directory may required excluding it from indexing and other features and would slow down your project unnecessarily. (but yes, cursorignore and cursorindexignore would solve that part)
For .env in MCP config:
- MCP is still quite new and MCP servers change a lot.
- Cursor is not yet adjusted to support local variables, the Cursor team is working on lots of new features and at same time bugfixes, support etc. so its challenging in a pre-v1 version to have it all inside just yet.
- In fact many users suggested in the forum not to do it, in their case for security reasons. (not taking sides here, just giving you the details)
- But likely it will come as this was requested often (env), overall we have to see what they ship.
I don’t think that a project managed MCP server executes in the project directory. If you type pwd
or ls
as the command and look at the Cursor MCP logs, its running it from the home directory. That’s how it is on mine, maybe this is configurable.
I am also observing that the MCP server in fact does not execute in the project directory. At least on macOS, the pwd is “/”.
Is there any new knowledge about this? We’re trying to control MCP registration automatically and we need capabilities like tool filtering and so on using mcp.json
, would love to know the capabilities.