Web and Python Sandbox MCP server

Provides web content access and Python code execution in a sandboxed environment, enabling information verification and working code demonstrations through containerized tools with appropriate security constraints.
Back to servers
Setup instructions
Provider
Tom Foster
Release date
Feb 21, 2025
Language
Python
Stats
3 stars

This MCP Server allows AI assistants to access websites and search the web safely, with clear feedback and helpful error messages. It provides a secure way for AI systems to interact with online resources while maintaining transparency about actions taken.

Installation Options

Using Docker (Recommended)

The easiest way to run the MCP Server is using Docker:

  1. Make sure Docker is installed on your system
  2. Create a file named docker-compose.yml with the following content:
services:
  mcp-server:
    environment:
      # Required: URL for your SearXNG instance's Search API
      - SEARXNG_QUERY_URL=http://searxng:8080
      # Optional: Configure network mode (SSE) for LibreChat etc.
      - SSE_HOST=0.0.0.0
      - SSE_PORT=8080
      # Optional: Set a custom User-Agent for web requests
      - USER_AGENT=MCP-Server/1.0 (github.com/tcpipuk/mcp-server)
    image: ghcr.io/tcpipuk/mcp-server/server:latest
    ports: # Only needed if using SSE_HOST/SSE_PORT
      - "8080:8080" # Expose port 8080 on host
    restart: unless-stopped
    stop_grace_period: 1s

  # Example SearXNG service (optional, adapt as needed)
  # searxng:
  #   environment:
  #     - SEARXNG_BASE_URL=http://searxng:8080 # Ensure SearXNG knows its own URL
  #   image: searxng/searxng:latest
  #   restart: unless-stopped
  #   volumes:
  #     - ./searxng:/etc/searxng:rw
  1. Start the server by running:
docker compose up -d

Important: You must provide the SEARXNG_QUERY_URL environment variable pointing to your SearXNG instance's Search API endpoint.

Running Locally

For those who prefer running directly on their system:

  1. Install uv (requires Python 3.13+):
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Create and activate a virtual environment:
uv venv
source .venv/bin/activate  # Linux/macOS
# or
.venv\Scripts\activate     # Windows
  1. Install dependencies from the lockfile:
uv sync
  1. Set required environment variables:
# Required: URL for your SearXNG instance's Search API
export SEARXNG_QUERY_URL="http://your-searxng-instance.local:8080"
# Optional: Custom User-Agent
export USER_AGENT="CustomAgent/1.0"
  1. Run the server:
# For network (SSE) mode (e.g., for LibreChat)
mcp-server --sse-host 0.0.0.0 --sse-port 3001

# For direct stdio mode (e.g., for Claude Desktop)
mcp-server

Connection Methods

The MCP Server supports two connection modes:

Network Connection (SSE)

Use this mode when connecting from LibreChat or other networked clients. The server listens on a network port for connections.

For LibreChat integration, add this to your librechat.yaml (assuming SSE_PORT=8080):

mcpServers:
  mcp-server:
    iconPath: "/path/to/icon.png" # Optional: Custom icon
    label: "MCP Web/Search" # Optional: Custom label shown in UI
    type: sse
    url: http://mcp-server:8080/sse # Adjust host/port if needed

Direct Connection (stdio)

This mode is useful for local testing or with Claude Desktop. The server communicates directly via standard input/output.

Available Tools

The MCP Server provides two powerful tools:

Search Tool

Allows AI assistants to search the web via SearXNG for current information, specific resources, or to perform calculations.

Web Tool

Enables AI assistants to access websites and process their content. It can:

  • Convert pages to markdown for easy reading
  • Get raw content
  • Extract links from webpages

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "mcp-server" '{"command":"docker","args":["run","--rm","-i","-e","SEARXNG_QUERY_URL=http://your-searxng-instance:8080","ghcr.io/tcpipuk/mcp-server/server:latest"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "mcp-server": {
            "command": "docker",
            "args": [
                "run",
                "--rm",
                "-i",
                "-e",
                "SEARXNG_QUERY_URL=http://your-searxng-instance:8080",
                "ghcr.io/tcpipuk/mcp-server/server:latest"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "mcp-server": {
            "command": "docker",
            "args": [
                "run",
                "--rm",
                "-i",
                "-e",
                "SEARXNG_QUERY_URL=http://your-searxng-instance:8080",
                "ghcr.io/tcpipuk/mcp-server/server:latest"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later