Ollama MCP Client
- other
About
What is Ollama MCP Client?
Ollama MCP Client is a Model Context Protocol (MCP) client that works with language models served through Ollama. It provides a natural language interface for database operations by integrating with the Database MCP Server.
How to use Ollama MCP Client?
Install via pip install -e . after cloning the repository. Run mcp-ollama with command-line flags for model, server, and Ollama API URL, or use a config.json file in your home directory. Example: mcp-ollama --model llama3 --server http://localhost:8000 "List all tables in my database".
Key features of Ollama MCP Client
- Supports multiple Ollama models (Qwen, Llama 3, Mistral, Gemini)
- Real-time streaming of LLM responses
- Seamless integration with the Database MCP Server
- Natural language interface for database queries
- Configurable via command line or configuration file
Use cases of Ollama MCP Client
- List all tables in a database using natural language
- Query data, e.g., "Show me all users who registered in the last month"
- Create new tables with columns, e.g., "Create a products table"
- Interact with databases without writing SQL
FAQ from Ollama MCP Client
What models does Ollama MCP Client support?
It supports Qwen, Llama 3, Mistral, and Gemini models served via Ollama.
Can I specify a different Ollama server?
Yes, use the --ollama-api argument to set a custom Ollama API URL. The default is http://localhost:11434.
Is streaming supported?
Yes, streaming responses are enabled by default. You can disable them with the --stream flag.
How do I configure Ollama MCP Client?
You can use command-line arguments (--model, --server, --ollama-api, --stream) or create a config.json file in your home directory.
What license does Ollama MCP Client use?
It is licensed under MIT.
Details
- Author
- georgi-terziyski
- GitHub stars
- 3
- Category
- other
- Repository
- georgi-terziyski/mcp_client_ollama
Ollama MCP Client
A Model Context Protocol (MCP) client for language models served through Ollama.
Features
- Multiple Model Support: Works with Qwen, Llama 3, Mistral, and Gemini models served via Ollama
- Streaming Responses: Real-time streaming of LLM responses
- Database Operations: Seamless integration with the Database MCP Server
- Natural Language Interface: Interact with databases using natural language
Installation
# Clone the repository
git clone <repository-url>
Install the package
pip install -e .
Quick Start
# Basic usage
mcp-ollama --model llama3 --server http://localhost:8000 "List all tables in my database"
Specify a different Ollama server
mcp-ollama --model qwen --ollama-api http://localhost:11434 --server http://localhost:8000 "Show me the schema for the users table"
Configuration
The client can be configured using command line arguments or a configuration file:
Command Line Arguments
- --model: The Ollama model to use (e.g., llama3, qwen, mistral, gemini)
- --server: URL of the Database MCP server
- --ollama-api: URL of the Ollama API server (default: http://localhost:11434)
- --stream: Enable/disable streaming responses (default: true)
- --config: Path to configuration file
Configuration File
Create a config.json file in your home directory:
{
"model": "llama3",
"server": "http://localhost:8000",
"ollama_api": "http://localhost:11434",
"stream": true
}
Example Usage
Natural Language Database Queries
# List tables
mcp-ollama "What tables do I have in my database?"
Query data
mcp-ollama "Show me all users who registered in the last month"
Create a table
mcp-ollama "Create a new table called products with columns for id, name, price, and description"
License
MIT