A workspace's MCP entries name their app by a relative path

Status: accepted

rails-ai-context init run in a folder of apps (a workspace, see GLOSSARY.md) writes one server per app into the folder's own MCP configs (#429). Those files may be committed, so each entry has to find its app on any machine, and an AI tool gives a stdio server nothing to find it with but the command line, the environment and the directory it starts the server in.

What the tools do

Checked against each tool's documentation and source in October 2026:

Tool Starts the server in Names the config's folder
Claude Code (.mcp.json) the folder it was launched in; it also reads a .mcp.json above that folder no; no cwd key either
Codex CLI (.codex/config.toml) its session directory no; a cwd key, itself relative to the session directory
OpenCode (opencode.json) the folder it was opened in no; a cwd key only from v1.17.4, and older versions reject unknown keys
VS Code (.vscode/mcp.json) the workspace folder ${workspaceFolder}
Cursor (.cursor/mcp.json) the editor (3.27): the project's folder; the agent CLI (2026.10.22): the folder it runs in no; the agent CLI passes ${workspaceFolder} to the server as literal text
Copilot CLI (.github/mcp.json) the folder it runs in (not documented; Claude Code's .mcp.json entries rely on the same) no

Decision

Consequences

The entries work when the tool is started in the workspace folder, which is the setup they are written for. A tool started inside one of the apps that still reads the workspace's config (Claude Code, Codex, OpenCode, Copilot CLI) starts each server there, where a relative path misses. The binary then names the folder the path was written for instead of guessing a different app; an in-Gemfile entry fails earlier, in Bundler, before the gem runs. An app opened on its own gets its own config from init run inside it.

Every server in a workspace runs under the Ruby the tool resolves in the workspace folder, which a version manager picks by that folder, not by the app. init warns when an app declares another; a standalone app that cannot boot under it answers from the static tier, and an in-Gemfile entry may not start.

Alternatives not taken