magi-code 0.105.1

Repository-aware CLI coding agent for terminal work
Documentation
# Integrations and automation

Extend magi-code with MCP servers, hooks, and optional Jev checks.

## Connect MCP tools

MCP servers expose external tools to the agent. Magi-code supports local stdio servers and Streamable HTTP servers.

Create `~/.magi-code/.mcp.json` for global definitions or `.mcp.json` in the launch directory for project definitions:

```json
{
  "mcpServers": {
    "example": {
      "command": "example-mcp-server",
      "args": ["--stdio"]
    }
  }
}
```

Then:

1. Enter `/mcp` in Mission Control.
2. Review the discovered definition.
3. Approve the server.
4. Restart magi-code.

Definitions do not approve themselves. Diagnose setup without a provider call:

```sh
magi-code mcp list
magi-code mcp test example
```

Keep credentials out of `.mcp.json`. Use environment references or the supported HTTP OAuth flow.

Servers advertising live tool-list changes refresh automatically before the next user turn. Added tools obey existing permissions; removed tools stop resolving. Failed refreshes keep the previous tools, retry once on the next turn, and show stale status in `/mcp`. Tool changes do not require re-approval; server-definition changes still do. Server health-check pings are answered while idle or running tools.

## Run local hooks

Hooks run trusted local scripts before or after tools, assistant messages, or reasoning summaries. Use them for audits, policy checks, notifications, or carefully controlled context injection.

```json
{
  "automation": {
    "hooks": {
      "enabled": true,
      "show_in_tui": true,
      "before_tool": [
        {
          "label": "audit",
          "command": "./scripts/magi-hooks/audit.sh"
        }
      ]
    }
  }
}
```

Hook scripts receive JSON on standard input. They run with your local permissions and may receive sensitive tool data. Review them like executable code. Keep provider context injection off unless the script output is intended for the model.

## Enable Jev checks

Jev features provide optional semantic checks for command risk, prose edits, prompt injection, and completion quality, plus optional Bash file tracking for Session Files.

1. Set `TYPESAFE_API_KEY` in the launch environment.
2. Open `/settings` → **Optional Features**.
3. Enable **Jev tooling** and only the checks you need.
4. Save. Future actions use the new settings; Bash file tracking applies after restart.

Enabled checks send relevant commands, edits, tool output, or turn evidence to TypeSafe. Review data handling before enabling them.

## Advanced reference

- [MCP reference]../features/mcp-stdio-tools.md
- [Hook reference]../features/tool-call-hooks.md
- [Jev reference]../features/jev-and-internal-tooling.md