Fact Checker MCP Server

Fact Checker MCP Server

Enables verification of simple factual claims (e.g., capital cities) by checking against Wikidata, returning accuracy and confidence scores.

Category
Visit Server

README

Fact Checker MCP Server

This is a Model Context Protocol (MCP) server that verifies simple factual claims by checking them against knowledge sources like Wikidata.

Features

  • Accepts claims in natural language
  • Verifies the accuracy of the claim
  • Returns an MCP-compliant response with the claim, correct answer, and confidence score
  • Includes an MCP client that integrates with Ollama LLM

MCP Payload Format

{
  "version": "1.0",
  "context": {
    "type": "fact_check",
    "claim": "The capital of France is London",
    "correct_answer": "Incorrect. The capital of France is Paris, not London.",
    "confidence": 0.95
  }
}

Setup and Installation

  1. Clone this repository
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Run the server:
    python app.py
    

Usage

Server API

Send a POST request to the /fact-check endpoint with a JSON payload containing the claim:

curl -X POST http://localhost:5000/fact-check \
  -H "Content-Type: application/json" \
  -d '{"claim": "The capital of France is London"}'

MCP Client with Ollama Integration

The project includes an MCP client that demonstrates integration with Ollama LLM:

  1. Make sure Ollama is installed and running:

    ollama serve
    
  2. Run the demo script:

    bash run_demo.sh
    
  3. Or run the client directly:

    python mcp_client.py --model llama3
    

The client will:

  • Detect factual claims about capitals in your prompts
  • Verify these claims using the MCP server
  • Augment the LLM's knowledge with accurate information
  • Ensure the LLM provides factually correct responses

Testing

Basic Testing

Run the test client with a specific claim:

python test_client.py "The capital of France is Paris"

Or run the default test suite with multiple claims:

python test_client.py

Comprehensive Test Suite

Run the comprehensive test suite that includes both correct and incorrect claims:

python test_client.py --test-suite

Unit Tests

Run the unit tests to verify the server's functionality:

python -m unittest test_unit.py

Supported Claim Types

Currently, the server can verify:

  • Capital city claims (e.g., "The capital of [Country] is [City]")

More claim types will be added in future updates.

Extending the Server

To add support for new types of claims:

  1. Add a new pattern matching regex in the check_fact() function
  2. Implement a corresponding verification function similar to check_capital_claim()

License

MIT

Author

© Anthony Lim

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured