lmstudio-websearch
Enables DuckDuckGo web and image search, YouTube video search and playback, and IPTV channel search and playback as MCP tools directly within LM Studio.
README
LM Studio Web Search MCP Server
A local MCP (Model Context Protocol) server that adds DuckDuckGo web search, image search, YouTube video search/playback, and IPTV channel search/playback to LM Studio.
What it does
- Exposes seven MCP tools:
web_search: text search with title, URL, and snippetimage_search: image search with direct image URLs and thumbnail URLsvideo_search: YouTube video search with thumbnails, duration, uploader, and view countopen_video_in_browser: opens a YouTube video in the default browserplay_video_in_mpv: plays a YouTube video in the mpv desktop playeriptv_search: searches publicly available IPTV channels from iptv-org/iptvplay_iptv_in_mpv: plays an IPTV stream in mpv
- No API key required
- Runs entirely on your Mac
Files
| File | Purpose |
|---|---|
server.py |
MCP server implementation |
run.sh |
Wrapper script that activates the venv and starts the server |
requirements.txt |
Python dependencies |
test_mcp.py |
Manual test script |
mcp.json.example |
Example LM Studio configuration |
Tools
web_search
Text search via DuckDuckGo.
- Arguments:
query(string, required): search termsmax_results(integer, 1-10, default 5)
image_search
Image search via DuckDuckGo.
- Arguments:
query(string, required): search termsmax_results(integer, 1-10, default 5)
- Returns: markdown-formatted image results. Each result includes a markdown image tag
plus the source page URL.
This format gives LM Studio the best chance of rendering the image inline in the chat window. If LM Studio does not render it inline, you can click the image URL to view it in a browser.
video_search
YouTube video search via yt-dlp.
:
- Arguments:
query(string, required): search termsmax_results(integer, 1-10, default 5)format(string, default"markdown"):"markdown"returns explicitimages plus clickable YouTube links;"plain"returns simple text links;"image"returns only clean thumbnail URLs.
- Returns: by default, markdown with the YouTube thumbnail image and a clickable
Watch:link. This gives you the best chance of seeing a preview image and a working video URL in LM Studio.
Ask the model things like:
Find me YouTube videos about sourdough bread baking.
Or, to open a video after finding it:
Open the first video in my browser.
open_video_in_browser
Opens a YouTube URL in your default browser.
- Arguments:
url(string, required): the YouTube URL to open
- Returns: JSON status confirming the URL was opened or an error message.
- Only allows
youtube.com,www.youtube.com,youtu.be, andm.youtube.comURLs for safety.
play_video_in_mpv
Plays a YouTube URL in mpv, a free desktop video player.
- Arguments:
url(string, required): the YouTube URL to playsize(string, default"large"):"default","large"(1280x720),"fullscreen", or a custom geometry like"800x600"or"50%"
- Returns: JSON status confirming mpv was launched or an error message.
- Only allows YouTube URLs.
- Uses yt-dlp with the
bestvideo*+bestaudio/bestformat so YouTube videos are played at the highest available quality. - Requirements:
mpvmust be installed and available in your PATH.yt-dlpis already installed by this project, and mpv will use it automatically.
Install mpv on macOS:
brew install mpv
Use it from LM Studio:
Play the first video in mpv.
Or with a specific size:
Play the first video in mpv fullscreen.
mpv will open in its own window and start playing the YouTube video.
iptv_search
Searches publicly available IPTV channels from iptv-org/iptv.
- Arguments:
query(string, required): search terms, matched against channel title and category (group-title)max_results(integer, 1-30, default 10)
- Returns: markdown results with the channel name, category, logo, ID, and clickable stream URL.
- Results are fetched from
https://iptv-org.github.io/iptv/index.m3u.
Ask the model things like:
Find Singapore news channels on IPTV.
play_iptv_in_mpv
Plays an IPTV stream URL in mpv.
- Arguments:
url(string, required): the.m3u8stream URL to playsize(string, default"large"):"default","large"(1280x720),"fullscreen", or a custom geometry like"800x600"or"50%"
- Returns: JSON status confirming mpv was launched or an error message.
- Requirements:
mpvmust be installed.
Use it from LM Studio:
Play the first IPTV channel in mpv.
Quick start
-
Install dependencies (already done if you are reading this after setup):
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt -
Test the server:
source venv/bin/activate python test_mcp.pyOr use the official MCP client smoke test (this was used during setup):
source venv/bin/activate python -c " from mcp import ClientSession, StdioServerParameters, stdio_client import anyio params = StdioServerParameters(command='bash', args=['./run.sh']) async def main(): async with stdio_client(params) as (read, write): async with ClientSession(read, write) as session: await session.initialize() print([t.name for t in (await session.list_tools()).tools]) print((await session.call_tool('web_search', arguments={'query': 'today news', 'max_results': 2})).content[0].text[:500]) anyio.run(main) "
Configure LM Studio
LM Studio 0.4.0+ supports MCP servers. You can add this server via the in-app MCP editor or by editing mcp.json directly.
In-app (recommended)
- Open LM Studio
- Go to Settings → MCP Servers
- Click Add Server
- Fill in:
- Name:
lmstudio-websearch - Transport:
stdio - Command:
bash - Arguments:
/ABSOLUTE/PATH/TO/lmstudio-websearch/run.sh
- Name:
- Save and enable the server
Manual mcp.json
LM Studio's mcp.json location on macOS:
~/Library/Application Support/LM Studio/mcp.json
Add this entry (create the file if it does not exist):
{
"mcpServers": {
"lmstudio-websearch": {
"command": "bash",
"args": [
"/ABSOLUTE/PATH/TO/lmstudio-websearch/run.sh"
]
}
}
}
Enable the setting
Make sure this setting is enabled in LM Studio:
- Settings → Server Settings → Allow calling servers from mcp.json
Use in chat
-
Load a tool-capable model. Qwen 3.8 27B has native tool use support in LM Studio.
-
Start a new chat.
-
Ask a question that requires current information, for example:
What are the latest headlines today?
-
LM Studio should invoke the
web_searchtool, get results, and answer based on them.
Troubleshooting
Server is not listed in LM Studio
- Confirm the path in
run.shis absolute and the file is executable (chmod +x run.sh). - Restart LM Studio after adding the server.
- Check LM Studio logs via Developer → Logs.
Model does not call the tool
- Use a model with native tool use support (Qwen, Llama 3.1/3.2, Mistral).
- Make sure Tools is enabled for the chat (right panel).
- Try explicitly asking the model to search the web.
Search returns no results
- DuckDuckGo occasionally blocks automated requests. Wait a moment and retry.
- Check your network connection.
Dependency issues
If you see import errors, reinstall dependencies:
source venv/bin/activate
pip install -r requirements.txt
Updating the search backend
To use a different text search provider (Brave, SearXNG, Bing, Google), edit server.py and replace do_text_search() with your preferred API.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。