ask-ollama — Claude Code MCP server: features and setup
Connect Claude Code to local Ollama models for another review of code or a plan. Useful when you want feedback from a model running on your machine.
claude mcp add --env OLLAMA_HOST=<OLLAMA_HOST> --env GMCPT_TIMEOUT_MS=<GMCPT_TIMEOUT_MS> --env GMCPT_LOG_LEVEL=<GMCPT_LOG_LEVEL> --transport stdio ask-ollama -- npx -y @ask-llm/ollama-mcpWhat ask-ollama does
The server connects Claude Code with Ollama models running locally. Ask one to inspect code changes or challenge a plan; you decide whether to make any suggested edits.
The setup uses OLLAMA_HOST, GMCPT_TIMEOUT_MS, and GMCPT_LOG_LEVEL. Add the server to Claude Code with claude mcp add. If Ollama cannot be reached at the configured host, the connection will fail. The server uses stdio transport.
What it helps with
- get another review of a code change
- check staged work before committing
- surface assumptions that could undermine a plan
Example prompts for the agent
- Ask a local Ollama model to inspect the changes in
src/auth.tsfor bugs. - Review this implementation plan against the project constraints and flag risky assumptions.
- Check my staged changes and point out anything I should verify.
How to install ask-ollama
Platform CLI
claude mcp add --env OLLAMA_HOST=<OLLAMA_HOST> --env GMCPT_TIMEOUT_MS=<GMCPT_TIMEOUT_MS> --env GMCPT_LOG_LEVEL=<GMCPT_LOG_LEVEL> --transport stdio ask-ollama -- npx -y @ask-llm/ollama-mcpReplace <…> with your own values
Platform CLI
codex mcp add ask-ollama --env OLLAMA_HOST=<OLLAMA_HOST> --env GMCPT_TIMEOUT_MS=<GMCPT_TIMEOUT_MS> --env GMCPT_LOG_LEVEL=<GMCPT_LOG_LEVEL> -- npx -y @ask-llm/ollama-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"ask-ollama": {
"command": "npx",
"args": [
"-y",
"@ask-llm/ollama-mcp"
],
"env": {
"OLLAMA_HOST": "<OLLAMA_HOST>",
"GMCPT_TIMEOUT_MS": "<GMCPT_TIMEOUT_MS>",
"GMCPT_LOG_LEVEL": "<GMCPT_LOG_LEVEL>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"ask-ollama": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@ask-llm/ollama-mcp"
],
"env": {
"OLLAMA_HOST": "<OLLAMA_HOST>",
"GMCPT_TIMEOUT_MS": "<GMCPT_TIMEOUT_MS>",
"GMCPT_LOG_LEVEL": "<GMCPT_LOG_LEVEL>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e OLLAMA_HOST=<OLLAMA_HOST> -e GMCPT_TIMEOUT_MS=<GMCPT_TIMEOUT_MS> -e GMCPT_LOG_LEVEL=<GMCPT_LOG_LEVEL> ask-ollama npx -y @ask-llm/ollama-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about ask-ollama
How do I install ask-ollama in Claude Code?
Run claude mcp add ask-ollama -- npx -y @ask-llm/ollama-mcp. Set OLLAMA_HOST, GMCPT_TIMEOUT_MS, and GMCPT_LOG_LEVEL in the Claude Code environment.
What does ask-ollama do?
It connects Claude Code to local Ollama models so you can request a separate review of code or a plan.
Which settings does the Ollama connection use?
Configure OLLAMA_HOST, GMCPT_TIMEOUT_MS, and GMCPT_LOG_LEVEL.