{"id":5313,"library":"mcp-server-fetch","title":"MCP Server Fetch","description":"MCP Server Fetch is a Python library that provides a server implementation for the Model Context Protocol (MCP). It's designed to fetch, process, and convert web content into a format suitable for use by Large Language Models (LLMs). As of version `2025.4.7`, it offers a robust solution for web data ingestion within an LLM ecosystem. The project follows a rapid, approximately monthly, release cadence, often aligning with a YYYY.M.D versioning scheme.","status":"active","version":"2025.4.7","language":"en","source_language":"en","source_url":"https://github.com/mcp-org/mcp-server-fetch","tags":["LLM","AI","web-scraping","web-content","protocol","server","fastapi"],"install":[{"cmd":"pip install mcp-server-fetch","lang":"bash","label":"Install core library"},{"cmd":"pip install 'mcp-server-fetch[all]'","lang":"bash","label":"Install with all optional dependencies"}],"dependencies":[{"reason":"Required Python version for execution.","package":"python","version_spec":">=3.10"},{"reason":"Required to run the MCP Server Fetch application as an ASGI server.","package":"uvicorn","optional":false}],"imports":[{"note":"MCPClient is part of the separate `mcp-client` library, which is used to interact with a running `mcp-server-fetch` instance. The `mcp-server-fetch` library itself primarily provides the server application, accessible via `create_app` for programmatic setup.","wrong":"from mcp_server_fetch import MCPClient","symbol":"create_app","correct":"from mcp_server_fetch.server import create_app"}],"quickstart":{"code":"import uvicorn\nfrom mcp_server_fetch.server import create_app\nimport os\nimport asyncio\n\n# Configure necessary environment variables, e.g., for CORS or debug mode\nos.environ['CORS_ORIGINS'] = 'http://localhost:3000,http://127.0.0.1:3000'\nos.environ['MCP_DEBUG'] = 'true'\n\n# Create the FastAPI application instance\napp = create_app()\n\nasync def run_server():\n    print(\"Starting MCP Server Fetch on http://127.0.0.1:8000\")\n    print(\"Use Ctrl+C to stop the server.\")\n    config = uvicorn.Config(app, host=\"127.0.0.1\", port=8000, log_level=\"info\")\n    server = uvicorn.Server(config)\n    await server.serve()\n\nif __name__ == \"__main__\":\n    # This demonstrates programmatic startup. More commonly, you'd run from CLI:\n    # uvicorn mcp_server_fetch.server:app --host 127.0.0.1 --port 8000\n    try:\n        asyncio.run(run_server())\n    except KeyboardInterrupt:\n        print(\"\\nServer stopped.\")\n","lang":"python","description":"This quickstart demonstrates how to programmatically start the MCP Server Fetch application using `uvicorn`. It first configures essential environment variables (like CORS) which are critical for its operation, then creates the FastAPI app instance, and finally runs it using `uvicorn.run`. For interaction with the running server, install and use the separate `mcp-client` library."},"warnings":[{"fix":"For client-side operations, `pip install mcp-client` and import from `mcp_client`.","message":"It is crucial to understand that `mcp-server-fetch` provides the server application itself, while programmatic interaction with a running server (e.g., fetching URLs) requires the separate `mcp-client` library. Do not attempt to import client-side utilities like `MCPClient` from `mcp-server-fetch`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the official documentation for a comprehensive list of environment variables and set them appropriately before starting the server. Examples include `CORS_ORIGINS`, `MCP_DEBUG`, etc.","message":"The server's behavior and accessibility (e.g., CORS, debug settings, API keys) are heavily reliant on environment variables. Failing to set these correctly can lead to unexpected errors or security vulnerabilities.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Pin your dependency to a specific `YYYY.M.patch` version (e.g., `mcp-server-fetch==2025.4.7`) and thoroughly test when upgrading across month boundaries.","message":"Due to its rapid development cycle (monthly releases) and its position within an evolving protocol ecosystem, API stability between major monthly versions (e.g., from `2025.3.x` to `2025.4.x`) may not be strictly guaranteed. Breaking changes, while not always explicitly detailed in changelogs, can occur.","severity":"breaking","affected_versions":"All versions (specifically between `YYYY.M` increments)"},{"fix":"Ensure `uvicorn` is installed in your environment, either directly (`pip install uvicorn`) or by using the `[all]` extra during `mcp-server-fetch` installation (`pip install 'mcp-server-fetch[all]'`).","message":"Running the server programmatically as shown in the quickstart requires `uvicorn` to be installed. While `mcp-server-fetch` lists `uvicorn` as an optional dependency (via `[all]` extra), it's a runtime necessity for most deployments.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}