Claude Code

Claude Code is the terminal-based Claude assistant. It supports MCP via configuration file, with both OAuth and API-key paths available. For most workflows, an API key is the cleanest fit — Claude Code is often used in scripts and CI where browser-based OAuth isn't ideal.

  • Mint an API key at mindwiki.io/account/api-keys.
  • Choose scopes: read+write for general use, read only if you want strict browse-only access.
  • Copy the key (it's shown exactly once).

Add MindWiki to your Claude Code MCP configuration. The exact location depends on how you've configured Claude Code — typically ~/.claude/mcp.json or via the Claude Code CLI:

json
{
  "mcpServers": {
    "mindwiki": {
      "url": "https://api.mindwiki.io/mcp?token=YOUR_API_KEY"
    }
  }
}

Restart Claude Code to pick up the new server. Tool calls to mindwiki_* (and the ChatGPT-compatible search / fetch) will resolve through your MindWiki vault.

Storing the key safely

Never commit your API key to a repo. Use one of these:

  • An environment variable referenced by your shell (MINDWIKI_API_KEY).
  • A secrets manager your shell or terminal can read.
  • macOS Keychain via a helper script.

If you accidentally leak a key, revoke it immediately at mindwiki.io/account/api-keys and mint a new one.

Alternative: OAuth via remote MCP

If Claude Code's MCP integration supports remote MCP / OAuth in your version, the URL alone is enough:

json
{
  "mcpServers": {
    "mindwiki": {
      "url": "https://api.mindwiki.io/mcp"
    }
  }
}

The first time you invoke a MindWiki tool, Claude Code triggers the OAuth flow in your browser. After approval, the connection is reused.

Verify it works

Inside a Claude Code session:

> List the pages in my MindWiki vault under projects/

Claude calls mindwiki_list_pages with prefix: "projects/". You see the result inline.

> Capture this thought to my MindWiki vault: "Auth migration deferred to Q3."

Claude calls mindwiki_capture with the content. The capture lands in capture/ and shows up in your MindWiki app within seconds.

Common workflows

Claude Code is great at command-line-driven knowledge tasks against your vault:

  • Bulk reads. "Read every page under research/agent-memory and synthesize what we know."
  • Capture pipelines. Capture insights from terminal sessions or build outputs straight into the vault.
  • Pre-commit briefings. "Summarize what I've been writing in MindWiki today" before opening a PR description.
  • Decision records. Have Claude Code generate a decision page based on a chat history, then capture it.

Permissions

The connection scopes are determined by which auth path you use:

  • API key — exactly the scopes you selected when minting the key.
  • OAuth — full read+write after approval.

For automation that should never write to the vault, mint a read-only API key.

Troubleshooting

  • `INSUFFICIENT_SCOPE` error on a write tool. Your key is read-only. Mint a new key with write scope.
  • `TOKEN_INVALID` error. The key was revoked, mistyped, or never created. Verify on mindwiki.io/account/api-keys.
  • Tool not found. Confirm the url is correct and the server entry is named in your client. Restart Claude Code after edits.

Where to go next