An MCP server exposing Ollama's web search and web fetch capabilities as tools
Project description
MCP Search & Fetch
An MCP server exposing Ollama's web search and web fetch capabilities as tools.
Features
- web_search: Perform web searches using Ollama's hosted search API
- web_fetch: Fetch content from web pages
Requirements
- Ollama API key (get one from ollama.com)
Installation
# Clone the repository
git clone <repo-url>
cd mcp-search-and-fetch
# Install dependencies
pip install -r requirements.txt
# Copy environment sample
cp .env.sample .env
Edit .env with your Ollama API key:
OLLAMA_API_KEY=your_api_key_here
Usage
Local (stdio)
python mcp_search_and_fetch.py
HTTP Server
# Set port and host in .env
export MCP_SERVER_PORT=8000
export MCP_SERVER_HOST=0.0.0.0
python mcp_search_and_fetch.py
Docker
docker build -t mcp-search-fetch .
docker run -p 8000:8000 --env-file .env mcp-search-fetch
Configuration
| Environment Variable | Required | Default | Description |
|---|---|---|---|
OLLAMA_API_KEY |
Yes | - | Your Ollama API key |
MCP_SERVER_PORT |
No | - | Run HTTP server on specified port |
MCP_SERVER_HOST |
No | 127.0.0.1 | Host to bind to |
Tools
web_search(query, max_results=3)
Performs a web search and returns results as JSON.
web_fetch(url)
Fetches content from a URL and returns it as JSON.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file mcp_search_and_fetch-1.0.1.tar.gz.
File metadata
- Download URL: mcp_search_and_fetch-1.0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4c6f27e940bfa2d7c1b5e14790a01606f6a87a96162bc4e8d1e0fa2c95dee5e
|
|
| MD5 |
88084569c6fadae29ba0cdd9708d3e02
|
|
| BLAKE2b-256 |
2b260a09d61b0d608f777a1d3838b7f0c9b738eaee4e9e163ecffd90c15dad5e
|