Connect

Legible Connect: Setup Guide for Claude Code & OpenAI Codex Integration

Easily connect your Legible knowledge base to Claude Code or OpenAI Codex with our quick setup guide. Integrate your content seamlessly into AI agents in under 30 seconds.

5 min readUpdated 2026-03-22Legible Connect
Why this matters

Legible Connect exposes your content as a live MCP server. AI agents can search, retrieve, and use your knowledge base as context — no copy-pasting, no file uploads.

This guide walks through setup for Claude Code and OpenAI Codex, documents the available tools, and covers troubleshooting.

Prerequisites

  • A Legible account with at least one connected site.
  • Your workspace ID — found in your dashboard under Settings.
  • An API key — generate one from Settings → API Keys.

Connect to Claude Code

Open your Claude Code MCP configuration. The config location depends on your setup: global at ~/.claude/claude_desktop_config.json, or per-project at .claude/mcp.json in your project root.

Add the Legible MCP server configuration:

{
  "mcpServers": {
    "legible": {
      "url": "https://mcp.getlegible.com/YOUR_WORKSPACE_ID",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Connect to OpenAI Codex

Codex uses the same MCP configuration format. Add the Legible server to your Codex MCP settings:

{
  "mcpServers": {
    "legible": {
      "url": "https://mcp.getlegible.com/YOUR_WORKSPACE_ID",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

Available Tools

Legible Connect exposes three MCP tools that your AI agent can call automatically:

  • search_context — Search your knowledge base for relevant content. Parameters: query (string, required), limit (number, optional, default 5). Returns content chunks with relevance scores and source metadata.
  • get_document — Retrieve a full document by its ID. Parameters: document_id (string, required). Returns the full document in Markdown with metadata.
  • list_sources — List all content sources in your workspace. No parameters. Returns an array of sources with document counts and last-updated timestamps.

How It Works in Practice

When you ask your AI agent something like 'Write a blog post about our new pricing model,' the agent automatically calls search_context to find relevant content from your knowledge base — existing blog posts, pricing pages, brand guidelines. The response draws from YOUR content, not generic training data.

This means on-brand copy, accurate product details, and consistent messaging — all without manually pasting context into every prompt.

Endpoint Reference

  • Base URL: https://mcp.getlegible.com/{workspace_id}
  • Authentication: Bearer token via Authorization header.
  • Protocol: MCP (Model Context Protocol) over HTTPS.
  • Rate limits: 100 requests/minute (configurable per plan).

Troubleshooting

  • "Connection refused" — Check your workspace ID and API key are correct.
  • "No results returned" — Ensure your site has been crawled and content is indexed. Check the Content Library in your dashboard.
  • "Rate limit exceeded" — Upgrade your plan or reduce request frequency.
  • "Unauthorized" — Regenerate your API key from Settings → API Keys.
  • Agent doesn't use Legible tools — Restart your AI agent after adding the MCP config.