This MCP server enables direct integration between Ollama (for local LLM access) and MCP-compatible applications like Claude Desktop and Cline, giving AI assistants the ability to use local language models through a simple protocol.
Add the following to your Claude Desktop configuration file (located at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"ollama": {
"command": "npx",
"args": ["-y", "ollama-mcp"]
}
}
}
You can install the package globally using npm:
npm install -g ollama-mcp
Add this to your Cline MCP settings file (cline_mcp_settings.json):
{
"mcpServers": {
"ollama": {
"command": "npx",
"args": ["-y", "ollama-mcp"]
}
}
}
| Tool | Description |
|---|---|
ollama_list |
List all available local models |
ollama_show |
Get detailed information about a specific model |
ollama_pull |
Download models from Ollama library |
ollama_push |
Push models to Ollama library |
ollama_copy |
Create a copy of an existing model |
ollama_delete |
Remove models from local storage |
ollama_create |
Create custom models from Modelfile |
| Tool | Description |
|---|---|
ollama_ps |
List currently running models |
ollama_generate |
Generate text completions |
ollama_chat |
Interactive chat with models (supports tools/functions) |
ollama_embed |
Generate embeddings for text |
| Tool | Description |
|---|---|
ollama_web_search |
Search the web with customizable result limits (requires API key) |
ollama_web_fetch |
Fetch and parse web page content (requires API key) |
| Variable | Default | Description |
|---|---|---|
OLLAMA_HOST |
http://127.0.0.1:11434 |
Ollama server endpoint |
OLLAMA_API_KEY |
- | API key for Ollama Cloud features |
To specify a custom Ollama host:
{
"mcpServers": {
"ollama": {
"command": "npx",
"args": ["-y", "ollama-mcp"],
"env": {
"OLLAMA_HOST": "http://localhost:11434"
}
}
}
}
To use Ollama's cloud platform with web search capabilities:
{
"mcpServers": {
"ollama": {
"command": "npx",
"args": ["-y", "ollama-mcp"],
"env": {
"OLLAMA_HOST": "https://ollama.com",
"OLLAMA_API_KEY": "your-ollama-cloud-api-key"
}
}
}
}
You can use both local and cloud models with this configuration:
{
"mcpServers": {
"ollama": {
"command": "npx",
"args": ["-y", "ollama-mcp"],
"env": {
"OLLAMA_HOST": "http://127.0.0.1:11434",
"OLLAMA_API_KEY": "your-ollama-cloud-api-key"
}
}
}
}
This enables:
// MCP clients can invoke:
{
"tool": "ollama_chat",
"arguments": {
"model": "llama3.2:latest",
"messages": [
{ "role": "user", "content": "Explain quantum computing" }
]
}
}
{
"tool": "ollama_embed",
"arguments": {
"model": "nomic-embed-text",
"input": ["Hello world", "Embeddings are great"]
}
}
{
"tool": "ollama_web_search",
"arguments": {
"query": "latest AI developments",
"max_results": 5
}
}
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "rawveg-ollama-mcp" '{"command":"npx","args":["-y","@rawveg/ollama-mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"@rawveg/ollama-mcp": {
"command": "npx",
"args": [
"-y",
"@rawveg/ollama-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"@rawveg/ollama-mcp": {
"command": "npx",
"args": [
"-y",
"@rawveg/ollama-mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect