MCP servers in monorepo setup with Nx

I have a monorepo with Nx, and I cannot setup Prisma MCP server, because it’s used only in a specific project inside Nx. I’ve tried to setup Prisma MCP with:

  1. like in Prisma docs (it doesn’t see the schema, because it’s not in a root folder)
  2. Tried to use undocumented cwd property, that I’ve seen in one of the posts. It doesn’t work
  3. command: ‘cd’, and args like: [‘./libs/db-schema’, ‘;’, ‘npx’, ‘-y’,… It doesn’t work even with a absolute path
  4. Tried to run with nx:
  • Created a task ‘mcp’ in a project
  • Tried to setup task as a command: ‘nx’, args: [‘run’, ‘db-schema:mcp’, ‘–interactive=true’, ‘–outputStyle=static’](I’ve added additional parameters, so Nx would not polute the output). It doesn’t work. Seems that it doesn’t see project or it uses wrong current directory
  • Tried to setup the same with ‘npx’, same, no luck
  • Tried to setup with cd to project and nx call

As I understand, I cannot use Prisma MCP in my setup right now. The only solution that I see, is to clone prisma cli, and patch the implementation. But, I still need the env that Nx is providing from .env file.

So as a solution, I think that Cursor should have:

  1. Ability to provide cwd (relative to project or workspace root)
  2. Maybe some help for a Nx specific setup documented, like how to run it without