================================================================================
  SindByte MCP Server -- Claude Code Setup Guide
  Connecting Anthropic Claude Code to Your Local Endpoint
================================================================================
Date: 2026-04-17
For: SindByte Server v1.9.09

--------------------------------------------------------------------------------
 1. WHAT IS CLAUDE CODE?
--------------------------------------------------------------------------------
Claude Code is Anthropic's official terminal-based AI coding assistant.
It is NOT the same as Codex, OpenCode, or any other tool.

  Official source:   https://claude.ai
  Install command:   npm install -g @anthropic-ai/claude-code
  Config file:       ~/.claude/settings.json

--------------------------------------------------------------------------------
 2. REQUIRED INFORMATION
--------------------------------------------------------------------------------
  SindByte Base URL:   http://127.0.0.1:8091/v1
  API Key:             sk-sindbyte-local   (or any text -- not checked)

  IMPORTANT: SindByte must be running before you start Claude Code.

--------------------------------------------------------------------------------
 3. INSTALL CLAUDE CODE
--------------------------------------------------------------------------------
  STEP 1 -- Open PowerShell and install via npm:

    npm install -g @anthropic-ai/claude-code

    Or use the native Windows installer:
    irm https://claude.ai/install.ps1 | iex

  STEP 2 -- Verify installation:

    claude --version

--------------------------------------------------------------------------------
 4. CONFIGURE CLAUDE CODE FOR SINDBYTE
--------------------------------------------------------------------------------
Claude Code normally connects to Anthropic's API. To route it through
SindByte, we need to override the base URL and model.

  METHOD A -- Environment Variables (simplest)

    STEP 1 -- Set these environment variables in your terminal:

      set ANTHROPIC_BASE_URL=http://127.0.0.1:8091/v1
      set ANTHROPIC_API_KEY=sk-sindbyte-local
      set CLAUDE_MODEL=LMDirect

    STEP 2 -- Make permanent (Windows):
      Win+R -> sysdm.cpl -> Advanced -> Environment Variables
      Add:
        ANTHROPIC_BASE_URL = http://127.0.0.1:8091/v1
        ANTHROPIC_API_KEY  = sk-sindbyte-local
        CLAUDE_MODEL       = LMDirect

    STEP 3 -- Start Claude Code:

      cd "[your-project-path]"
      claude

  METHOD B -- Claude Bridge (if Method A fails)

    Some versions of Claude Code ignore ANTHROPIC_BASE_URL.
    In that case install Claude Bridge:

      npm install -g @mariozechner/claude-bridge

    Then run:

      claude-bridge openai LMDirect --baseURL http://127.0.0.1:8091/v1 --apiKey sk-sindbyte-local

--------------------------------------------------------------------------------
 5. USING IQ TOOLS WITH CLAUDE CODE
--------------------------------------------------------------------------------
Claude Code does not have built-in IQ profile selection.
To use IQ Tools, set the default profile in SindByte:

  1. Open SindByte tray icon -> Config
  2. Find API Provider -> Default IQ Profile
  3. Set to "default", "research", or "trading"
  4. Save and restart SindByte

  Or use the model name to select an IQ profile:

    set CLAUDE_MODEL=iq/full
    claude

  Available IQ model aliases:
    LMDirect          -- Direct chat, no IQ
    iq/full           -- Full IQ pipeline
    iq/research       -- Web research + CoT
    iq/trading        -- Trading tools
    iq/minimal        -- Auto-expert only
    iq/off            -- Same as LMDirect

--------------------------------------------------------------------------------
 6. TROUBLESHOOTING
--------------------------------------------------------------------------------

  PROBLEM: "claude command not found"
  FIX:     Check npm global bin is in PATH. Or use the native installer.

  PROBLEM: Claude opens browser asking for Anthropic login
  FIX:     Make sure ANTHROPIC_BASE_URL is set BEFORE running claude.
           If it still asks, use claude-bridge instead.

  PROBLEM: "Network error" or "Connection refused"
  FIX:     Verify SindByte is running on port 8091.

  PROBLEM: Claude says model not found
  FIX:     Set CLAUDE_MODEL to a valid SindByte alias (LMDirect, iq/full, etc.)

--------------------------------------------------------------------------------
 7. QUICK REFERENCE
--------------------------------------------------------------------------------
  | Setting          | Value                                  |
  |------------------|----------------------------------------|
  | Tool             | Claude Code (npm: @anthropic-ai/claude-code) |
  | Base URL         | http://127.0.0.1:8091/v1               |
  | API Key          | sk-sindbyte-local                      |
  | Env var (URL)    | ANTHROPIC_BASE_URL                     |
  | Env var (Key)    | ANTHROPIC_API_KEY                      |
  | Env var (Model)  | CLAUDE_MODEL                           |
  | IQ Timeout       | 3600 sec (1 hour)                      |

================================================================================
  END OF GUIDE
================================================================================
