A local web search server for LM Studio that enables AI models to search the web and retrieve content from web pages.
- Search the web using DuckDuckGo search engine
- Fetch and extract content from web pages
- Customizable search parameters (region, safesearch, time limits)
- Easy integration with LM Studio through MCP protocol
- Python 3.12 or higher
- uv package manager
uv is an extremely fast Python package installer and resolver, written in Rust. It's a replacement for pip and pip-tools with significant performance improvements.
On macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | shOn Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"For other installation methods, see the uv documentation.
- Clone this repository:
git clone <repository-url>
cd web-search-lmstudio-mcp- Create a virtual environment and install dependencies:
uv venv --python 3.12
uv syncAdd the following configuration to your LM Studio mcp.json file:
{
"mcpServers": {
"local-web-search": {
"command": "uv",
"args": [
"run",
"python",
"/absolute/path/to/web-search-lmstudio-mcp/main.py"
]
}
}
}Note: Replace /absolute/path/to/web-search-lmstudio-mcp/ with the actual absolute path to your cloned repository.
Once configured, the web search tools will be available in LM Studio:
- web_search: Performs a web search with customizable parameters
- get_page_content: Fetches and extracts text content from a given URL
The tools will appear in the MCP tools section of LM Studio and can be used by your AI models to access web information.
query: Search termsnum_results: Number of results to return (default: 10)region: Search region (e.g., 'us-en', 'uk-en', 'de-de')safesearch: Safety filter ('on', 'moderate', 'off')timelimit: Time constraint ('d', 'w', 'm', 'y')
url: The URL of the page to fetch content from
