A local DevOps-style MCP server that can:
- Discover projects under your development folders
- Build projects
- Run local tests
It exposes the following tools:
workspace_list()workspace_build(path)workspace_run_tests(path)
Prerequisites:
- Python 3.9+
# from the project root
pip install -e .[dev]Or build a wheel and install globally with pipx.
You can run the server module directly:
python -m cwm_mcp.serverOr use the console script:
cwm-mcpThe server communicates over stdio as specified by the Model Context Protocol (MCP).
You can configure where the server looks for projects:
- Environment variable
CWM_PROJECT_ROOTS(semicolon-separated on Windows, colon-separated on macOS/Linux). Example:
$env:CWM_PROJECT_ROOTS = "C:\\Users\\<USERNAME>\\source\\repos;C:\\dev\\projects"- Config file
cwm.config.jsonin the working directory:
{
"roots": [
"C:/Users/<USERNAME>/source/repos",
"C:/dev/projects"
]
}If none are provided, the server defaults to the current directory and common folders like ~/source/repos and ~/Projects.
- Project detection looks for sentinel files:
package.json,pyproject.toml,*.sln,pom.xml,build.gradle,Cargo.toml,go.mod, etc. - Build/test commands are selected automatically per project type and platform. Output includes exit code and captured stdout/stderr.
Add an entry to your MCP servers configuration. Example JSON snippet:
{
"mcpServers": {
"code-workspace-manager": {
"command": "python",
"args": ["-m", "cwm_mcp.server"],
"env": {
"CWM_PROJECT_ROOTS": "C:/Users/<USERNAME>/source/repos"
}
}
}
}On Unix-like systems, you can set command to cwm-mcp if installed.
- Lint:
ruff check . - Format:
black . - Test:
pytest
Note: This server requires the mcp Python package (the official Model Context Protocol SDK for Python).