Sign In

fact-checker-mcp

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fact-checker-mcp

Fact-Checker MCP Server - SENSE + GATE verification service with semantic cache

latest
npmnpm
Version
0.13.0
Version published
Maintainers
1
Created
Source

Fact-Checker MCP Server

MCP TypeScript License

A Model Context Protocol (MCP) server that provides AI-powered fact-checking and claim verification. Uses Claude Haiku for claim extraction, SPO-based semantic fingerprinting, and Redis caching for deduplication.

Exposes both an MCP (StreamableHTTP) interface for AI agents and a REST API for HTTP clients.

Features

MCP Tools

ToolDescription
extractClaimsExtract verifiable claims from text with type and durability classification
verifyContentVerify outbound content — extracts claims, checks each against cache + Haiku, returns verdicts and corrected content
verifySignalVerify an inbound signal claim — returns a trust assessment with action recommendation
getFactMemorySearch the fact-checker cache for previously verified claims

REST API

MethodEndpointDescription
POST/api/extract-claimsExtract claims from text
POST/api/verify-contentVerify content (GATE tool)
POST/api/verify-signalVerify a signal claim (SENSE tool)
GET/api/fact-memory?query=...Search cached verifications
GET/healthHealth check

Quick Start

Prerequisites

  • Node.js 20+
  • An Anthropic API key
  • Redis (optional — caching is gracefully skipped when unavailable)

Install

git clone https://github.com/luminarylane/fact-checker-mcp.git
cd fact-checker-mcp
npm install
npm run build

Configure

Copy the example env file and add your Anthropic API key:

cp .env.example .env
# Edit .env and set ANTHROPIC_API_KEY

Run

# Development (auto-reload)
npm run dev

# Production
npm start

The server starts two listeners:

  • REST API on port 8004 (configurable via PORT)
  • MCP transport on port 8005 (configurable via MCP_PORT)

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "fact-checker": {
      "command": "node",
      "args": ["/path/to/fact-checker-mcp/dist/index.js"]
    }
  }
}

How It Works

Claim Extraction (extractClaims)

Extracts verifiable claims from text using Claude Haiku. Each claim is classified by type (statistic, company_fact, quote, product_claim, market_assertion, opinion) and durability (permanent, durable, transient, volatile).

Content Verification (verifyContent / GATE)

Full content verification pipeline:

  • Extract claims from content
  • Fingerprint each claim using SPO (Subject-Predicate-Object) triples
  • Check Redis cache for previously verified claims
  • Verify uncached claims via Claude Haiku with optional brand data and web context
  • Return verdicts (publish, revise, block) with corrected content

Signal Verification (verifySignal / SENSE)

Verifies a single inbound claim (e.g., "Company X raised $50M") and returns:

  • Signal verdict: verified, likely_true, uncertain, likely_false, contradicted
  • Action recommendation: safe_to_act, proceed_with_caution, needs_human_review, do_not_act

Semantic Fingerprinting

Claims are normalized into Subject-Predicate-Object triples via Haiku, then hashed. Equivalent claims (different wording, same meaning) produce the same fingerprint, enabling cache deduplication.

Fact Memory (getFactMemory)

Search previously verified claims by keyword. Useful for avoiding re-verification during multi-step workflows.

Configuration

Env VarDefaultDescription
ANTHROPIC_API_KEYRequired. Anthropic API key
ANTHROPIC_MODELclaude-haiku-4-5-20251001Model to use for verification
REDIS_URLRedis connection URL (optional)
PORT8004REST API port
MCP_PORT8005MCP transport port
HOST0.0.0.0Bind address
CACHE_TTL_PERMANENT-1Cache TTL for permanent facts (seconds, -1 = no expiry)
CACHE_TTL_DURABLE2592000Cache TTL for durable facts (30 days)
CACHE_TTL_TRANSIENT86400Cache TTL for transient facts (1 day)
CACHE_TTL_VOLATILE3600Cache TTL for volatile facts (1 hour)

Architecture

  • Transport: StreamableHTTP (MCP) + Express (REST)
  • AI: Claude Haiku for claim extraction, verification, and SPO fingerprinting
  • Cache: Redis with durability-based TTLs (gracefully degrades without Redis)
  • Rate Limiting: Token-bucket rate limiter for Anthropic API calls (100 req/min)
  • Safety: Untrusted content wrapped with hashed markers for prompt injection defence

Development

# Development server (auto-reload)
npm run dev

# Type check
npx tsc --noEmit

# Run tests
npm test

# Test with coverage
npm run test:coverage

# Build
npm run build

License

MIT

FAQs

Package last updated on 25 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts