ollama-code-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_HOST | No | Bind host for sse/streamable-http transports. | 0.0.0.0 |
| MCP_PORT | No | Bind port for sse/streamable-http transports. | 8765 |
| OLLAMA_MODEL | No | Model tag to use, as shown by ollama list on the target host. | qwen3:32b |
| MCP_TRANSPORT | No | stdio (spawned locally by Claude Code), sse, or streamable-http (for remote/k8s deployment). | stdio |
| OLLAMA_NUM_CTX | No | Context window passed to Ollama's options.num_ctx. | 8192 |
| OLLAMA_TIMEOUT | No | Request timeout in seconds. Defaults to 15 minutes to allow large generations/refactors on modest hardware. | 900 |
| OLLAMA_BASE_URL | No | Where Ollama listens. LAN addresses and bare host:port (scheme added automatically) are supported. | http://localhost:11434 |
| OLLAMA_CONNECT_TIMEOUT | No | TCP connect timeout in seconds. | 10 |
| OLLAMA_MCP_ALLOWED_DIR | No | Base directory that file-aware tools are confined to. | server CWD |
| OLLAMA_MCP_DEFAULT_THINK | No | Default value for each tool's think parameter when the caller omits it. | true |
| OLLAMA_MCP_MAX_FILE_BYTES | No | Per-file size cap for server-side reads. | 1000000 |
| OLLAMA_MCP_MAX_BATCH_FILES | No | Max files processed per batch_refactor call. | 20 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| generate_codeA | Generate new code from a natural-language instruction using the local Ollama model. Pass |
| review_codeA | Review code for correctness bugs, security issues, and simplification opportunities. Provide exactly one of |
| refactor_codeA | Refactor code according to an instruction, preserving external behavior. Provide exactly one of |
| fix_codeA | Diagnose and fix a bug in code, given an optional error message or symptom. Provide exactly one of |
| write_testsA | Write tests covering the golden path and realistic edge cases for given code. Provide exactly one of |
| explain_codeA | Explain what code does, including control/data flow and non-obvious behavior. Provide exactly one of |
| code_review_diffA | Review a git diff (e.g. Provide exactly one of |
| batch_refactorA | Apply a refactor instruction to every file matching a glob pattern, sequentially.
|
| ollama_statusA | Check connectivity to the configured Ollama host and report available models. Call this first if other tools are failing, or proactively before a batch of delegated work, to confirm the local model is reachable and pulled before relying on it. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
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/darthzen/ollama-code-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server