bun-workspaces provides its own MCP server via bunx bun-workspaces mcp-server. This can be used with any tooling that supports MCP.
When you set up the MCP server with your tool, it will know the basics of how to use bun-workspaces, so you don't have to teach it,
and it can look up more comprehensive docs via resources. It also will have a variety of tools for getting metadata about the project you're working in.
Some tools work with a limited PATH that may not include bun, so you may need to use: /bin/sh -c PATH="$HOME/.bun/bin:$PATH" exec bunx bun-workspaces mcp-server
instead
of a plain bunx bun-workspaces mcp-server.
If Bun is installed somewhere else, you'll need to adjust the command to include the path to the Bun executable instead
of $HOME/.bun/bin.
If your project root is in a different directory than the one you're working in with your tool, you can add the working directory
for bun-workspaces to the command as: bunx bun-workspaces --cwd=path/to/project/root mcp-server.
Add the following to your .cursor/mcp.json file for the project you're working in.
{
"mcpServers": {
"bun-workspaces": {
"command": "/bin/sh",
"args": [
"-c",
"PATH=\"$HOME/.bun/bin:$PATH\" exec bunx bun-workspaces mcp-server"
]
}
}
}
Add the following to your .mcp.json file for a directory you're working in.
{
"mcpServers": {
"bun-workspaces": {
"command": "bunx",
"args": [
"bun-workspaces",
"mcp-server"
]
}
}
}