关于
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