Skip to content

feat(mcp): support ${projectRoot} placeholder in server config#84

Open
sswater wants to merge 1 commit into
OpenBMB:mainfrom
sswater:feature/mcp-projectroot-placeholder
Open

feat(mcp): support ${projectRoot} placeholder in server config#84
sswater wants to merge 1 commit into
OpenBMB:mainfrom
sswater:feature/mcp-projectroot-placeholder

Conversation

@sswater
Copy link
Copy Markdown

@sswater sswater commented May 31, 2026

Pass projectRoot through the config loading pipeline so that ${projectRoot} in mcp.json string values (e.g. cwd, args) is replaced with the actual project directory at runtime.

This enables portable MCP configs across Docker, CI/CD, and multi-user environments without hardcoding absolute paths.

Pass projectRoot through the config loading pipeline so that
${projectRoot} in mcp.json string values (e.g. cwd, args) is
replaced with the actual project directory at runtime.

This enables portable MCP configs across Docker, CI/CD, and
multi-user environments without hardcoding absolute paths.
@sswater
Copy link
Copy Markdown
Author

sswater commented May 31, 2026

我的应用场景是,我想给 project 添加 codegraph 索引或 cocoindex 索引,这种项目级的索引,需要 mcp server 启动在 project 目录。因此,需要支持 { "cwd": "${projectRoot}" } 配置。 OpenCode 和 Claude Code 默认是将项目目录作为 mcp 进程的工作目录。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant