ollama-mcp
Allows delegating coding tasks to local Ollama models, with tools for listing models, executing tasks, writing files, and previewing changes via tool calls or text markers.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ollama-mcpwrite a fibonacci function in Python using codellama"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ollama-mcp
MCP server for delegating coding tasks to local Ollama models.
Setup
cd ollama-mcp
npm install
npm run buildRelated MCP server: mcp-coding
Tools
ollama_list_models
List available Ollama models.
ollama_execute_task
Delegate a coding task to an Ollama model. Returns output with change preview.
If changes are detected,
requires_approval: trueis returnedReview changes, then use
ollama_write_filesto apply
ollama_write_files
Write files from Ollama output. Use after reviewing changes.
ollama_preview_changes
Analyze text for file write markers and show change preview.
Tool Calling
Models that support tool calling (e.g., qwen3-coder-next, deepseek-r1:8b) use structured JSON tool calls for file writes. This is more reliable than text markers.
The write_file tool is automatically provided to the model:
{
"type": "function",
"function": {
"name": "write_file",
"description": "Write content to a file at the given path",
"parameters": {
"type": "object",
"properties": {
"path": { "type": "string" },
"content": { "type": "string" }
},
"required": ["path", "content"]
}
}
}If the model doesn't support tool calling, the server falls back to {file_write} text markers automatically.
Usage
OpenCode
Add to opencode.json:
{
"mcp": {
"ollama": {
"type": "stdio",
"command": "node",
"args": ["./dist/index.js"]
}
}
}Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"ollama": {
"command": "node",
"args": ["/absolute/path/to/ollama-mcp/dist/index.js"]
}
}
}Workflow
1. ollama_execute_task(task, model) → output + changes[]
- Tool calling models: structured tool_calls
- Non-tool models: text markers (fallback)
2. Review changes
3. ollama_write_files(output or tool_calls) → files writtenEnvironment Variables
Variable | Default | Description |
OLLAMA_HOST | Ollama server address | |
OLLAMA_TIMEOUT_MS | 120000 | Request timeout in ms |
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceA universal MCP server that integrates with local Ollama instances, enabling AI-powered chat, model management, and text generation from any MCP-compatible IDE or application.62263MIT
- AlicenseNot gradedqualityCmaintenanceExperimental MCP server for local LLM orchestration with filesystem tools (read, write, list, delete files) and a CLI agent that communicates via Ollama.9ISC
- AlicenseAqualityBmaintenanceAn MCP server that lets Claude Code delegate coding tasks such as code generation, review, refactoring, and test writing to a local Ollama instance running a Qwen3 model.9MIT
- AlicenseAqualityBmaintenanceAn MCP server that provides local, private, synchronous access to Ollama models for prompt answering, text classification, and model listing, without any file access or command execution.3MIT
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP Server for Slima - AI Writing IDE for Novel Authors with AI Beta Reader.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/shenmali/ollama-mcp-subagent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server