LastSearch

io.github.LastSearch-HQ由 GitHub 账号 LastSearch-HQ 发布v1.4.3更新于 Nov 7, 2026

Evidence-backed web research for AI agents with citations and confidence scores.

概览

AI 生成的概览

LastSearch 为助手提供有证据支撑的网页研究:带引用的答案、逐条论断核验、置信度评分与可持久化的研究会话。

可以做什么
  • 搜索网页并把页面抓取为干净文本,再提取带来源与置信度的结构化论断
  • 运行完整研究流程,返回带引用、置信度、矛盾点与执行轨迹的答案,支持 fast、thorough、deep 三种深度
  • 对整份文档或网址逐条论断做事实核查,并对比原始模型答案与有证据支撑的答案
  • 通过 clarity 引擎生成防幻觉提示词或经核验的答案
  • 创建、提问、回忆、导出、公开分享与派生研究会话
  • 获取此前答案的签名证据记录,并提交准确性反馈
适用场景
适合需要带引用和置信度的实时网络事实、而非无来源模型输出的场景,也适合核查报告、文章与市场调研。需要多步研究并在会话中累积先前结论时同样适用。
运行要求
通过 npx(Node.js)以 stdio 在本地运行,或作为带 bearer 令牌的本地 HTTP 服务运行。需要在 LASTSEARCH_API_KEY 环境变量中提供 LastSearch API 密钥,所有工具都依赖它。需要访问托管在 LastSearch 的 API。
安装前请注意
查询内容、待核验的网址与文档以及 API 密钥都会发送到托管的 LastSearch API 并存储,并以不含标识的汇总方式用于改进核验。deep 模式消耗 3 倍配额且需登录;免费配额有限,超出后降级为较轻的核验。公开分享会话会使其对所有人可见。输出为 AI 生成的研究结果,不构成专业建议。

安装

在 SourceWeft 中

  1. 打开 控制台中的 LastSearch,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

lastsearch

Reliable research infrastructure for AI agents. The research layer your agents are missing.

MCP server with real-time web search, evidence extraction, and structured citations. Drop into Claude Desktop, Cursor, Windsurf, LangChain, CrewAI, or any agent pipeline.

What it does

Instead of letting your AI hallucinate, lastsearch gives it real-time access to the web with structured, cited answers:

Your question → Web search → Neural rerank → Fetch pages → Extract claims → Verify → Cited answer (streamed)

Every answer includes:

  • Claims with source URLs, verification status, and consensus level
  • Evidence-based confidence score (0-1), not LLM self-assessed, auto-calibrated from feedback
  • Source quotes verified against actual page text
  • Atomic claim decomposition — compound facts split and verified independently
  • Execution trace with timing
  • 3 depth modes — "fast" (default), "thorough" (auto-retry with rephrased queries), "deep" (premium multi-step agentic research: iterative think-search-extract-evaluate cycles with gap analysis, up to 4 steps, targets 0.85 confidence — requires LastSearch key + sign-in, 3x quota cost, falls back to thorough when exhausted)

Premium Features (with LASTSEARCH_API_KEY)

Users with a LastSearch API key (ls_xxx) get enhanced verification:

  • Semantic re-ranking — search results re-scored by semantic query-document relevance
  • Semantic reranking — evidence matched by meaning, not just keywords
  • Multi-provider search — parallel search across multiple sources for broader coverage
  • Multi-pass consistency — claims cross-checked across independent extraction passes
  • Deep reasoning mode — multi-step agentic research with iterative think-search-extract-evaluate cycles, gap analysis, and cross-step claim merging (up to 4 steps, 3x quota cost, 100 deep queries/day)
  • Research Sessions — persistent memory across queries

Free LastSearch key users get a generous daily quota (100 premium queries/day, or ~33 deep queries/day at 3x cost each). When exceeded, queries gracefully fall back to keyword verification (deep falls back to thorough). Quota resets every 24 hours.

Sign up at lastsearch.ai for a free API key — 100 premium queries/day with full verification pipeline.

Quick Start

bash
npx lastsearch setup

This auto-configures Claude Desktop. You'll need a LastSearch API key — get one free at lastsearch.ai/dashboard.

Manual Setup

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "lastsearch": {      "command": "npx",      "args": ["-y", "[email protected]"],      "env": {        "LASTSEARCH_API_KEY": "ls_xxx"      }    }  }}

Cursor / Windsurf

Add to your MCP settings:

json
{  "lastsearch": {    "command": "npx",    "args": ["-y", "[email protected]"],    "env": {      "LASTSEARCH_API_KEY": "ls_xxx"    }  }}

HTTP Transport

Run as an HTTP server for browser-based clients, Smithery, or any HTTP-capable agent:

bash
# Start with HTTP transport (listens on 127.0.0.1 only)npx lastsearch --http
# Or set the port via environment variableMCP_HTTP_PORT=3100 npx lastsearch --http

