FactAnchor-MCP
FactAnchor-MCP is a zero-cost, fully local MCP server that grounds AI assistants in real, fetched web text to reduce hallucinations.
Fetch verified web context (
fetch_verified_context): Search the web via free DuckDuckGo and scrape up to 5 real sources for any query, returning clean, LLM-optimized Markdown text.Enforce strict guardrails: Wrap fetched content in a prompt that forces the LLM to answer only from the verified sources — never from pre-trained knowledge.
Require source citation: Compel the AI to cite every claim in brackets (e.g.,
[Source: ...]) or state "I cannot find a verified source for this information." when no answer is found.Run fully locally: All processing happens on your machine via
stdiotransport — no cloud, no paid API keys, zero hosting cost.Auto-install browser: Automatically installs the Playwright Chromium browser on first launch for headless scraping — no manual setup required.
Configurable source count: Fetch 1–5 sources per query (default 3) via the
max_resultsparameter.Broad client compatibility: Works with any MCP-enabled client, including Claude Desktop, Cursor, VS Code, Claude Code, opencode, and Gemini CLI.
Allows fetching real web text via free DuckDuckGo search and page scraping to ground AI answers in verified sources.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FactAnchor-MCPWhat is the latest update on the James Webb Space Telescope?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🔗 FactAnchor-MCP
Reduce AI Hallucinations by up to ~80% (informal estimate) using Local Context Anchoring.
FactAnchor-MCP is a zero-cost, fully local Model Context Protocol server that grounds your AI assistant (Claude Desktop, Cursor, VS Code, Claude Code) in real, fetched web text — and forces it to answer only from that text.
💸 ₹0 Hosting Cost — runs entirely on your machine. No cloud, no paid API keys.
🛡️ Strict Guardrails — the LLM must cite sources or say "I cannot find a verified source for this information."
🔎 Free Web Fetching — uses DuckDuckGo's free search + page scraping (no Serper/Google keys).
🧠 Smart Chunking — BM25 semantic relevance scoring keeps only the most useful paragraphs.
💾 Persistent Cache — SQLite disk cache (
~/.factanchor/cache.db) survives server restarts.⚡ Zero-config setup —
pip install -e .+ connect your MCP client. Browser auto-installs on first start.
⭐ If FactAnchor-MCP helps you ship more reliable, hallucination-free AI, please consider starring the repository. It takes one click and helps more developers discover a truly zero-cost way to ground their agents. Thank you! 🙏
🚀 1-Minute Quick Start
Option A — Recommended (cross-platform, no path editing)
git clone https://github.com/Tausifonly001/FactAnchor-MCP.git
cd FactAnchor-MCP
pip install -e . # installs the `factanchor-mcp` commandThen add this to your claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"FactAnchor-MCP": {
"command": "factanchor-mcp"
}
}
}Option B — Simple (use the script path directly)
git clone https://github.com/Tausifonly001/FactAnchor-MCP.git
cd FactAnchor-MCP
pip install -r requirements.txtAdd the absolute path to server.py:
{
"mcpServers": {
"FactAnchor-MCP": {
"command": "python",
"args": ["/absolute/path/to/FactAnchor-MCP/server.py"]
}
}
}Windows:
"C:\\Users\\you\\FactAnchor-MCP\\server.py"macOS / Linux:
"/Users/you/FactAnchor-MCP/server.py"or"/home/you/FactAnchor-MCP/server.py"
3. Restart your client
You'll now see the fetch_verified_context tool available. Ask a factual question and watch the assistant ground its answer in live, cited sources.
✅ Zero-config: on first launch, FactAnchor silently installs the Playwright Chromium browser in the background. No
crawl4ai-setupor manual browser commands required.💡 Want
uvinstead of pip?uv pip install -e .works identically, and thefactanchor-mcpcommand lands on your PATH.
Related MCP server: Grounded Code MCP
🧩 Supported Clients (drop-in configs)
FactAnchor-MCP is a standard MCP server, so it works with any MCP-compatible client. Below are ready-to-paste configs. Every client uses the same two shapes:
Option A (recommended):
"command": "factanchor-mcp"— needspip install -e .(so the command is on your PATH).Option B (path-based):
"command": "python"+"args": ["/abs/path/server.py"]— use this if thefactanchor-mcpcommand isn't found.
File: claude_desktop_config.json (Settings → Developer → Edit Config)
{
"mcpServers": {
"FactAnchor-MCP": { "command": "factanchor-mcp" }
}
}Restart Claude Desktop. Tool appears in the tools list.
File: .opencode.jsonc (project root)
{
"mcpServers": {
"FactAnchor-MCP": { "command": "factanchor-mcp" }
}
}Verify with /mcp — fetch_verified_context should be listed.
These are Claude-Code-style clients. Use a project .mcp.json:
{
"mcpServers": {
"FactAnchor-MCP": { "command": "factanchor-mcp" }
}
}Or add it from the CLI (runs the same server):
claude mcp add factanchor -- factanchor-mcp
# Kimi/Qwen/Cline equivalents use the same `mcp add` subcommandFile: ~/.cursor/mcp.json (global) or .cursor/mcp.json (project)
{
"mcpServers": {
"FactAnchor-MCP": { "command": "factanchor-mcp" }
}
}Enable it in Settings → MCP and restart Cursor.
File: .vscode/mcp.json (note: VS Code uses a "servers" key)
{
"servers": {
"FactAnchor-MCP": {
"type": "stdio",
"command": "factanchor-mcp"
}
}
}Open the Command Palette → MCP: List Servers to confirm it's connected.
File: .gemini/settings.json
{
"mcpServers": {
"FactAnchor-MCP": { "command": "factanchor-mcp" }
}
}Or: gemini mcp add factanchor -- factanchor-mcp
If the factanchor-mcp command isn't on your PATH, use the absolute path to server.py on every client above:
{
"mcpServers": {
"FactAnchor-MCP": {
"command": "python",
"args": ["/absolute/path/to/FactAnchor-MCP/server.py"]
}
}
}Per-OS path examples:
Windows:
"C:\\Users\\you\\FactAnchor-MCP\\server.py"macOS:
"/Users/you/FactAnchor-MCP/server.py"Linux:
"/home/you/FactAnchor-MCP/server.py"
🛠️ How It Works
[Claude Desktop / Cursor / VS Code]
│ (Asks a factual query)
▼
[FactAnchor MCP Server]
│
├──► [Free DuckDuckGo Search] (URL Discovery)
│
├──► [Persistent Cache: ~/.factanchor/cache.db] (Fast Repeat Queries)
│
├──► [Crawl4AI in Isolated Subprocess] (Page Scraping)
│
├──► [BM25 Semantic Chunking] (Smart Paragraph Selection)
│
└──► [Strict Guardrail Injection] (Verified Context Block)
│
▼
[Assistant answers ONLY from verified context → ~0% Hallucination]Free Search —
fetch_verified_context(query)runs a free DuckDuckGo search to discover URLs. No API keys required.Persistent Caching — results are cached in
~/.factanchor/cache.db(SQLite) for 24 hours, so repeat queries return instantly even after server restarts.Page Scraping — Crawl4AI runs in an isolated subprocess (
crawl_worker.py) to scrape discovered URLs into clean, LLM-optimized Markdown (navbars, ads, and footers auto-stripped).Semantic Chunking — BM25 relevance scoring extracts only the paragraphs most relevant to your query, maximizing information density within the context window.
Guardrail Injection — the fetched text is wrapped in a strict directive (see
guardrail.py):Answer only from
<verified_context>.If unanswerable, reply exactly: "I cannot find a verified source for this information."
Cite every claim in brackets like
[Source: ...].Never fall back to pre-trained knowledge.
Local-Only — the server uses the
stdiotransport, so all processing stays on your machine.
📦 Project Structure
File | Purpose |
| The MCP server + |
| Headless-scrape worker (Crawl4AI) run in an isolated subprocess for robust MCP stdio. |
| Free DuckDuckGo search (no API keys required). |
| Persistent SQLite cache ( |
| BM25 relevance scoring to extract the most useful paragraphs. |
| The strict fact-anchoring prompt template. |
| Markdown cleaning + truncation for Crawl4AI output. |
| Packaging + |
| Dependencies ( |
| Copy-paste config snippet. |
🧰 Requirements
Python 3.10+
Internet access (for the free search/scrape)
🔧 Tool Reference
fetch_verified_context(query: str, max_results: int = 3) -> strParam | Default | Notes |
| — | The factual topic or question to ground. |
|
| Sources to pull (clamped 1–5). |
🐛 Troubleshooting
command not found: factanchor-mcp→ you used Option A but didn'tpip install -e ., or your venv isn't on PATH. Use Option B (script path) instead.Pages return only short snippets (first run) → Chromium is still installing in the background. Wait ~1–2 minutes and retry; subsequent runs are instant.
"Browser executable doesn't exist" on Linux → install OS deps once:
sudo playwright install-deps chromium(orsudo apt install libnss3 libatk-bridge2.0-0 libdrm2 libxkbcommon0 libgbm1 libasound2).Rate-limit system note from the tool → DuckDuckGo is throttling free search. Wait a few minutes and retry. The server never crashes; it returns a clean system note for the LLM.
Tool not appearing in client → restart the client fully after editing the config, and check its MCP/Developer panel for errors.
📈 Virality Strategy
Before vs After video (X/Twitter & LinkedIn): show the assistant hallucinating a fake npm feature, then enable FactAnchor-MCP and watch it correctly say "I cannot find a verified source for this information." Tag
@AnthropicAIwith#MCPand#AI.Open-source launch: submit to the official MCP servers list and
awesome-mcpcollections.
📊 Evaluation
The "~80%" figure is an informal estimate. A small, hand-runnable eval
set lives in eval/sample_queries.json — see
eval/README.md for how to reproduce it. Contributions of
more queries (or a CI assertion) are very welcome.
🤝 Contributing
See CONTRIBUTING.md. Keep it zero-cost and local-first.
📋 Success Metrics (v1.0)
⚠️ Honesty note: The "~80% reduction" is an informal estimate from manual testing against a small set of factual queries (see
eval/sample_queries.json) — it is not a benchmarked or statistically validated result. The guardrail is a prompt directive, not a hard infrastructure constraint, so an LLM can occasionally drift from it in long conversations. FactAnchor reduces hallucination but does not eliminate it; always verify critical claims against the cited sources.
🧪 Up to ~80% fewer made-up facts observed in informal test queries.
✅ <3 min user setup time (clone → install → config).
✅ ₹0.00 server maintenance bill.
📜 License
MIT © FactAnchor-MCP contributors.
Available Tools
1 toolfetch_verified_contextA
Fetch real, source-of-truth web text for a topic and wrap it in a strict fact-anchoring guardrail so the LLM answers ONLY from it.
Use this tool BEFORE answering any factual question. Then answer the user strictly from the returned block and follow the embedded STRICT RULES (never guess, cite sources in brackets, do not use pre-trained knowledge for missing info).
Args: query: The factual topic or question to ground. max_results: How many web sources to pull (default 3, max 5).
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| max_results | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It explains the output format (verified_context block with STRICT RULES) and parameter constraints (max_results default/max). However, it does not explicitly state that the tool is read-only or non-mutating, nor mention failure modes or rate limits. This leaves minor ambiguity, but the overall behavior is well described.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a purpose sentence, usage paragraph, and parameter definitions. It is front-loaded with the key action. While clear, it could be slightly more concise (e.g., combining the usage instructions). Every sentence is valuable, so minor trim could improve.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no annotations or sibling tools, the description adequately covers all aspects: purpose, usage, parameters, and expected output format (<verified_context> block with rules). It lacks explicit mention of edge cases (e.g., no results) but is sufficient for an agent to understand and use the tool effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so the description must compensate. It does so effectively: query is described as 'the factual topic or question to ground,' and max_results as 'how many web sources to pull (default 3, max 5).' This adds contextual meaning beyond the schema's titles and types, making the parameters fully understandable.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Fetch real, source-of-truth web text for a topic and wrap it in a strict fact-anchoring guardrail.' It specifies the action (fetch), resource (web text), and outcome (guardrail for fact-anchoring). With no sibling tools, differentiation is not needed.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly instructs: 'Use this tool BEFORE answering any factual question. Then answer the user strictly from the returned <verified_context> block.' It includes detailed rules (never guess, cite sources, avoid pre-trained knowledge), providing clear guidance on when and how to use the tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
fetch_verified_context
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion between tools. The single tool has a clearly distinct purpose.
The single tool name 'fetch_verified_context' follows a clear snake_case convention and is descriptive. Consistency is not an issue with only one tool.
One tool is slightly below the typical 3-15 range, but it is appropriate for this narrowly scoped server. The tool covers the entire workflow of fetching and anchoring factual context.
The single tool effectively covers the entire domain of fact-anchoring: fetching verified context and enforcing strict answer rules. No obvious gaps exist for its stated purpose.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
An MCP server that gives your AI access to the source code and docs of all public github repos
Related MCP Servers
- AlicenseAqualityAmaintenanceA local-first, no-API-key MCP server that enables LLMs to search the web, fetch pages, and read documents using multiple engines and smart fallbacks.1070MIT
- AlicenseNot gradedqualityBmaintenanceA local MCP server that gives AI coding assistants retrieval access to your personal knowledge base of books, standards, and docs, grounding their answers in sources you trust.MIT
- AlicenseNot gradedqualityCmaintenanceA read-only MCP server that gives AI agents the web as compact, ranked, verified evidence — no API keys, no cloud retrieval, all models local.131MIT
- AlicenseNot gradedqualityAmaintenanceZero-auth multi-source research MCP server that enables web search, reading URLs, PDFs, GitHub repos, and querying Hacker News, Stack Overflow, Semantic Scholar, and YouTube transcripts without API keys.10Apache 2.0