{"id":"5d0407e6-3164-4812-9c59-a4bf8786a714","slug":"lmstudio-local-tools","kind":"mcp","name":"lmstudio-local-tools","summary":"Offline terminal, browser, and web-search tools for any local LM Studio model — no cloud API, no API keys.","owner":"RouterGlock","repoUrl":"https://github.com/RouterGlock/lmstudio-local-tools","license":"MIT","licenseTier":"permissive","trust":"community","stars":0,"match":null,"fewStars":true,"format":"mcp","createdAt":"2026-10-06T05:36:54.000Z","addedAt":"2026-10-21T05:17:02.596Z","logoUrl":"https://avatars.githubusercontent.com/u/305704601?u=59766956d97368390e49eb8ea2110bb56bb9468e&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["browser-web","search","cloud-infra"],"tags":["llm-tools","lmstudio","local-ai","offline-first","python"],"runtime":"binary","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-21T07:30:11.448Z","sample":false,"url":"https://conduits.dev/tools/lmstudio-local-tools","language":"Python","transports":["stdio"],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"![LM Studio Local Tools](assets/banner.svg)\n\n# lmstudio-local-tools\n\n[![GitHub repo](https://img.shields.io/badge/GitHub-lmstudio--local--tools-blue?logo=github)](https://github.com/RouterGlock/lmstudio-local-tools)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nA local-AI fallback stack for [LM Studio](https://lmstudio.ai): terminal and\nbrowser control via MCP, a stdlib-only terminal chat client, and a keyless web\nsearch server. Point any tool-calling-capable local model at your shell, your\nreal Chrome, and the open web — no cloud API, no API keys, nothing leaves\nyour machine.\n\n![How it fits together: qwen talks to LM Studio's local server, which fans out to the terminal, browser, and websearch MCP tools](assets/architecture.svg)\n\n## What's included\n\n| | |\n|---|---|\n| **`qwen`** | stdlib-only Python REPL that talks to LM Studio's local server API, including MCP tool calls. Works with any tool-calling-capable model. |\n| **`rg_websearch_mcp.py`** | keyless MCP server exposing `web_search(query, max_results=5)`, backed by Bing's HTML results page — no API key required. |\n| **`mcp.json.example`** | template MCP server config for `~/.lmstudio/mcp.json`. |\n| **`scripts/` + `launchagents/`** | optional LaunchAgent to keep the LM Studio local server running in the background. |\n\nMCP servers used:\n- **terminal** → [`@wonderwhy-er/desktop-commander`](https://www.npmjs.com/package/@wonderwhy-er/desktop-commander) — shell command execution, file read/write/edit/search.\n- **browser** → [`@playwright/mcp`](https://www.npmjs.com/package/@playwright/mcp) `--extension` — controls your real running Chrome via a bridge extension.\n\nBoth run via `npx`, no persistent install required.\n\n## Setup\n\n1. **Copy the MCP config.** Copy `mcp.json.example` to `~/.lmstudio/mcp.json`\n   (merge with any existing entries), filling in the placeholders:\n   - `PLAYWRIGHT_MCP_EXTENSION_TOKEN` — shown when you install the\n     [Playwright Extension](https://chromewebstore.google.com/detail/playwright-extension/mmlmfjhmonkocbjadbfplnigmagldckm)\n     in Chrome.\n   - The absolute path to `rg_websearch_mcp.py` for the `websearch` entry.\n\n2. **Reload MCP servers in LM Studio.** Open LM Studio → left sidebar →\n   **Program** (plug/MCP icon). You should see `terminal`, `browser`, and\n   `websearch` listed; hit refresh or restart LM Studio if not.\n\n3. **Load a tool-calling capable model** from LM Studio's model picker, and\n   enable the `terminal`/`browser`/`websearch` MCP tools for the chat.\n\n4. **Enable server authentication** (Developer tab → Local Server → Server\n   Settings): turn on **Require Authentication**, then **Manage Tokens** →\n   **Create Token**, and export it:\n   ```\n   export LM_API_TOKEN=\"<your token>\"\n   ```\n   This must be on before **\"Allow calling servers from mcp.json\"** will take\n   effect — enabling only the mcp.json toggle without authentication first\n   silently does nothing.\n\n## Usage\n\n```\ncd lmstudio-local-tools\nexport LM_API_TOKEN=\"<your token>\"\n./qwen                          # interactive REPL, both tools on\n./qwen --no-browser              # terminal tool only\n./qwen --no-terminal              # browser tool only\n./qwen --model \"<model-id>\"\n./qwen --show-reasoning           # show the model's reasoning blocks\n./qwen -p \"list files in ~/Desktop\"   # one-shot, non-interactive\n```\n\n```\n$ ./qwen\nmodel: qwen/qwen3.8-27b\ntools: ['mcp/terminal', 'mcp/browser']\ntype 'exit' or Ctrl-D to quit\n\n> list the files on my Desktop\n[tool] terminal.list_directory({\"path\": \"~/Desktop\"})\n  -> Portfolio, Screenshots, notes.txt, ...\nYour Desktop has a Portfolio folder, a Screenshots folder, and a notes.txt file.\n```\n\nThe client keeps the conversation stateful across turns, prints each tool\ncall it makes with a truncated output preview, then the model's final reply.\nType `exit` or Ctrl-D to quit.\n\n**Want to just type `qwen` from anywhere?**\n```\nln -s \"$(pwd)/qwen\" ~/.local/bin/qwen   # make sure ~/.local/bin is on your PATH\n```\nThen `qwen` works as a plain command in any terminal, no `cd` or `python3` needed.\n\nTest the web search server standalone:\n```\npython3 rg_websearch_mcp.py --self-test \"your query here\"\n```\n\n### Isolated browser profile (optional)\n\nIf you'd rather not install the Playwright extension, edit the `browser`\nentry in `mcp.json` to use a separate persistent Chrome profile instead of\nyour real one:\n```json\n\"args\": [\"-y\", \"@playwright/mcp@latest\", \"--browser\", \"chrome\", \"--user-data-dir\", \"~/.lmstudio-browser-profile\"]\n```\n\n### Auto-start the LM Studio server\n\nCopy `scripts/ensure-lmstudio-server.sh` to `~/.local/bin/` and\n`launchagents/com.lmstudio.server-autostart.plist` to\n`~/Library/LaunchAgents/`, updating the paths inside each to match your\nusername, then:\n```\nlaunchctl load ~/Library/LaunchAgents/com.lmstudio.server-autostart.plist\n```\nThis runs `lms server start` at login and every 5 minutes thereafter.\n\n## Safety notes\n\n- **terminal** gives the model real shell access — full read/write/delete on\n  your filesystem and the ability to run any command. Leave LM Studio's\n  per-tool-call confirmation dialog on (`neverAskForToolConfirmation: false`\n  in `~/.lmstudio/settings.json`), and don't approve a command you don't\n  understand.\n- **browser** with `--extension` can act in your real, logged-in browser.\n  Don't approve actions on sensitive tabs you haven't reviewed.\n- `qwen` has no per-tool-call confirmation of its own — the API\n  executes tool calls immediately once the server setting above is on.\n- Local models are more likely than a frontier hosted model to misread\n  instructions or run a destructive command by mistake. Review before\n  approving anything destructive.\n\n## Notes on the web search backend\n\n`rg_websearch_mcp.py` scrapes Bing's plain HTML results page rather than\nDuckDuckGo, because DuckDuckGo's `html.duckduckgo.com` / `lite.duckduckgo.com`\nendpoints return an anti-bot CAPTCHA for a bare scripted request. Scraping a\nsearch engine's HTML is inherently a \"verify it still works\" integration — if\nBing starts blocking requests too, check the page's current markup in a\nbrowser and adjust the regexes accordingly.\n\n## License\n\nMIT © 2026 RouterGlock — see [LICENSE](LICENSE).\n"}