Documentation

Documentation

Everything you need to build with CtxKit.

Quick Start

1

Create a Project

Sign up and create a project. Get 100 free credits.

2

Create API Key

Enable url-ingest service and create an API key.

3

Connect Agent

Add MCP config to Claude or Cursor. Or call REST API.

MCP Integration

Add the following to your Agent's MCP configuration (e.g. claude_desktop_config.json or .cursor/mcp.json):

json
{
  "mcpServers": {
    "ctxkit": {
      "url": "https://api.ctxkit.cn/mcp",
      "headers": {
        "X-API-Key": "YOUR_API_KEY_HERE"
      }
    }
  }
}

Replace YOUR_API_KEY_HERE with your actual API key. The MCP server exposes 6 tools that your agent can call directly.

REST API

Authentication

All requests require an X-API-Key header. Keys are project-scoped and can be created in your project settings.

Ingest a URL

bash
curl -X POST https://api.ctxkit.cn/api/v1/projects/{project_id}/url-ingest/ingest \
  -H "X-API-Key: YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/document.pdf"}'

Poll Job Status

bash
curl https://api.ctxkit.cn/api/v1/projects/{project_id}/url-ingest/jobs/{job_id} \
  -H "X-API-Key: YOUR_API_KEY_HERE"

Semantic Search

bash
curl -X POST https://api.ctxkit.cn/api/v1/projects/{project_id}/url-ingest/search \
  -H "X-API-Key: YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{"query": "your search query", "limit": 10}'

Available Tools

ctxkit_ingest_url

Submit a URL for background processing. Returns a job_id for polling.

Parameters: url (required), options (optional dict)

ctxkit_ingest_get_job

Check the status of a processing job.

Parameters: job_id (required)

ctxkit_ingest_get_resource

Get metadata for a processed resource: title, summary, TOC, page count.

Parameters: resource_id (required)

ctxkit_ingest_list_resources

List all resources in the project with pagination.

Parameters: offset (default: 0), limit (default: 20)

ctxkit_ingest_read

Progressive disclosure reading. Navigate documents hierarchically.

Parameters: resource_id (required), section (optional), offset (default: 0), limit (default: 4000)

ctxkit_ingest_search

Semantic search across resources using vector similarity.

Parameters: query (required), resource_id (optional), limit (default: 10)

Ready to get started?

Sign up for 100 free credits. No credit card required.

Get Started