Skip to main content

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

This is a comprehensive documentation project for anysite.io, built using the Mintlify documentation platform. The project covers three main components:
  1. API Documentation - Complete REST API reference with OpenAPI synchronization
  2. MCP Server Documentation - Model Context Protocol server for AI integration
  3. n8n Nodes Documentation - Community nodes for workflow automation

Project Goals

  • Create comprehensive, user-friendly documentation for the entire anysite.io ecosystem
  • Maintain automatic synchronization with OpenAPI specifications
  • Provide interactive examples and code playgrounds
  • Support developers integrating with Anysite services across different platforms

Development Environment

Python Virtual Environment

Always use the virtual environment for Python dependencies:
# Activate virtual environment
source venv/bin/activate  # macOS/Linux
# or
venv\Scripts\activate     # Windows

# Deactivate when done
deactivate

Mintlify Development

# Start local development server
mintlify dev

# Build documentation
mintlify build

# Deploy to production (when ready)
mintlify deploy

Project Structure

/
├── venv/                 # Python virtual environment
├── docs.json             # Mintlify configuration (migrated from mint.json)
├── openapi-filtered.json # Filtered OpenAPI specification
├── filter_openapi.py     # OpenAPI filtering script
├── llms.txt             # AI documentation indexing
├── .ai/                 # AI assistant instructions
├── public/               # Public assets
│   └── images/
│       ├── make_mcp/     # Make AI Agent integration screenshots
│       └── clay_mcp/     # Clay AI Agent integration screenshots
├── api/                  # API Documentation
│   ├── authentication.mdx
│   ├── endpoints/
│   └── examples/
├── mcp-server/           # MCP Server Documentation
│   ├── tools.mdx
│   ├── unlimited-plan.mdx
│   ├── unlimited-plan-make.mdx  # Make AI Agent integration guide
│   ├── unlimited-plan-clay.mdx  # Clay AI Agent integration guide
│   ├── local-server/
│   ├── claude-desktop-tool/
│   ├── claude-code-tool/
│   └── n8n-tool/
├── n8n-nodes/            # n8n Nodes Documentation
│   ├── installation.mdx
│   ├── nodes/
│   └── workflows/
├── cli/                  # Anysite CLI Documentation
│   ├── overview.mdx
│   ├── installation.mdx
│   ├── agent-protocol.mdx  # Agent Protocol (JSON envelope, exit codes, discovery)
│   ├── endpoints.mdx
│   ├── api-calls.mdx
│   ├── batch-processing.mdx
│   ├── datasets/         # Dataset Pipelines
│   ├── database/         # Database Operations
│   │   ├── connections.mdx
│   │   ├── discovery.mdx   # Database Discovery & Catalog
│   │   └── operations.mdx
│   ├── llm-analysis.mdx
│   ├── querying.mdx
│   └── examples.mdx
├── claude-skills/        # Claude Skills Documentation
└── introduction.mdx      # Getting started guide

Key Resources

API Structure & Authentication

IMPORTANT API Details:
  • Base URL: https://api.anysite.io
  • Authentication: access-token header (NOT Bearer tokens)
  • HTTP Methods: All main endpoints use POST method (except token management endpoints which use GET)
  • Request Format: JSON request body for all POST endpoints
  • Endpoint Prefix: All main API endpoints have /api/ prefix
# Correct authentication and request format
curl -X POST "https://api.anysite.io/api/linkedin/user" \
  -H "access-token: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "linkedin.com/in/username"}'

# Token management endpoints (GET method)
curl -H "access-token: YOUR_API_KEY" https://api.anysite.io/token/statistic

# WRONG - DO NOT USE
curl -H "Authorization: Bearer YOUR_API_KEY" ...
All documentation examples use the correct access-token header format and POST methods.

Content Synchronization

  • OpenAPI specification is automatically synchronized from the live API using filtered version
  • Unwanted endpoints (Payments, Subscriptions, Chat, Webhooks) are automatically excluded
  • x-request-id parameters are automatically removed from all endpoints
  • Repository documentation is manually updated when source repositories change
  • Version control ensures consistency across all documentation sections

MCP Unlimited Plan Integrations

The documentation includes comprehensive integration guides for AI agent platforms:

Make AI Agent Integration

  • File: mcp-server/unlimited-plan-make.mdx
  • Images: public/images/make_mcp/ (6 screenshots)
  • Focus: Autonomous research agents, workflow automation, scheduled intelligence
  • Use Cases: Lead enrichment, competitor monitoring, multi-platform research, recruitment

Clay AI Agent Integration

  • File: mcp-server/unlimited-plan-clay.mdx
  • Images: public/images/clay_mcp/ (3 screenshots)
  • Focus: Data enrichment workflows, table-based automation, waterfall sequences
  • Use Cases: Lead enrichment, company intelligence, multi-platform waterfall, talent sourcing
Integration Pattern: Both guides follow consistent structure:
  1. Overview & Prerequisites
  2. Get MCP Connection URL (from app.anysite.io)
  3. Configure MCP in platform (with screenshots)
  4. System prompts & tool inventory
  5. Use cases with examples
  6. Workflow integration diagrams
  7. Troubleshooting & security
  8. Benefits & next steps

OpenAPI Filtering

The project uses a custom Python script to filter the OpenAPI specification and remove internal/private endpoints:
# Run the filtering script
python3 filter_openapi.py
Filtering operations:
  • Removes Payments API (Stripe integration)
  • Removes Subscriptions API (billing management)
  • Removes Chat API (internal chat system)
  • Removes Webhook endpoints (internal notifications)
  • Removes x-request-id parameters from all endpoints
  • Maps technical tag names to human-readable names
