New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

lastsearch

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lastsearch

Grounded Intelligence for AI agents. MCP server with real-time web search, evidence extraction, verification, and structured citations. The research infrastructure for LangChain, CrewAI, and custom agents.

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
87
-68.13%
Maintainers
1
Weekly downloads
 
Created
Source

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

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:

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

Cursor / Windsurf

Add to your MCP settings:

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

HTTP Transport

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

# Start with HTTP transport
npx lastsearch --http

# Or set the port via environment variable
MCP_HTTP_PORT=3100 npx lastsearch --http

The server exposes:

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

Docker

docker build -t lastsearch ./apps/mcp
docker run -p 3100:3100 -e LASTSEARCH_API_KEY=ls_xxx lastsearch

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

{
  "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:

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

Keywords

mcp

FAQs

Package last updated on 14 Sep 2026

Related posts