Every request needs a bearer token. By default a random token is generated at each launch and printed once to stderr; set LASTSEARCH_HTTP_TOKEN (16+ characters) to use your own:

bash
export LASTSEARCH_HTTP_TOKEN="$(openssl rand -base64 32)"npx lastsearch --http
curl -H "Authorization: Bearer $LASTSEARCH_HTTP_TOKEN" http://127.0.0.1:3100/health

The server exposes:

  • POST /mcp — MCP Streamable HTTP endpoint
  • GET /health — Health check

By default the server only accepts requests addressed to 127.0.0.1, localhost or ::1, and refuses requests from browser pages on other origins. To listen on another interface, pass --host <address> explicitly (a warning is printed); the token is still required. Request bodies are limited to 1 MB.

Docker

Inside a container the server must listen on 0.0.0.0, so pass --host 0.0.0.0 explicitly, set a token, and publish the port on the host's loopback interface only:

bash
docker build -t lastsearch ./apps/mcpdocker run -p 127.0.0.1:3100:3100 \  -e LASTSEARCH_API_KEY=ls_xxx \  -e LASTSEARCH_HTTP_TOKEN="$(openssl rand -base64 32)" \  lastsearch --host 0.0.0.0

Clients send Authorization: Bearer <LASTSEARCH_HTTP_TOKEN> with every request.

MCP Tools

ToolDescription
searchSearch the web via multi-provider search
openFetch and parse a page into clean text
extractExtract structured knowledge from a page
answerFull pipeline: search + extract + cite. depth: "fast", "thorough", or "deep"
compareCompare raw LLM vs evidence-backed answer
clarityClarity — anti-hallucination answer engine. Three modes: mode: "prompt" (enhanced prompts only), mode: "answer" (LLM answer, default), mode: "verified" (LLM + web fusion)
session_createCreate a research session (persistent memory across queries)
session_askResearch within a session (recalls prior knowledge, stores new claims)
session_recallQuery session knowledge without new web searches
session_shareShare a session publicly (returns share URL)
session_knowledgeExport all claims from a session
session_forkFork a shared session to continue the research
feedbackSubmit accuracy feedback on a result

Note: All tools require a LastSearch API key (ls_xxx). Get a free one at lastsearch.ai/dashboard.

Examples

Quick lookup:

"Use answer to explain what causes aurora borealis"

Higher accuracy:

"Use answer with depth thorough to research quantum computing"

Deep research (multi-step, requires LastSearch key):

"Use answer with depth deep to compare CRISPR approaches for sickle cell disease"

Deep mode runs iterative think-search-extract-evaluate cycles: gap analysis identifies missing info, follow-up queries fill the gaps, and claims/sources are merged across steps with final re-verification. Targets 0.85 confidence across up to 4 steps. Falls back to thorough without a LastSearch key or when quota is exhausted.

Contradiction detection:

"Use answer with depth thorough to check if coffee is good for health, and show me any contradictions"

Research session:

"Create a session called quantum-research, then ask about quantum entanglement, then ask how entanglement is used in computing"

Enterprise search:

"Use answer to search our Elasticsearch at https://es.company.com/kb/_search for our refund policy"

Response structure

json
{  "answer": "Aurora borealis occurs when charged particles from the Sun...",  "confidence": 0.92,  "claims": [    {      "claim": "Aurora borealis is caused by solar wind particles...",      "sources": ["https://en.wikipedia.org/wiki/Aurora"],      "verified": true,      "verificationScore": 0.82,      "consensusLevel": "strong"    }  ],  "sources": [    {      "url": "https://en.wikipedia.org/wiki/Aurora",      "title": "Aurora - Wikipedia",      "domain": "en.wikipedia.org",      "quote": "An aurora is a natural light display...",      "verified": true,      "authority": 0.70    }  ],  "contradictions": [],  "reasoningSteps": []}

Why lastsearch?

FeatureRaw LLMlastsearch
SourcesNoneReal URLs with quotes
CitationsHallucinatedVerified from pages
ConfidenceUnknownEvidence-based score
DepthSingle pass3 modes: fast, thorough, deep reasoning
FreshnessTraining dataReal-time web
ClaimsMixed in textStructured + linked

Reliability

All API calls include automatic retry with exponential backoff on transient failures (429 rate limits, 5xx server errors). Auth errors fail immediately — no wasted retries.

Tech Stack

  • Search: Multi-provider (parallel search across sources)
  • Parsing: @mozilla/readability + linkedom
  • AI: OpenRouter (100+ models)
  • Verification: Hybrid keyword and semantic verification
  • Protocol: Model Context Protocol (MCP)

Agent Skills

Pre-built skills that teach coding agents when to use LastSearch tools:

bash
npx skills add lastsearch-hq/lastsearch-skills

Skills work with Claude Code, Codex CLI, Gemini CLI, Cursor, and more. View skills →

Community

License

Apache 2.0

