Query model running with Ollama from within Claude Desktop or other MCP clients
1.4K
Add this to your MCP server configuration:
{
"mcpServers": {
"ollama": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e", "OLLAMA_HOST=http://OLLAMA-IP:PORT",
"wuodan/mcp-ollama:latest"
]
}
}
}
Use the container name of your Ollama service as hostname (e.g., ollama)
so both containers communicate over Docker’s internal network:
{
"mcpServers": {
"ollama": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--network", "ollama-net",
"-e", "OLLAMA_HOST=http://ollama:11434",
"wuodan/mcp-ollama:latest"
]
}
}
}
Make sure both containers share the same Docker network:
docker network create ollama-net
docker run -d --network ollama-net --name ollama ollama/ollama
This configuration works on Linux, Windows, macOS, and WSL2 — no changes needed:
{
"mcpServers": {
"ollama": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--add-host=host.docker.internal:host-gateway",
"-e", "OLLAMA_HOST=http://host.docker.internal:11434",
"wuodan/mcp-ollama:latest"
]
}
}
}
Content type
Image
Digest
sha256:495d77ee8…
Size
29.4 MB
Last updated
12 months ago
docker pull wuodan/mcp-ollama