Content
# Ollama MCP Client
A Python-based client implementation for connecting Ollama large language models and MCP (Model Context Protocol) servers, enabling seamless interaction between models and external tools.
## Features
- Integrated Ollama large language model (defaults to qwen3:14b)
- Supports SSE (Server-Sent Events) asynchronous communication
- Extensible tool calling system
- Interactive command-line interface
- Simple tool format conversion (Spring AI's tools_list format ⟷ Ollama format)
## Quick Start
### Environment Requirements
- Python 3.12+
- Ollama CLI (refer to [Ollama official website](https://ollama.com/) for installation instructions)
- java 21+
### Installation
```bash
git clone https://github.com/Shlysz/ollama-mcp.git
cd Ollama-mcp-client
pip install -r requirements.txt
```
### Configuration
1. Configure my MCP server in `client/mcp_server_config.json`. My mcp server is released in the release, with the following format:
```json
{
"mcpServers": {
"server-name": {
"url": "http://localhost:8080/sse"
}
}
}
```
If you have your own mcp-server, you can also configure your own server address.
2. Configure the Ollama model in `client/Constants.py`:
```python
LLAMA_MODEL_QWEN = "qwen3:14b" # Or other Ollama-supported models
```
### Run
```bash
python client/main.py
```
## Project Structure
```
Ollama-MCP-Client
├── client
│ ├── Constants.py
│ ├── McpClient.py
│ ├── OllamaAgent.py
│ ├── OllamaTools.py
│ ├── __init__.py
│ ├── main.py
│ ├── mcp_server_config.json
│ └── utils
│ ├── JsonUtil.py
├── requirements.txt
└── test
├── __init__.py
└── test_ollamaToolsformat.py
```
## Acknowledgements
This project was inspired by [mihirrd/ollama-mcp-client](https://github.com/mihirrd/ollama-mcp-client). Their project only supports local and does not support sse, while mine is the opposite. Thank you for that.
## License
`MIT License`
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.