Skip to main content
Glama
MCP Internet Server

MCP Internet Server

by devk86

MCP Internet Server

Small MCP server exposing two tools for internet access:

  • search_internet(query, max_results=5) — perform a web search and return structured results.

  • fetch_webpage_content(url) — fetch and extract text from an HTML page with SSRF protections.

Features

  • Structured (dict) responses for easier downstream processing.

  • SSRF protections: optional ALLOWED_DOMAINS allowlist and private IP blocking.

  • JSON-line audit logging (path configurable via AUDIT_LOG_PATH).

  • Unit tests using pytest.

Quick start

  1. Create and activate a virtualenv (recommended):

python -m venv .venv
# Windows
.venv\Scripts\activate
# Unix/macOS
source .venv/bin/activate
  1. Install dependencies:

python -m pip install -r requirements.txt
  1. Run a quick smoke test:

python run_test.py
  1. Run unit tests:

python -m pytest -q
  1. Run test coverage:

python -m pytest --cov=server --cov-report=term-missing
  1. MCP json to use in inference engine

{
  "mcpServers": {
    "internet_assistant": {
      "command": "PATH TO YOUR PYTHON EXECUTABLE",
      "args": [
        "PATH TO YOUR server.py"
      ]
    }
  }
}

Configuration

  • ALLOWED_DOMAINS: optional comma-separated list of domains that fetch_webpage_content is allowed to access. If unset, fetching is allowed for any public hostname (subject to IP checks).

  • AUDIT_LOG_PATH: path to write newline-delimited JSON audit events (default: audit.log).

  • METRICS_PORT: port to expose Prometheus metrics via HTTP. Set to 0 or unset to disable metrics export.

Notes

  • The project prefers the ddgs package for search; duckduckgo_search fallback is supported.

  • Audit log rotation, remote logging, or more advanced rate-limiting are not included but recommended for production deployments.

Files of interest

  • server.py — main MCP tools implementation

  • run_test.py — smoke tests

  • tests/test_server.py — pytest unit tests

  • requirements.txt — dependencies

License: MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Enables web search through DuckDuckGo and webpage content fetching with intelligent text extraction. Features built-in rate limiting and LLM-optimized result formatting for seamless integration with language models.
      2
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables performing web searches and fetching web page content via Ollama's hosted APIs, providing search results and raw page data.
      2
      42 PyPI
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables live web retrieval through MCP, allowing Claude to fetch and extract current web information with validations, SSRF protections, and structured results for grounded responses.
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables MCP clients and agents to run structured web searches and fetch web pages as Markdown through a search/fetch API, with rate limiting, retry/backoff, request deadlines, and private-address blocking for safer agent use.
      2
      81 npm
      MIT