{"_id":"@agent-tools-kiko/ollama-mcp","_rev":"3-7be5f881404c8eaad246769f1f91bbc4","name":"@agent-tools-kiko/ollama-mcp","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@agent-tools-kiko/ollama-mcp","version":"1.0.0","keywords":["mcp","ollama","llm","local-ai","claude","ai-agent","model-context-protocol","llama","mistral"],"author":{"name":"Enrico Buffara"},"license":"MIT","_id":"@agent-tools-kiko/ollama-mcp@1.0.0","maintainers":[{"name":"kikobuf","email":"enricobuffara@icloud.com"}],"homepage":"https://github.com/Kikobuf/agent-tools/tree/main/packages/ollama-mcp","bugs":{"url":"https://github.com/Kikobuf/agent-tools/issues"},"bin":{"ollama-mcp":"dist/index.js"},"dist":{"shasum":"6d062aff811fafee7d3fd870c9e05790b9ada9d5","tarball":"https://registry.npmjs.org/@agent-tools-kiko/ollama-mcp/-/ollama-mcp-1.0.0.tgz","fileCount":3,"integrity":"sha512-g4TvHX0AHvC4407Tg+TES/IYwSQAUz73xE1uhBxbRC6FWUE+E7khp09A8dVXUeNsmEWSTCNOaPxxb7UlXCjdWA==","signatures":[{"sig":"MEUCIDpmQEDUKe/xprBZVJslQu5sz4iOztUX0xSAGekv6iBTAiEA8J/6QHYBtD6VeFSP79tNu2pP/WBEqz4nljWAvJuZNlQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25647},"main":"dist/index.js","engines":{"node":">=18"},"gitHead":"125c6b6493166443a79a3f5dcf3534cddc26465b","scripts":{"dev":"tsc --watch","build":"tsc && chmod +x dist/index.js","start":"node dist/index.js","start:http":"MCP_TRANSPORT=http node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"kikobuf","email":"enricobuffara@icloud.com"},"repository":{"url":"git+https://github.com/Kikobuf/agent-tools.git","type":"git","directory":"packages/ollama-mcp"},"_npmVersion":"11.9.0","description":"MCP server for Ollama — run local models in Claude Desktop and Claude Code. Optional Claude API fallback for agent contexts.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"zod":"^3.22.0","axios":"^1.6.0","@modelcontextprotocol/sdk":">=1.10.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ollama-mcp_1.0.0_1781048897807_0.514360540853467","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@agent-tools-kiko/ollama-mcp","version":"1.0.1","keywords":["mcp","ollama","llm","local-ai","claude","ai-agent","model-context-protocol","llama","mistral"],"author":{"name":"Enrico Buffara"},"license":"MIT","_id":"@agent-tools-kiko/ollama-mcp@1.0.1","maintainers":[{"name":"kikobuf","email":"enricobuffara@icloud.com"}],"homepage":"https://github.com/Kikobuf/agent-tools/tree/main/packages/ollama-mcp","bugs":{"url":"https://github.com/Kikobuf/agent-tools/issues"},"bin":{"ollama-mcp":"dist/index.js"},"dist":{"shasum":"d0c050f27e9df0c3ecde5e22ff100166201605a2","tarball":"https://registry.npmjs.org/@agent-tools-kiko/ollama-mcp/-/ollama-mcp-1.0.1.tgz","fileCount":3,"integrity":"sha512-vLDv60326JyjlJ4LH3LMoiL8ZNUpRdnLmF0mugPBcImSOmYyU8cr8XphsjS4BImtaAvSUNL6nNRDv5bmssWA2w==","signatures":[{"sig":"MEUCIEtpk6EFB7LPk6AGD4yxkoxZ5/8dmG1o+r0hSpOPQJ13AiEAh7vZhZiVEBkNfinT/AvQYA+J5tr2UThk/9XmLkzs50Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19730},"main":"dist/index.js","engines":{"node":">=18"},"gitHead":"7c2f23746578a4635bc342f180f2b86cc69c6125","scripts":{"dev":"tsc --watch","build":"tsc && chmod +x dist/index.js","start":"node dist/index.js","start:http":"MCP_TRANSPORT=http node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"kikobuf","email":"enricobuffara@icloud.com"},"repository":{"url":"git+https://github.com/Kikobuf/agent-tools.git","type":"git","directory":"packages/ollama-mcp"},"_npmVersion":"11.9.0","description":"MCP server for Ollama — run local models in Claude Desktop and Claude Code. Optional Claude API fallback for agent contexts.","directories":{},"_nodeVersion":"24.14.0","dependencies":{"zod":"^3.22.0","axios":"^1.6.0","@modelcontextprotocol/sdk":">=1.10.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ollama-mcp_1.0.1_1781055003053_0.18274143652941377","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@agent-tools-kiko/ollama-mcp","version":"1.0.2","description":"MCP server for Ollama — run local models in Claude Desktop and Claude Code. Optional Claude API fallback for agent contexts.","main":"dist/index.js","bin":{"ollama-mcp":"dist/index.js"},"scripts":{"build":"tsc","dev":"tsc --watch","start":"node dist/index.js","start:http":"MCP_TRANSPORT=http node dist/index.js","prepublishOnly":"npm run build"},"keywords":["mcp","ollama","llm","local-ai","claude","ai-agent","model-context-protocol","llama","mistral"],"author":{"name":"Enrico Buffara"},"license":"MIT","homepage":"https://github.com/Kikobuf/agent-tools/tree/main/packages/ollama-mcp","repository":{"type":"git","url":"git+https://github.com/Kikobuf/agent-tools.git","directory":"packages/ollama-mcp"},"engines":{"node":">=18"},"dependencies":{"@modelcontextprotocol/sdk":"^1.29.0","axios":"^1.6.0"},"devDependencies":{"@types/node":"^20.0.0","typescript":"^5.0.0"},"gitHead":"7c2f23746578a4635bc342f180f2b86cc69c6125","_id":"@agent-tools-kiko/ollama-mcp@1.0.2","bugs":{"url":"https://github.com/Kikobuf/agent-tools/issues"},"_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-1SheIYyYBiETNtjLiShJGEpRWWz9ybY2fxIkxmws4abYils7lKk3cntSsQsrYxhurXSAdDsSxPFF70ivzvvtsw==","shasum":"499e71740a2b694485a0d3f14b61da04b2e82c88","tarball":"https://registry.npmjs.org/@agent-tools-kiko/ollama-mcp/-/ollama-mcp-1.0.2.tgz","fileCount":3,"unpackedSize":20587,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAfHy08GrCuV27bWRc9V9ff9igKrT/VBEYD1SdIdqIZFAiBgbSq7bp5PxcEfdO6tYt/uKtRS9gMe9NoLAeu6ylx+pw=="}]},"_npmUser":{"name":"kikobuf","email":"enricobuffara@icloud.com"},"directories":{},"maintainers":[{"name":"kikobuf","email":"enricobuffara@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ollama-mcp_1.0.2_1781117368686_0.20654362111817304"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-09T23:48:17.709Z","modified":"2026-06-10T18:49:28.961Z","1.0.0":"2026-06-09T23:48:17.927Z","1.0.1":"2026-06-10T01:30:03.197Z","1.0.2":"2026-06-10T18:49:28.830Z"},"bugs":{"url":"https://github.com/Kikobuf/agent-tools/issues"},"author":{"name":"Enrico Buffara"},"license":"MIT","homepage":"https://github.com/Kikobuf/agent-tools/tree/main/packages/ollama-mcp","keywords":["mcp","ollama","llm","local-ai","claude","ai-agent","model-context-protocol","llama","mistral"],"repository":{"type":"git","url":"git+https://github.com/Kikobuf/agent-tools.git","directory":"packages/ollama-mcp"},"description":"MCP server for Ollama — run local models in Claude Desktop and Claude Code. Optional Claude API fallback for agent contexts.","maintainers":[{"name":"kikobuf","email":"enricobuffara@icloud.com"}],"readme":"# @agent-tools/ollama-mcp\n\n**Local-first inference with zero-config Claude fallback.**\n\nRun `llama3.2` locally for free. When Claude usage limits hit — or Ollama goes down — every request automatically reroutes to `claude-sonnet-4-6`. No manual switching. No broken agent workflows.\n\n---\n\n## The problem this solves\n\nYou're running Claude Code heavily and hit the usage limit mid-workflow. Everything stops. You either wait, or manually swap every prompt to a different provider.\n\n`ollama-mcp` solves this by making your local Ollama instance the **primary** and Claude the **automatic fallback**. One config, both providers, zero interruption.\n\n---\n\n## Install\n\n### Claude Code\n\n```bash\nclaude mcp add ollama-mcp \\\n  -e ANTHROPIC_API_KEY=your-key \\\n  -e OLLAMA_DEFAULT_MODEL=llama3.2 \\\n  -- npx @agent-tools/ollama-mcp\n```\n\n### Claude Desktop\n\n```json\n{\n  \"mcpServers\": {\n    \"ollama\": {\n      \"command\": \"npx\",\n      \"args\": [\"@agent-tools/ollama-mcp\"],\n      \"env\": {\n        \"OLLAMA_BASE_URL\": \"http://localhost:11434\",\n        \"ANTHROPIC_API_KEY\": \"your-anthropic-key\",\n        \"OLLAMA_DEFAULT_MODEL\": \"llama3.2\",\n        \"OLLAMA_FALLBACK_MODEL\": \"claude-sonnet-4-6\"\n      }\n    }\n  }\n}\n```\n\n---\n\n## Tools\n\n| Tool | Description |\n|---|---|\n| `ollama_chat` | Chat with a local model (auto-falls back to Claude) |\n| `ollama_generate` | Raw completion prompt |\n| `ollama_list_models` | All installed models with sizes |\n| `ollama_pull_model` | Download a model from Ollama registry |\n| `ollama_delete_model` | Remove a model to free disk space |\n| `ollama_health` | Check Ollama status + fallback config |\n| `ollama_set_fallback` | Manually enable/disable Claude fallback mode |\n| `ollama_list_routes` | Show named model routes |\n\n---\n\n## Named model routes\n\nMap shorthand names to specific models in your env:\n\n```json\n{\n  \"env\": {\n    \"OLLAMA_ROUTE_FAST\": \"llama3.2:3b\",\n    \"OLLAMA_ROUTE_CODE\": \"deepseek-coder:6.7b\",\n    \"OLLAMA_ROUTE_SMART\": \"llama3.1:70b\"\n  }\n}\n```\n\nThen ask: *\"Use the 'code' model to review this function\"* — Claude routes to `deepseek-coder:6.7b` automatically.\n\n---\n\n## Fallback behavior\n\nRequests automatically route to Claude when:\n\n1. **Ollama is unreachable** (not running, wrong port, network issue)\n2. **Model not installed** locally (404 from Ollama)\n3. **Fallback manually enabled** via `ollama_set_fallback` tool\n4. **`force_fallback: true`** passed in the chat request\n\nThe response always includes a header showing which provider answered:\n\n```\n[Responded via local model: llama3.2]\n...\n\n[Responded via Claude fallback: claude-sonnet-4-6]\n...\n```\n\n---\n\n## Usage limit workflow\n\nWhen you hit Claude usage limits:\n\n```\n\"Enable fallback mode — I've hit my Claude usage limit\"\n```\n\n→ `ollama_set_fallback(enabled: true)` — all subsequent requests go to your local Ollama models until you disable it.\n\nWhen limits reset:\n```\n\"Disable fallback mode, my Claude limits reset\"\n```\n\n→ Back to local models as primary.\n\n---\n\n## Environment variables\n\n| Variable | Default | Description |\n|---|---|---|\n| `OLLAMA_BASE_URL` | `http://localhost:11434` | Ollama server URL |\n| `OLLAMA_DEFAULT_MODEL` | `llama3.2` | Default local model |\n| `OLLAMA_FALLBACK_MODEL` | `claude-sonnet-4-6` | Claude model for fallback |\n| `ANTHROPIC_API_KEY` | — | Required for Claude fallback |\n| `OLLAMA_ROUTE_<NAME>` | — | Named route mappings |\n\n---\n\n## Requirements\n\n- Node.js 18+\n- [Ollama](https://ollama.ai) running locally\n- Anthropic API key (for fallback — optional but recommended)\n\n---\n\n## License\n\nMIT\n","readmeFilename":"README.md"}