Data, privacy and terms

This package sends your requests (queries, URLs and documents you ask it to verify) and your LastSearch API key to the hosted LastSearch API at lastsearch.ai. Queries and results are stored there and used, in aggregate and without identifiers, to improve verification, as described in the Privacy Policy. The package itself collects no telemetry. Use of the hosted API is subject to the Terms.

LastSearch is a free, non-commercial passion project run by an individual developer. Answers, citations and confidence scores are AI-generated research, not professional advice; verify anything important against primary sources.

来源:apps/mcp/README.md,提交 4d25e7c

工具

15

evidence

Fetch the signed evidence record for a previous answer (pass the result's shareId). Returns a typed record (retrieval → verification → decision) with per-source content hashes, the exact canonical bytes that were signed, their SHA-256, and an Ed25519 signature verifiable against GET /browse/evidence/public-key. Attests what LastSearch retrieved, verified, and returned — not what your agent did with it; not a compliance guarantee.

输入参数resultId必填

open

Fetch and parse a web page into clean text using Readability. Strips ads, nav, and boilerplate.

输入参数url必填

extract

Extract structured knowledge (claims + sources + confidence) from a single web page using AI.

输入参数url必填query

answer

Full deep research pipeline: search the web, fetch pages, extract claims, build evidence graph, and generate a structured answer with citations and confidence score. Use depth='thorough' for auto-retry with rephrased queries when confidence is low. Use depth='deep' for multi-step agentic research that identifies knowledge gaps and runs follow-up searches. On thorough/deep, every cited URL is probed for liveness: each source carries a urlHealth field (live | stale | dead | unchecked) and the result includes a citationHealth summary, so you can spot broken or likely fabricated links (checks fail open to 'unchecked'). Every fetched page is also scanned for hidden / non-rendered content (where most real-world prompt injections live) before extraction: hidden content is stripped, instruction-shaped text is counted, and each source carries an integrity signal plus a result-level contentRisk summary — a signal for your policy layer, not a guarantee. Instruction-directed spans are redacted from page text before extraction; pass strict=true to drop high-risk sources entirely. Every stored result has a signed evidence record — call the evidence tool with the result's shareId. Enterprise: use searchProvider to search internal data instead of the public web. DISCLAIMER: Results are AI-generated for informational purposes only — not financial, medical, or legal advice. Confidence scores are algorithmic estimates, not accuracy guarantees. Always verify critical information from primary sources.

输入参数depthquery必填strictsearchProvider

compare

Compare a raw LLM answer (no sources) vs an evidence-backed answer. Shows the difference between hallucination-prone and grounded responses.

输入参数query必填

verify_document

Fact-check an entire document (AI-generated report, competitive analysis, market research, news article). Pass either raw text OR a URL — we'll extract every atomic claim and verify each against live web sources. Returns per-claim verification status with sources, NLI scores, and an overall A-F grade. Use for auditing the accuracy of long-form content from other AI agents.

输入参数urltextdepthtitlemaxClaims

clarity

Clarity — anti-hallucination answer engine. Three modes: (1) mode='prompt': Returns only enhanced system + user prompts with anti-hallucination techniques. No LLM call, no internet. Use this when you want YOUR OWN LLM (e.g. Claude) to answer using the enhanced prompts. (2) mode='answer' (default): Rewrites prompt, calls LLM with grounding instructions, returns answer with extracted claims. Fast, no internet. (3) mode='verified': Does #2, then runs full browse pipeline (search + extract + verify), fuses best of both — source-backed claims, evidence-based confidence. Use for maximum accuracy.

输入参数modedepthintentprompt必填verifycontext

session_create

Create a new research session. Sessions persist knowledge across multiple queries — each query builds on prior research.

输入参数name必填

session_ask

Research a question within a session. Recalls prior knowledge, runs the research pipeline, and stores new claims. Later queries in the same session benefit from accumulated knowledge.

输入参数depthquery必填session_id必填

session_recall

Query accumulated knowledge from a session without making new web searches. Returns previously verified claims relevant to the query.

输入参数limitquery必填session_id必填

session_share

Share a research session publicly. Returns a shareable URL that anyone can view — great for sharing research findings with teammates, in reports, or on social media.

输入参数session_id必填

session_knowledge

Export all knowledge from a research session. Returns all verified claims, sources, and confidence scores accumulated across queries.

输入参数limitsession_id必填

session_fork

Fork a shared research session to continue building on someone else's research. Creates a copy of all knowledge in your own session.

输入参数share_id必填

feedback

Submit feedback on a search result to improve future accuracy. Helps the self-learning engine tune verification thresholds.

输入参数rating必填result_id必填claim_index

版本历史

5
  1. v1.4.3最新Nov 5, 2026
  2. v1.4.1Oct 29, 2026
  3. v1.4.0Oct 25, 2026
  4. v1.3.0Oct 11, 2026
  5. v1.1.0Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分