Connect your agent, and let it ask instead of read

The short answer

This is the one step CodeMesh cannot do for you: your agent cannot query CodeMesh until it is connected over MCP. Click Connect next to your agent in the panel and CodeMesh writes its MCP entry, installs its instructions, then proves it with a live handshake. Connected means the handshake passed, not that you clicked.

Claude.ai
Claude Code
Cursor
Devin (formerly Windsurf)
VS Code
ChatGPT
Any MCP client

What Connect actually does

  1. Writes the MCP entry. Into the config file that agent reads, in the format that agent expects. This is the step people get wrong by hand, because every agent puts it somewhere different.
  2. Installs the instructions. An agent with a tool it does not know when to reach for will keep reading files instead, so the instructions matter as much as the connection.
  3. Runs a handshake. A real call over the real transport. If it fails you are told immediately, rather than finding out later when an answer looks wrong.

Any MCP client works, including agents not listed in the panel. For those, the panel keeps the raw endpoint details on its Connect tab.

CodeMesh panelrunning
The Connect tab, running. Agents on the left, endpoints behind them.

What your agent gets

Three kinds of question, three kinds of answer. A value or a definition comes back as the matching lines. A path, a call chain or a dependency is walked over real edges. An exact string is searched. In every case what returns is spans of code, not files.

Asked and answered

The console beside this shows the shape of a reply: a question, the tool that answers it, and the spans that came back. No repository crawl, and nothing opened that turned out to be irrelevant.

The exchange below it is the same thing from the agent's side, as a session transcript.

codemesh · openclawasking
Results
waiting for the question
claude: connected to CodeMesh
‣ Where do we handle token refresh, and who calls it?
⚙ search-code query: "token refresh"
→ server/auth/tokens.ts:118  score 0.94
→ engine/src/auth.rs:47  score 0.81
⚙ query-context MATCH (c:CodeFunction)-[:CALLS]->(f) WHERE f.name = 'refreshTokens'
→ 3 callers
refreshTokens() in server/auth/tokens.ts rotates the token and revokes the whole family if a spent one is replayed. Called from the token endpoint, the daemon's retry path, and auth.rs on a 401.

For a client the panel does not list

Any MCP client works. The panel keeps the raw endpoint on its Connect tab, and for a client it does not know about, this is the entry to add by hand. It is the same entry the panel writes for you.

After adding it, restart the client and confirm it lists the CodeMesh tools. That is the hand-rolled equivalent of the handshake.

mcp.json
{
  "mcpServers": {
    "codemesh": {
      "command": "codemesh",
      "args": ["mcp-stdio"]
    }
  }
}
Technical note
Every tool call is logged with a preview of its arguments, and every member of your organisation can see those previews for the last 90 days in the activity view. If you connect an agent, assume its questions are visible to your team.

Per-agent notes

The mechanism is identical everywhere, so these pages cover only what is specific to each tool: where its config lives and how it reports a working connection.

Do I have to edit a config file by hand?

No. The panel writes it. Hand-editing is the fallback for agents the panel does not list, and the raw details for that are on its Connect tab.

Can I connect more than one agent?

Yes. Each connection is separate, and each can be revoked on its own. Disconnecting kills that agent's tokens immediately rather than at their next expiry.

What can a connected agent read?

Whatever the scopes you granted cover. The read scope covers structural queries across your graph, which includes git metadata and commit author details, so the authorisation screen is worth reading rather than clicking through.

My agent connected but still reads files. Why?

Usually the instructions did not install, so the agent has the tool but no sense of when to use it. Reconnect from the panel: the handshake step will tell you if the entry is there but the instructions are missing.

Install the extension and connect in one sitting

Install, sign in, click Connect. The handshake tells you when it is genuinely working.

Install the extensionSee the Benchmark