prncher/Ollama-MCP-Streamable-http-Server
If you are the rightful owner of Ollama-MCP-Streamable-http-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Ollama-MCP-Streamable-http-Server is a model context protocol server that utilizes browser scraping with Selenium and supports streamable HTTP connections.
🧠 MCP Streamable HTTP Client & Server with Ollama and Selenium
This project demonstrates how to build a Model Context Protocol (MCP) system using:
- 🧰 MCP Server for tool execution
- 🌐 Streamable HTTP MCP Client (Python)
- 🦙 Ollama running
qwen2.5-coder:7bfor reasoning - 🖥️ Selenium for browser automation
The architecture enables natural language instructions like:
“Go to MDN and print HTML DOM API page content.”
The MCP Client uses Ollama to generate a structured plan of actions and parameters.
The MCP Server executes the plan in a live Selenium browser and streams results back in real time.
🧰 Getting Started
1. Install Ollama
Download and install Ollama 0.12.3 from the official site:
👉 https://ollama.com/download/windows
2. Pull the Model
After installing Ollama, pull the required model:
ollama pull qwen3-coder:30b
💡 You can also use
qwen2.5-coder:7bfor a faster, lightweight setup.
3. Install Python Dependencies
Install uv (a fast Python package installer):
pip install uv
4. Create and Activate a Virtual Environment
🪟 Windows
uv venv
.venv\Scripts\activate
🍎 macOS / 🐧 Linux
uv venv
source .venv/bin/activate
5. Install the Project in Editable Mode
This installs dependencies and links the local project for development:
uv pip install -e .
📝 VS Code Tip: You may need to manually select the
.venvPython interpreter to resolve imports.
6. Run the MCP Server
Start the MCP server to handle tool execution:
uv run src\server.py
7. Run the MCP Client
In a separate terminal, run the MCP Client with a natural language instruction:
uv run src\client.py "Goto MDN and print HTML DOM API page content"
The client will:
- Send the prompt to Ollama
- Receive the action plan
- Forward it to the MCP server
- Stream the results back in real time
🧭 Key Features
- First-of-its-kind Streamable HTTP MCP Client in Python
- Real-time streaming of execution logs and results
- Clean separation of reasoning (LLM) and execution (MCP Server)
- Extensible toolbox of browser actions (launch, click, scroll, extract, etc.)
🏗️ Architecture
User → MCP Client → Ollama → MCP Client → MCP Server → Selenium
↑ ↓
Streamed responses ←───
📌 See the full article in for a deep dive.
📝 Tools Implemented
- Launch Browser
- Click Element / Selector
- Type Text
- Scroll Page
- Get Page Content
- Get DOM Structure
- Take Screenshot
- Extract Data
- Close Browser
🚀 Example
Prompt: "Go to MDN and print HTML DOM API page content"
The client generates a plan via Ollama, sends it to the server, and streams back the full DOM contents in real time.
📂 Repositories
🧪 Future Work
- Testing with larger models (
qwen2.5-coder:30b) to improve selector accuracy - Adding persistent event storage for replay and durability
- Expanding the toolbox with more advanced browser actions
📄 License
MIT License © 2025