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 | |
TDQS
Scored across 9 tools
Each tool has a clearly distinct purpose: code generation, explanation, review, debugging, refactoring (single and batch), test writing, diff review, and status check. No two tools overlap in functionality.
All tools follow a consistent verb_noun snake_case pattern (e.g., explain_code, fix_code, batch_refactor). No mixed conventions or vague names.
9 tools is a well-scoped set for a code assistance server. It covers the essential operations without being overwhelming or too sparse.
The set covers generation, explanation, review, debugging, refactoring, test writing, and status checking. Minor gaps like code documentation or execution are absent, but the core workflow is well-supported.