MCP Integration

February 25, 2026 Β· View on GitHub

The MCP server lives at packages/mcp-server and bridges MCP tool calls to Kryfto's REST API and built-in intelligence engine. 42+ tools are available across 9 categories, including dynamic recipe plugins and autonomous research agents.

Environment Variables

VariableDescriptionDefault
API_BASE_URLKryfto API endpointhttp://localhost:8080
API_TOKEN / KRYFTO_API_TOKENAuthentication tokenβ€”
KRYFTO_SEARCH_TOKENScoped token for search toolFalls back to API_TOKEN
KRYFTO_BROWSE_TOKENScoped token for browse toolFalls back to API_TOKEN
KRYFTO_CRAWL_TOKENScoped token for crawl toolFalls back to API_TOKEN
KRYFTO_EXTRACT_TOKENScoped token for extract toolFalls back to API_TOKEN
GITHUB_TOKENGitHub API token (for releases/diff/issues)Optional
KRYFTO_DOMAIN_BLOCKLISTComma-separated blocked domainsβ€”
KRYFTO_DOMAIN_ALLOWLISTComma-separated allowed domainsβ€”

Tools (42+ total)

πŸ” Search & Read (5 tools)

ToolDescription
searchMulti-engine search with auto-fallback, domain boosting, recency sort. Supports multimodal (news, images, finance), geolocation, proxy rotation, and privacy modes
read_urlURL β†’ clean Markdown with publish-date extraction, section detection. Configurable caching (freshness_mode) and zero-trace privacy modes
read_urlsBatch read up to 10 URLs concurrently with partial-result recovery
detect_changesCompare current page against cached snapshot, returns added/removed content
citeCitation mode β€” find official sources for claims with confidence scores

🧠 Intelligence (7 tools)

ToolDescription
answer_with_evidenceSearch + read + extract evidence spans per claim with trust scores. Returns insufficient_evidence on failure
conflict_detectorDetect contradictions across multiple sources, rank by trustworthiness
confidence_calibrationCalibrated per-claim confidence based on source count, recency, trust
upgrade_impactFramework migration risk analysis (low/medium/high)
dev_intelDeveloper intelligence β€” auto-search + read for framework updates
query_plannerPreview search/read/extract plan with deterministic cost estimates
researchUnified search→read→extract pipeline in one call with per-step timings and clean markdown output

πŸ”„ Agent Loops (6 tools)

ToolDescription
research_job_startStart an asynchronous research job for deep, multi-stage data gathering
research_job_statusCheck status, stream logs, and retrieve results of an async research job
research_job_cancelCancel a running async research job
continuous_research_startStart an autonomous research agent loop (search→watch→diff→alert on configurable interval)
continuous_research_statusCheck status and progress logs of a continuous research agent
continuous_research_cancelCancel a running continuous research agent

πŸ”’ Trust & Memory (4 tools)

ToolDescription
source_trustGet trust scores for domains (github=0.9, arxiv=0.95, .gov=0.9)
set_source_trustOverride trust score for a domain (persists for session)
set_memory_profilePer-project preferences: sources, stack, output format
get_memory_profileRead back project preferences

πŸ“‘ Monitoring (5 tools)

ToolDescription
add_monitorRegister URL to watch for changes
list_monitorsList all registered monitors
watch_and_actMonitor URL + optional webhook + semantic context filter. Reports delivery status (delivered/failed)
check_watchCheck a watched URL now, fires webhook if changed. Uses semanticDiff when context is provided
semantic_diffContext-filtered meaningful diff ("what changed that matters for me?")

πŸ“Š Observability (5 tools)

ToolDescription
slo_dashboardPer-tool success rate, p50/p95/p99 latency, cache hit rate, freshness
replay_requestRetrieve exact input/output of previous request by requestId
list_replaysBrowse recent replayable request history
evaluation_harnessInternal benchmark suite (5 tests: search, cache, normalization, errors, trust)
run_eval_suite10 real-world query benchmark (precision%, latency, official source hits)
truth_maintenanceRe-check cached facts, expire stale entries, report near-expiry

πŸ™ GitHub (3 tools)

ToolDescription
github_releasesFetch releases with tags, dates, and changelogs. Cached 30min
github_diffCompare two Git tags β€” commits, files, additions/deletions
github_issuesFetch issues and PRs with label filtering

🌐 Browser & Crawl (3 tools)

ToolDescription
browseRaw headless browser job (for clean text use read_url)
crawlSpider from seed URL with followNav, skipPatterns, maxPages
extractCSS selectors, JSON schema, or plugin extraction
recipe_*Dynamic: Automatically loaded from your Kryfto Recipes registry (/v1/recipes)

πŸ“¦ Job Management (3 tools)

ToolDescription
get_jobGet job status
list_artifactsList artifacts for a job
fetch_artifactDownload raw artifact bytes (base64)

Search engines supported: duckduckgo, bing, yahoo, google, brave

Quality & Reliability (v3.4.0)