The filtered OpenAPI specification is saved as openapi-filtered.json and automatically used by Mintlify.

AI Features

The documentation includes AI-enhanced features:
  • AI Development Assistant: Smart prompt generation system for API integration
    • “Copy AI Prompt” buttons appear next to each API endpoint title
    • Automatically generates comprehensive integration prompts for AI development tools
    • Extracts endpoint details, authentication, request/response examples from Mintlify’s rendered content
    • Provides production-ready implementation requirements and best practices
    • Works with Claude, ChatGPT, Perplexity, and other AI development tools
  • LLMs.txt: Comprehensive API overview for AI tools consumption with all 51+ endpoints
    • Complete LinkedIn API coverage (39 endpoints organized by categories)
    • Correct HTTP methods (POST for main endpoints, GET for tokens)
    • Proper endpoint paths with /api/ prefix
    • Authentication examples and request formats
  • Contextual Menu: Copy, view, and share functionality with AI tools (ChatGPT, Claude, Perplexity)
  • AI Instructions: Detailed guidance for AI assistants in .ai/instructions.md

Development Workflow

  1. Always activate the virtual environment before development
  2. Use mintlify dev for local preview during editing
  3. Run python3 filter_openapi.py when API changes to update filtered OpenAPI spec
  4. Test all interactive examples and code snippets
  5. Ensure cross-references between sections work correctly
  6. Build and verify before deployment

Правила обновления документации

Автоматическое обновление OpenAPI спецификации

Для обновления документации API используйте скрипт filter_openapi.py:
# Запуск фильтрации OpenAPI спецификации
python3 filter_openapi.py
Что делает скрипт:
  • Загружает актуальную OpenAPI спецификацию с https://api.anysite.io/openapi.json
  • Удаляет внутренние/приватные эндпоинты (Payments, Subscriptions, Chat, Webhooks)
  • Убирает технические параметры (x-request-id) из всех эндпоинтов
  • Улучшает названия тегов для лучшей читаемости
  • Сохраняет отфильтрованную версию в openapi-filtered.json
Фильтруемые категории:
  • ❌ Payments API (интеграция со Stripe)
  • ❌ Subscriptions API (управление подписками)
  • ❌ Chat API (внутренняя система чата)
  • ❌ Webhook endpoints (внутренние уведомления)
  • ❌ Параметры x-request-id (технические заголовки)
Результат:
  • 82 эндпоинта → 56 эндпоинтов (только публичные API)
  • Автоматическое улучшение названий тегов
  • Готовая спецификация для Mintlify

Порядок обновления документации

  1. При изменениях в API:
    python3 filter_openapi.py
    
  2. При изменениях в MCP сервере:
  3. При изменениях в n8n нодах:
  4. При добавлении новых AI интеграций:
    • Создать файл в формате mcp-server/unlimited-plan-{platform}.mdx
    • Добавить скриншоты в public/images/{platform}_mcp/
    • Обновить docs.json в секции “MCP Unlimited Plan”
    • Следовать структуре существующих интеграций (Make, Clay)
    • Обновить CLAUDE.md в секции “MCP Unlimited Plan Integrations”
  5. Проверка изменений:
    mintlify dev  # Локальный предварительный просмотр
    
  6. Тестирование:
    • Проверить все интерактивные примеры
    • Убедиться в корректности кросс-ссылок
    • Проверить отображение всех изображений
    • Протестировать AI функции (кнопки “Copy AI Prompt”)

Мониторинг изменений

Автоматически отслеживаемые изменения:
  • OpenAPI спецификация синхронизируется с живым API
  • Фильтрация применяется автоматически при запуске скрипта
Ручной контроль версий:
  • Документация MCP сервера обновляется при изменениях в исходном репозитории
  • Документация n8n нодов обновляется при релизах новых версий
  • Документация AI интеграций (Make, Clay) обновляется при изменениях в UI платформ
  • Общие разделы (введение, аутентификация) обновляются по мере необходимости

Команды для обновления

# Полное обновление документации
python3 filter_openapi.py && mintlify dev

# Проверка статуса dev сервера
ps aux | grep "mintlify dev"

# Перезапуск dev сервера после изменений
# Ctrl+C в терминале с mintlify dev, затем mintlify dev снова

Important Notes

  • Configuration migrated from mint.json to docs.json for modern Mintlify features
  • All API examples use correct patterns:
    • access-token header authentication (NOT Bearer tokens)
    • POST method for main endpoints (LinkedIn, Twitter, Instagram, Reddit, Google)
    • GET method only for token management endpoints (/token/statistic, /token/requests, /token/requests/count)
    • JSON request body for all POST endpoints
    • Proper /api/ prefix for all main endpoints
  • AI Development Assistant feature:
    • JavaScript implementation in public/ai-prompt.js loaded via docs.json head scripts
    • Works with Mintlify’s dynamic API page generation from OpenAPI specifications
    • Automatically adds ”🤖 Copy AI Prompt” buttons to endpoint titles
    • Extracts data from DOM (not OpenAPI files) for real-time content accuracy
    • Generates comprehensive prompts with endpoint details, authentication, examples, and implementation requirements
  • Virtual environment (venv/) and Claude config (.claude/) are in gitignore
  • Contextual menu requires docs.json configuration format
  • Filter script removes unwanted API sections and improves tag names automatically
  • LLMs.txt updated with complete API coverage: 51+ endpoints including all 39 LinkedIn endpoints organized by functionality