Add Web Search abilities to LM Studio

First we have to install what we are going to use for search, which in our case is SearXNG.

// First we create a network with Docker
docker network create mynet

// Create a directory for our config and data
mkdir -p ./searxng/config/ ./searxng/data/
cd ./searxng/

// If we need to restart we can use this
sudo docker rm -f searxng

// Run the container
sudo docker run \
  --network sfnet \
  -p 16000:8080 \
  -d \
  --name searxng \
  -v "./config/:/etc/searxng/" \
  -v "./data/:/var/cache/searxng/" \
  docker.io/searxng/searxng:latest

You should be able to access the search engine at localhost:16000 at this point

Next we need to add our MCP service, which we can do by installing this via npm.

https://github.com/ihor-sokoliuk/mcp-searxng

In LM Studio click on Developer -> Local Server -> mcp.json

Now add this block.

{
  "mcpServers": {
    "browsermcp": {
      "command": "npx",
      "args": [
        "@browsermcp/mcp@latest"
      ]
    },
    "searxng": {
      "command": "mcp-searxng",
      "env": {
        "SEARXNG_URL": "http://localhost:16000"
      }
    }
  }
}

Now turn on the tools in LM Studio