The MCP server enforces production-grade, SerpAPI-competitive search quality:

  • Multi-Engine Parallel Search: All 5 engines (DuckDuckGo, Brave, Bing, Yahoo, Google) queried for every request β€” no early exit after first success.
  • Domain-Agnostic Scoring: No hardcoded technology lists. domainQueryRelevance() dynamically matches query terms against domain names. Works for any topic (tech, medical, legal, academic, news, cooking, finance, etc.).
  • URL Structure Analysis: urlOfficialScore() boosts docs subdomains, /docs paths, .gov TLDs, ReadTheDocs/GitBook; penalizes login/pricing/tracking URLs.
  • Result Diversity: diversityPenalty() prevents domain concentration β€” 3rd+ results from same domain are progressively penalized.
  • 8 Intent Types: api_docs, legal, release_notes, faq, troubleshooting, documentation, news, general β€” each with tailored scoring.
  • Noise Penalty: YouTube, Reddit, SO, Medium, W3Schools penalized for doc/legal queries; zero penalty for troubleshooting.
  • Strict Mode: Auto-enabled for compliance/medical/finance/legal queries (officialOnly=true, 2x noise penalty).
  • Redirect Canonicalization: Bing/Yahoo wrapper URLs and tracking parameters (utm_*, gclid, fbclid) are stripped before ranking.
  • Strict Evidence: answer_with_evidence/cite return insufficient_evidence if no high-trust spans are found.
  • Eval Thresholds: precision@5 β‰₯ 75%, officialHitRate β‰₯ 80%, searchSuccessRate β‰₯ 99% enforced in CI via pnpm test:eval.
  • Unified Stealth: All engine requests use stealth.ts β€” 16 rotated UAs, per-browser Sec-Ch-Ua/Sec-Fetch-* headers, engine-specific Referer and request spacing, in-memory cookie jar.
  • Direct HTTP Fallback: When the REST API is unreachable, federatedSearch bypasses the API and directly fetches+parses results from 4 engines using shared parsers.
  • Unconditional Curated Fallback: When all live search fails, returns 8 universal search-page links (DuckDuckGo, Wikipedia, GitHub, Scholar, SO, Reddit, MDN, Archive.org) for any query.
  • Fast Circuit Breaker: 15s reset timeout, 1-success close, automatic all-engines-down recovery.
  • Per-Engine Observability: Every failure classified as dns/tls/timeout/http_4xx/http_5xx/network/unknown via getEngineErrorMetrics().

Build and Run

pnpm --filter @kryfto/mcp-server build
API_BASE_URL=http://localhost:8080 API_TOKEN=<token> node packages/mcp-server/dist/index.js

Local IDE Configuration

If you are using Kryfto as a headless browser engine for your own projects, you must use the absolute path to your Kryfto installation so your IDE can find the server regardless of which project directory you're currently in.

Claude Code / Cursor (JSON)

Place this in your claude_desktop_config.json or Cursor MCP settings:

{
  "mcpServers": {
    "kryfto": {
      "command": "node",
      "args": ["/absolute/path/to/kryfto/packages/mcp-server/dist/index.js"],
      "env": {
        "API_BASE_URL": "http://localhost:8080",
        "API_TOKEN": "<your-token-here>"
      }
    }
  }
}

OpenAI Codex (TOML)

Codex uses TOML, not JSON. Place this in .codex/config.toml inside your project folder, or in ~/.codex/config.toml for global access:

[mcp_servers.kryfto]
command = "node"
args = ["/absolute/path/to/kryfto/packages/mcp-server/dist/index.js"]

[mcp_servers.kryfto.env]
API_BASE_URL = "http://localhost:8080"
API_TOKEN = "<your-token-here>"

Remote VPS Config (SSH Tunneling)

If your Kryfto instance is hosted remotely on a VPS, your local AI IDE (Cursor, Claude Code) cannot use a physical file path. Because the MCP server uses stdio (standard input/output) for communication, the most secure way to connect is by tunneling the node command through SSH.

This securely pipes the remote index.js outputs directly into your local AI assistant's brain without exposing the MCP server to the public internet!

⚠️ Critical Requirement (SSH Keys): Since MCP servers run silently in the background of your IDE, they cannot accept password prompts. You must configure passwordless SSH Key authentication between your local machine and your VPS just once. It will then work automatically for every project on your computer!

macOS / Linux User Guide

Open your Terminal and run the following commands:

# 1. Generate the key (press Enter to accept default location)
ssh-keygen -t ed25519 -C "your_email@example.com"

# 2. Automatically copy it to your VPS securely
ssh-copy-id user@your-vps-ip

# 3. Test that it logs you in without asking for a password!
ssh user@your-vps-ip "echo 'Success'"

Windows User Guide

Open PowerShell as Administrator and run the following commands:

# 1. Generate the key (press Enter to accept default location)
ssh-keygen -t ed25519 -C "your_email@example.com"

# 2. Windows doesn't have ssh-copy-id, so run this simple PowerShell script to push the key:
$RemoteUser = "user@your-vps-ip"
$Key = Get-Content "$env:USERPROFILE\.ssh\id_ed25519.pub"
ssh $RemoteUser "mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo '$Key' >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

# 3. Test that it logs you in without asking for a password!
ssh user@your-vps-ip "echo 'Success'"

Once ssh user@your-vps-ip allows you to instantly connect without a password prompt, add this to your AI's MCP config:

{
  "mcpServers": {
    "kryfto-remote": {
      "command": "ssh",
      "args": [
        "user@your-vps-ip",
        "API_BASE_URL=http://localhost:8080",
        "API_TOKEN=<token>",
        "node",
        "/absolute/path/on/vps/to/kryfto/packages/mcp-server/dist/index.js"
      ]
    }
  }
}