# Arkheia MCP Server — Setup Guide This guide covers the **Python** MCP server in this repository, which has nine tools and does **not** include the feedback tools (`arkheia_feedback`, `arkheia_report`, `arkheia_reports`). **To install the full server, including the feedback tools, follow the npm instructions instead:** see the root [README.md](README.md#install) (`npm install -g @arkheia/mcp-server`, Node 20+) and [npm-wrapper/README.md](npm-wrapper/README.md#register-with-your-cli) for registering it with each agent. Only follow the steps below if the user specifically wants the Python server. ## Prerequisites - **Python 3.10+** — check: `python3 --version` (or `python --version` on Windows) - **Git** — check: `git --version` ## Step 1: Get an API Key Option A — Automatic (recommended): ```bash curl -X POST https://arkheia-proxy-production.up.railway.app/v1/provision \ -H "Content-Type: application/json" \ -d '{"email": "you@example.com"}' ``` This returns a key. Save it. A new key works once the email address is confirmed: open the link we email you and press Confirm (an unconfirmed request is deleted after 24 hours). Option B — Manual: Visit https://arkheia.ai and sign up. Your key will be emailed. ## Step 2: Configure Claude Desktop Edit your Claude Desktop config file: | OS | Path | |----|------| | macOS | `~/Library/Application Support/Claude/claude_desktop_config.json` | | Windows | `%APPDATA%\Claude\claude_desktop_config.json` | | Linux | `~/.config/Claude/claude_desktop_config.json` | First, clone the repo and create a virtual environment (one time only): ```bash git clone https://github.com/arkheiaai/arkheia-mcp.git ~/.arkheia-mcp cd ~/.arkheia-mcp python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt ``` On Windows, use `%USERPROFILE%\.arkheia-mcp` instead of `~/.arkheia-mcp`. Then add this to the config file (create it if it doesn't exist): ```json { "mcpServers": { "arkheia": { "command": "~/.arkheia-mcp/.venv/bin/python", "args": ["-m", "mcp_server.server"], "cwd": "~/.arkheia-mcp", "env": { "PYTHONPATH": "~/.arkheia-mcp", "ARKHEIA_API_KEY": "ak_live_YOUR_KEY_HERE" } } } } ``` On Windows, replace `~/.arkheia-mcp` with the full path, e.g. `C:/Users/YourName/.arkheia-mcp`. Replace `ak_live_YOUR_KEY_HERE` with your actual API key from Step 1. ## Step 2 (alt): Configure Claude Code Add to `~/.claude/settings.json`: ```json { "mcpServers": { "arkheia": { "command": "~/.arkheia-mcp/.venv/bin/python", "args": ["-m", "mcp_server.server"], "cwd": "~/.arkheia-mcp", "env": { "PYTHONPATH": "~/.arkheia-mcp", "ARKHEIA_API_KEY": "ak_live_YOUR_KEY_HERE" } } } } ``` ## Step 3: Restart Claude Close and reopen Claude Desktop (or restart Claude Code). The Arkheia tools will appear automatically. ## Step 4: Verify Ask Claude: "Use arkheia_verify to check this response for fabrication: 'The Eiffel Tower is located in Berlin, Germany.'" You should see a detection result with `risk_level: HIGH` and a confidence score. ## Available Tools | Tool | What it does | |------|-------------| | `arkheia_verify` | Score any (prompt, response, model) triple for fabrication risk. Returns LOW/MEDIUM/HIGH with confidence. | | `arkheia_audit_log` | Retrieve your detection history. | | `run_grok` | Call xAI Grok and screen the response (requires `XAI_API_KEY`). | | `run_gemini` | Call Google Gemini and screen the response (requires `GOOGLE_API_KEY`). | | `run_together` | Call Together AI models and screen the response (requires `TOGETHER_API_KEY`). | | `run_ollama` | Call a local Ollama model and screen the response (requires Ollama running). | | `memory_store` | Store entities in a persistent knowledge graph. | | `memory_retrieve` | Search the knowledge graph. | | `memory_relate` | Create relationships between entities. | ## Environment Variables | Variable | Required | Default | Description | |----------|----------|---------|-------------| | `ARKHEIA_API_KEY` | Yes | — | Your API key (`ak_live_...`). Get one free at Step 1. | | `ARKHEIA_PROXY_URL` | No | (unset) | Only if you run your own Arkheia proxy; otherwise verification goes to the hosted API. | | `ARKHEIA_HOSTED_URL` | No | Railway production URL | Hosted detection API. | | `XAI_API_KEY` | No | — | Required for `run_grok` tool. | | `GOOGLE_API_KEY` | No | — | Required for `run_gemini` tool. | | `TOGETHER_API_KEY` | No | — | Required for `run_together` tool. | ## Free Tier 1,500 detections/month. No credit card required. Upgrade at https://arkheia.ai. ## Troubleshooting **"Python 3.10+ is required but not found"** Install Python from https://python.org. On Windows, check "Add to PATH" during install. **Tools don't appear in Claude** 1. Check the config file path is correct for your OS 2. Ensure valid JSON (no trailing commas) 3. Restart Claude completely (quit + reopen, not just close window) **"Missing API key" or UNKNOWN results** Set `ARKHEIA_API_KEY` in the env block of your config. Verify your key works: ```bash curl -X POST https://arkheia-proxy-production.up.railway.app/v1/detect \ -H "X-Arkheia-Key: " \ -H "Content-Type: application/json" \ -d '{"model":"gpt-4o","response":"test"}' ``` **Quota exceeded (429)** Free tier is 1,500/month. Check usage or upgrade at https://arkheia.ai. ## Support - GitHub Issues: https://github.com/arkheiaai/arkheia-mcp/issues - Email: support@arkheia.ai - Website: https://arkheia.ai ## For AI Agents Contributing to This Repo - Never push directly to main — work on feature branches and open a PR - Destructive git operations (rewriting history, discarding commits) are permanently prohibited on any pushed branch - All Arkheia repos have branch protection enforced by GitHub — violations will be rejected server-side - If a push is rejected, resolve the divergence via rebase or merge; never attempt to override the rejection