Local Realtime Search
Provides a keyless HTML search fallback when SearXNG is unavailable, ensuring continued realtime research capability.
Provides realtime web research by querying a local SearXNG instance, with health diagnostics and resilient fallback to other search providers.
LM Studio Realtime Search MCP
Give LM Studio local models ChatGPT-like realtime web research through MCP.
No API keys. No login. Local SearXNG. Clickable sources. Works with the model you already loaded in LM Studio.
LM Studio chat model
-> MCP local_research tool
-> resilient keyless SearXNG engines + fallbacks + page extraction
-> citations, source links, provider health, warnings
-> your local model writes the final answerWhy This Exists
Local models are good, but they usually miss current information. This project adds a local realtime research layer for LM Studio without routing your questions through paid search APIs or cloud LLMs.
Use it for:
current news, release notes, docs, prices, dates, weather, and changing facts
source-backed benchmark or product comparisons
Korean and English web research
local-only LM Studio workflows with MCP tools
Related MCP server: Web Researcher MCP
Features
local_researchMCP tool for LM StudioFastAPI endpoint and local browser UI
SearXNG Docker search backend, optional but recommended
DuckDuckGo HTML fallback when SearXNG is unavailable
Direct local date/time answers without model/search calls
Conditional wttr.in weather provider for weather questions
Lightweight answer strategy routing for date, weather, docs, current facts, comparisons, and benchmarks
Automatic freshness inference for today/latest/weather-style questions
SQLite search/page cache
Clickable sources and citation IDs
Host-diverse result fetching to avoid one site crowding out other sources
SearXNG backend health diagnostics in
/health, API responses, and MCP tool resultsSSRF-style URL safety guard for page fetching
Provider health telemetry and weak-source warnings
Explicit LM Studio model selection with no hidden fallback
Safer handling for reasoning models that return empty final content
fast,balanced,deep, anddeepsearchresearch modesAdaptive
automode that selects research depth for each questionlocal_statusdiagnostics andlocal_recoverone-click backend recoveryWindows one-click launcher for Docker, SearXNG, and LM Studio
Demo
The 60-second demo path shows a local model calling MCP, collecting live evidence, and returning clickable citations:
Use local_research to answer: What changed recently in LM Studio MCP support? Include sources.See docs/demo.md for the recording script, expected health checks, and verification commands.
Quick Start
Requirements:
Python 3.11+
Docker Desktop, for local SearXNG
LM Studio 0.3.17+ with MCP support
On Windows, the easiest startup path is to double-click:
START_LOCAL_SEARCH.cmdThe launcher starts Docker Desktop when needed, waits for local SearXNG, and opens LM Studio if it is not already running. It never loads or switches the LM Studio model, so you stay in control of which local model is active.
To start the optional API/UI too, run START_LOCAL_SEARCH.cmd api from PowerShell or Command Prompt.
Clone and install:
git clone https://github.com/MirLunaDEV/local-realtime-search.git
cd local-realtime-search
uv sync --extra mcpStart local search:
docker compose up -d searxngOn Windows, you can also start Docker Desktop and SearXNG together:
.\scripts\start_search_backend.ps1To run SearXNG plus the optional browser UI/API in Docker:
Copy-Item .env.example .env
# Edit LM_STUDIO_MODEL in .env to match your loaded LM Studio model ID.
docker compose --profile api up -d --buildThen open:
http://127.0.0.1:8787Generate an LM Studio MCP config for your machine:
uv run python scripts/generate_lmstudio_mcp_config.pyOn Windows, generate an auto-start config if you want LM Studio to start Docker/SearXNG when the MCP plugin starts:
uv run python scripts/generate_lmstudio_mcp_config.py --auto-start-backendCopy the printed JSON into LM Studio:
Program tab -> Install -> Edit mcp.jsonThen ask in LM Studio:
Use local_research to answer: What changed recently in LM Studio MCP support?If the tool call appears and returns citations/source URLs, it is working.
To diagnose the local stack from LM Studio, call:
Use local_status to check Docker, SearXNG, API/UI, config, and recent MCP startup logs.To recover the local search backend from LM Studio, call:
Use local_recover to start Docker and SearXNG, then report whether local_research is ready.MCP Config
An example config lives at mcp/lmstudio.mcp.json.
For Windows, the generated config is safer than hand-editing because it uses the exact uv.exe path on your machine.
uv run python scripts/generate_lmstudio_mcp_config.py --model "your-loaded-lm-studio-model-id"The MCP tool intentionally does not call LM Studio for final synthesis. LM Studio calls local_research, receives compact evidence, then the currently loaded chat model writes the final answer.
Optional Web UI
The project also includes a local research UI:
uvicorn app.main:app --reload --port 8787Open:
http://127.0.0.1:8787The UI streams progress states, answer text, source links, provider health, warnings, and timings.
Check backend health:
http://127.0.0.1:8787/healthThe health response includes search_backend.status so you can tell whether SearXNG is ok, empty, or down.
Docker instructions: docs/docker.md.
API Usage
Invoke-RestMethod -Method Post `
-Uri http://127.0.0.1:8787/ask `
-ContentType application/json `
-Body '{"question":"What changed recently in LM Studio tool use?","mode":"fast","freshness":"month"}'Available modes:
Mode | Use case | Default profile |
| Default adaptive routing | Direct/date/weather -> |
| Everyday realtime answers | 8 fetches, 8 evidence chunks, 10k evidence chars, 4s+ search timeout, 2400 generation tokens |
| More complete answers | 16 fetches, 20 evidence chunks, 24k evidence chars, 4096 generation tokens |
| Slow, broader evidence gathering | 24+ fetches, 40+ evidence chunks, 50k evidence chars, 8192 generation tokens |
| Full deep research context for complex questions | 40+ fetches, 72+ evidence chunks, 110k evidence chars, 36 MCP citations, 12k generation tokens |
Every response includes citations, source URLs, timings, cache hits, provider health, warnings, validation metadata, and mode profile.
Responses include request_id, and the API/MCP server emits one JSON-line structured log per research request with strategy, latency, citation counts, warning counts, and provider status.
Responses also include search_backend_status. If SearXNG is down or returning empty results, the API and MCP tool result add a warning such as:
SearXNG search backend is down at http://127.0.0.1:8080; using fallback sources only.Weather questions use a short wttr.in lookup before broad web search. Non-weather questions do not call the weather provider, so this does not add startup latency to normal prompts.
Responses also include answer_strategy, a fast rule-based routing hint that tells LM Studio whether the answer should behave like a direct answer, weather lookup, docs lookup, current fact check, comparison, benchmark analysis, or general research.
The MCP server also exposes local_status, a diagnostic tool that reports Docker engine reachability, SearXNG health, optional API/UI health, config warnings, recent startup logs, and recommended actions. For one-click recovery, local_recover starts Docker/SearXNG through the Windows helper script and then returns fresh health checks.
Example Prompts
Use local_research to answer: 오늘 날짜와 현재 한국 시간 알려줘.Use local_research to answer: Compare the latest LM Studio MCP support with Open WebUI web search.Use local_research in deepsearch mode to answer: What are the newest Qwen local reasoning model options for LM Studio? Compare sources and cite the main claims.More examples: examples/prompts.md.
Configuration
Copy .env.example to .env or set environment variables directly.
Important variables:
LM_STUDIO_BASE_URL: defaulthttp://127.0.0.1:1234/v1LM_STUDIO_MODEL: exact model ID loaded in LM StudioLOCAL_TIMEZONE: timezone for direct date/time answersSEARXNG_BASE_URL: defaulthttp://127.0.0.1:8080CACHE_PATH: SQLite cache pathFETCHER:auto,http, orcrawl4aiALLOW_PRIVATE_NETWORK_FETCH: defaultfalse; blocks page fetches to localhost/private/internal IP rangesRESOLVE_FETCH_HOSTNAMES: defaulttrue; resolves hostnames before fetching to catch private-network DNS targetsWEATHER_TIMEOUT_SECONDS: timeout for conditional wttr.in weather lookupsLM_STUDIO_MAX_TOKENS: max generation tokens for answer synthesisSEARCH_TIMEOUT_SECONDS: default5.0; lower values can make free search engines look degraded during slow responses
/health also reports config validation warnings/errors, including placeholder model IDs, invalid URLs, invalid fetcher names, unsafe private-network fetch settings, and invalid numeric limits.
Optional Crawl4AI extraction:
uv sync --extra crawl4aiReasoning models may need a large generation budget before they emit final content. The default V2 settings use LM_STUDIO_MAX_TOKENS=4096 and SYNTHESIS_TIMEOUT_SECONDS=180.
Security
The app runs locally, but page fetching still happens from your machine. By default, fetched pages are restricted to http and https URLs and private/internal targets such as localhost, 127.0.0.1, 192.168.x.x, 10.x.x.x, link-local, multicast, and reserved IP ranges are blocked. Hostnames are resolved before fetch so a public-looking domain that points at a private IP is also blocked.
Set ALLOW_PRIVATE_NETWORK_FETCH=true only if you intentionally want the assistant to fetch internal sites. Blocked URLs are counted as blocked_url and surfaced in warnings instead of being turned into citations.
Benchmark
With LM Studio, SearXNG, and the FastAPI service running:
uv run python scripts/benchmark.py --out benchmark-results/latest.jsonFor a quick smoke run:
uv run python scripts/benchmark.py --category direct_answer --category weather --out benchmark-results/smoke.jsonTo inspect or run specific cases:
uv run python scripts/benchmark.py --list-cases
uv run python scripts/benchmark.py --case-id lmstudio_mcp --out benchmark-results/lmstudio-mcp.jsonThe benchmark records latency, citation count, expected-domain hits, warnings, and answer previews across mixed question types.
Each case in benchmarks/questions.json can also define quality gates such as min_citations, expected_domains, expected_answer_strategy, allowed_search_backend_statuses, required_evidence_terms, required_any_evidence_terms, and forbidden_answer_terms. Failed gates are reported per case in failure_reasons, so regressions are easier to diagnose than a single pass/fail number.
The benchmark defaults to --mode auto, so it measures the normal adaptive LM Studio experience unless you explicitly pin a mode.
Compare against a previous baseline:
uv run python scripts/benchmark.py `
--baseline benchmark-results/baseline.json `
--out benchmark-results/latest.json `
--compare-out benchmark-results/comparison.json `
--fail-on-regression `
--max-p90-regression-ms 5000 `
--min-success-rate 1.0 `
--min-expected-domain-rate 0.8Use --mode deepsearch for the heavier research suite when you want to stress large-context local models.
How It Compares
Project type | This project |
Full Perplexity clone | No. This is a focused LM Studio research tool. |
General LLM web UI | No. It plugs into LM Studio through MCP. |
Cloud search API wrapper | No. It works with local SearXNG and free fallbacks. |
Simple search MCP | More than that. It fetches pages, ranks evidence, reports health, and returns citation-ready context. |
Architecture
Plan search query variants.
Query official hints, SearXNG, and DuckDuckGo fallback in parallel.
Deduplicate and rank candidate URLs.
Select a host-diverse fetch set with strict timeouts.
Extract compact evidence chunks.
Return citation-ready context to LM Studio or synthesize through the API/UI path.
deepsearch expands query variants, candidate URLs, fetched pages, per-page evidence chunks, total evidence characters, and MCP citation payload size. It is slower than deep, but it gives larger-context local models much more research material before they write the final answer.
Troubleshooting
Docker is not running:
open //./pipe/dockerDesktopLinuxEngine: The system cannot find the file specifiedStart Docker Desktop, then run:
docker compose up -d searxngOr use the helper script:
.\scripts\start_search_backend.ps1To start Docker/SearXNG automatically when LM Studio starts the MCP plugin, use the generated wrapper config:
uv run python scripts/generate_lmstudio_mcp_config.py --auto-start-backendThe wrapper writes startup diagnostics to .cache/mcp-startup.log and MCP research event logs to .cache/mcp-events.jsonl.
MCP cannot import app:
ModuleNotFoundError: No module named 'app'Update to the latest commit. The MCP server now injects the project root into sys.path.
LM Studio shows no tool:
verify the JSON was saved in LM Studio's
mcp.jsonuse the generated config script so
uv.exeandcwdare correctrestart LM Studio after editing MCP config
Launch Links
Demo prompts:
examples/prompts.mdLaunch checklist:
docs/launch-checklist.mdDocker guide:
docs/docker.mdMCP config template:
mcp/lmstudio.mcp.json
Maintainers And Community
Changes:
CHANGELOG.mdContributing:
CONTRIBUTING.mdSecurity policy:
SECURITY.mdCode of conduct:
CODE_OF_CONDUCT.mdRelease/demo checklist:
docs/launch-checklist.md
License
MIT
This server cannot be installed
Maintenance
Related MCP Servers
- Flicense-qualityDmaintenanceEnables local LLMs in LM Studio to perform web searches through a privacy-focused local SearXNG instance. It features concurrent search capabilities, automatic result caching, and advanced filtering options like domain exclusion and time-range limits.Last updated7
- AlicenseAqualityAmaintenanceMCP server for AI-powered web research — search (Google, Brave, Serper, SearXNG), scrape any page, extract PDFs/DOCX/YouTube transcripts, academic & patent search. Single Go binary. Works with Claude, Cursor, Copilot, and any MCP client.Last updated2547MIT
- AlicenseAqualityCmaintenanceProvides local-first web intelligence over MCP with tools for search, fetch, crawl, extract, cache, find-similar, research, and autonomous agent loops, requiring no API keys.Last updated101,6434,116AGPL 3.0
- Alicense-qualityAmaintenanceZero-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.Last updated10Apache 2.0
Related MCP Connectors
Local-first RAG engine with MCP server for AI agent integration.
Jina AI Reader/Search MCP — turn any URL into clean LLM-ready markdown, plus web search.
Multi-engine search for AI agents. Trust scoring, local corpus, MCP-native. Self-hostable, BYOK.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/MirLunaDEV/local-realtime-search'
If you have feedback or need assistance with the MCP directory API, please join our Discord server