08. Extending Matcha
Local MCP servers
MCP (Model Context Protocol) servers add extra tools to a Matcha CLI session. You configure the server; Matcha CLI starts it, or connects to the URL you gave, and the assistant can call those tools next to the built-in ones.
This is about servers **you** add. There is no MatchaCode catalog to browse, no managed MCP gateway, and no official cloud of connectors.
Add a local (stdio) server
The usual first server is a local process. Matcha CLI launches it and talks over stdin/stdout.
From the project directory, or from anywhere for a user-wide server:
matcha mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/dirEverything after -- is the server command, so flags such as -y reach the server, not matcha.
Give the process environment with repeatable -e:
matcha mcp add postgres -e DATABASE_URL=postgres://localhost/mydb -- npx -y @modelcontextprotocol/server-postgresDefault scope is **user** (~/.matcha/config.toml). Use --scope project to write ./.matcha/config.toml in the current directory (shareable with the team).
Server names may contain only letters, numbers, hyphens, and underscores.
Equivalent TOML:
[mcp_servers.filesystem]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
enabled = truePoint at a remote server you already have
If a third-party host publishes an HTTP or SSE MCP endpoint, you can add **that URL**. This is not a MatchaCode product service.
matcha mcp add --transport http sentry https://mcp.sentry.dev/mcp
matcha mcp add --transport sse linear https://mcp.linear.app/sseRepeat --header "Name: value" for static auth. Prefer ${VAR} in committed project config instead of pasting a secret:
[mcp_servers.internal-tools]
url = "https://mcp.internal.example.com/mcp"
headers = { "Authorization" = "Bearer ${INTERNAL_MCP_TOKEN}" }OAuth for a **user-configured** remote server is allowed. After you add the server, open /mcps and press i on that row if the host asks you to sign in. Tokens land in ~/.matcha/mcp_credentials.json (owner-only permissions on Unix). There is no MatchaCode account in this flow.
List, enable, disable, remove, doctor
matcha mcp list
matcha mcp list --json
matcha mcp enable filesystem
matcha mcp disable filesystem
matcha mcp remove filesystem
matcha mcp doctor
matcha mcp doctor filesystemlistshows user and project servers. Project rows are marked(project); disabled rows are marked(disabled).removesearches both scopes. It exits 1 if the name is missing, or if the same name exists in both scopes — pass--scopeto choose.enable/disablepersist your personal on/off state in user~/.matcha/config.toml. Disable never rewrites a project file. Enable can clear a stickyenabled = falseon the nearest project definition.
In the TUI: `/mcps`
/mcpsThat opens the extensions modal on the **MCP Servers** tab. Outside the VS Code family you can also press Ctrl+L and switch to that tab.
| Key | Action |
|---|---|
Space | Enable or disable the selected server |
Enter | Expand and see its tools |
r | Reload after you edit config.toml |
a | Add a server |
x then y | Remove a local server |
i | Authenticate an OAuth server you configured |
MCP tools are namespaced: server github with tool create_issue becomes github__create_issue. The assistant finds them with search_tool and calls them with use_tool.
Project `.mcp.json` and other tools
Matcha CLI also **reads** MCP configs it did not write:
| Source | Typical path | Notes |
|---|---|---|
| Native TOML | ~/.matcha/config.toml, .matcha/config.toml | Highest priority |
| Claude | ~/.claude.json | [compat.claude] mcps |
| Cursor | ~/.cursor/mcp.json, <project>/.cursor/mcp.json | [compat.cursor] mcps |
.mcp.json | Project root (cwd → git root) | Loaded unless you imported or dismissed Claude import |
When names collide, the higher source wins: config.toml > Claude > Cursor > .mcp.json. Turn a vendor scan off with [compat.cursor] mcps = false or MATCHA_CURSOR_MCPS_ENABLED=false (and the Claude equivalents).
matcha inspect lists every loaded server and tags the vendor origin ([cursor], [claude]).
Project .matcha/config.toml is walked from cwd up to the git root. The deepest file wins. A same-named project server **replaces** the user server entirely (fields are not merged).
What is not available
- **MCP marketplace** — there is no catalog to install from.
- **Managed MCP gateway** — no
managed_gateway:…connectors. Those stay out of/mcpsandmatcha mcp enable/disable.
If a server will not start, run its command yourself, then check ~/.matcha/logs/mcp/<server>.stderr.log. matcha mcp doctor and matcha inspect show what was configured versus what connected.
What you should see
| You ran | Result |
|---|---|
matcha mcp add filesystem -- npx -y … /dir | Server in matcha mcp list |
/mcps then Space | Server toggles without restart |
matcha inspect | Servers tagged by source |
/marketplace or a product MCP store | Unavailable |