Skip to content

feat: adds cwd to the MCP yaml as an option. #6280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 7, 2025
Merged

feat: adds cwd to the MCP yaml as an option. #6280

merged 6 commits into from
Jul 7, 2025

Conversation

bdougie
Copy link
Collaborator

@bdougie bdougie commented Jun 24, 2025

Description

Now users can configure MCP servers with a current working directory (cwd):

  mcpServers:
    - name: my-project-server
      command: npm
      args: ["run", "mcp-server"]
      cwd: "/path/to/my/project" # this field is new
      env:
        NODE_ENV: "production"

The implementation supports:

  • Absolute paths: /Users/developer/project
  • Relative paths: ./my-project or ../servers
  • Optional usage (backward compatible)

The cwd option will be passed directly to the StdioClientTransport, allowing MCP servers to run in their intended working directory context.

This work unblocks the work I am doing with LanceDB in this repo

https://github.com/bdougie/git_blame_search/?tab=readme-ov-file#continue-integration

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screenshots

[ For visual changes, include screenshots. Screen recordings are particularly helpful, and appreciated! ]

Tests

Note the tests were generated using Claude. cc @uinstinct for a look to see if they match the work you've already done.

The tests confirm that the cwd is not required and successfully transports the MCP to the current directory.

@bdougie bdougie requested a review from a team as a code owner June 24, 2025 18:38
@bdougie bdougie requested review from tomasz-stefaniak and removed request for a team June 24, 2025 18:38
Copy link

netlify bot commented Jun 24, 2025

Deploy Preview for continuedev ready!

Name Link
🔨 Latest commit 30596c0
🔍 Latest deploy log https://app.netlify.com/projects/continuedev/deploys/686c157d6fd6240008cc8515
😎 Deploy Preview https://deploy-preview-6280--continuedev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 24, 2025
Copy link

recurseml bot commented Jun 24, 2025

⚠️ Only 5 files will be analyzed due to processing limits.

Copy link

recurseml bot commented Jun 24, 2025

✨ No issues found! Your code is sparkling clean! ✨

@TyDunn TyDunn requested review from sestinj and removed request for tomasz-stefaniak July 7, 2025 18:43
@bdougie bdougie force-pushed the bdougie/mcp-cwd branch from 6e567f1 to 30596c0 Compare July 7, 2025 18:44
Copy link
Contributor

@sestinj sestinj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks for the tests + docs

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Jul 7, 2025
@sestinj sestinj merged commit 44c4c82 into main Jul 7, 2025
40 checks passed
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 7, 2025
@sestinj sestinj deleted the bdougie/mcp-cwd branch July 7, 2025 19:13
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Jul 7, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2025
@sestinj
Copy link
Contributor

sestinj commented Jul 22, 2025

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm This PR has been approved by a maintainer released size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants