# Connect Cody to Axiom

**Transport:** stdio (via OpenCtx bridge; native MCP support emerging)
**Auth:** local-stdio (Phase 0)
**Status:** Pending upstream — Cody integrates context providers via OpenCtx;
direct MCP-client support is partial as of 2026-Q2

Cody is Sourcegraph's AI coding assistant. Its primary extension model
is OpenCtx, which is conceptually adjacent to MCP but not wire-compatible.
Sourcegraph has signalled MCP convergence; meanwhile, the OpenCtx bridge
plus a thin shell adapter exposes Axiom's tools to Cody today.

## Install prerequisites

- Cody (VS Code or JetBrains extension; or the standalone `cody-cli`).
- An OpenCtx provider that wraps Axiom's MCP server (community tooling
  like `openctx-mcp-bridge` does this; check current upstream).

## Configure the connection (OpenCtx bridge)

Add an OpenCtx provider entry to Cody's settings (in VS Code's
`settings.json`):

```json
{
  "openctx.providers": {
    "https://openctx.org/npm/@openctx/provider-mcp-bridge": {
      "servers": {
        "axiom-root": {
          "command": "/absolute/path/to/.venv/bin/axi",
          "args": ["mcp", "serve"]
        }
      }
    }
  }
}
```

Worktree variant — add an `env` block to the server entry the same way
as the other Tier-1 recipes.

Until Cody ships first-party MCP client support, the bridge converts
Axiom's MCP tools into OpenCtx "items" that Cody can mention with
`@axiom-root:<tool>`.

## Verify

In Cody chat, `@`-mention the `axiom-root` provider:

```
@axiom-root:axiom_node__hooks_list
```

Cody should fetch the tool's metadata + invoke it. Expected output
includes the standard:

```json
{
  "node": "/Users/<you>/.axiom",
  "hooks_total": 0,
  "events_observed": [],
  "by_event": {}
}
```

## Notes

- This is a transitional integration. When Sourcegraph adds direct MCP
  support to Cody, this recipe will switch to a native `mcpServers`
  block and the OpenCtx bridge will be retired.
- OpenCtx and MCP have different concurrency models: OpenCtx is request/
  response, MCP is bidirectional with notifications. Tools that depend
  on MCP `progress` notifications won't work over the bridge.
- Cody Enterprise customers can also wire MCP servers via the
  `cody.advanced.agent` configuration; check Sourcegraph's deployment
  docs for your environment.

## What we'd need upstream

Direct MCP-client support in Cody (analogous to Cline / Continue.dev)
would let users skip the OpenCtx bridge entirely. Sourcegraph has
signalled this is on the roadmap; track at
https://github.com/sourcegraph/cody.

## Troubleshooting

| Symptom | Likely cause | Fix |
|---|---|---|
| `@axiom-root:` not autocompleting | bridge provider not loaded | Check Cody output panel for OpenCtx errors |
| Tool invocation hangs | bridge timeout | Bridge defaults to 30s; check `~/.axiom/logs/mcp/server.log` |
| Output truncated | Cody context limit | Use `axi mcp inspect <tool>` first to scope arguments |

## References

- ADR-038 §D7
- Cody docs: https://sourcegraph.com/docs/cody
- OpenCtx: https://openctx.org

_Copyright (c) 2026 B-Tree Ventures, LLC. Apache-2.0 licensed._
