{"_id":"ollama-mcp","_rev":"5-ee00deee98676b5f21594ef26f8223dc","name":"ollama-mcp","dist-tags":{"latest":"2.1.0"},"versions":{"2.0.0":{"name":"ollama-mcp","version":"2.0.0","keywords":["mcp","ollama","ai","llm"],"author":{"name":"Tim Green","email":"rawveg@gmail.com"},"license":"AGPL-3.0","_id":"ollama-mcp@2.0.0","maintainers":[{"name":"rawveg","email":"rawveg@gmail.com"}],"homepage":"https://github.com/rawveg/ollama-mcp#readme","bugs":{"url":"https://github.com/rawveg/ollama-mcp/issues"},"bin":{"ollama-mcp":"dist/index.js"},"dist":{"shasum":"70040ac88749aae6359d64dc4918c6c0b627c28f","tarball":"https://registry.npmjs.org/ollama-mcp/-/ollama-mcp-2.0.0.tgz","fileCount":79,"integrity":"sha512-GFy7iGMjxEHMDDLT8psF3x+fVKRl2R/ZLztBIdU7/pFYlsFH8AwSuS0voYmhwuYL19g3o0XQMDczifJQdpU0fQ==","signatures":[{"sig":"MEUCIQCTwSwb/UVN8jtwFkdL4g+1SV8NXwgeQXK43ZKjfQs8RAIgf4xrbtGTxM0Eg6fuGp83ghAjPAqGmElD5ZK0fB509RY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":147268},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"d54e6a65d34541fbefb334a2da38ed9552654723","scripts":{"dev":"node dist/index.js","test":"vitest","build":"tsc","prepare":"npm run build","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"rawveg","email":"rawveg@gmail.com"},"repository":{"url":"git+https://github.com/rawveg/ollama-mcp.git","type":"git"},"_npmVersion":"10.9.2","description":"MCP server for Ollama - exposes all Ollama SDK functionality through MCP tools","directories":{},"_nodeVersion":"23.11.0","dependencies":{"zod":"^3.24.1","ollama":"^0.5.11","json2md":"^2.0.3","markdown-table":"^3.0.4","@modelcontextprotocol/sdk":"^1.0.4"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.9","typescript":"^5.7.3","@types/node":"^22.10.5","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/ollama-mcp_2.0.0_1761982893105_0.8871131145774367","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"name":"ollama-mcp","version":"2.0.1","keywords":["mcp","ollama","ai","llm"],"author":{"name":"Tim Green","email":"rawveg@gmail.com"},"license":"AGPL-3.0","_id":"ollama-mcp@2.0.1","maintainers":[{"name":"rawveg","email":"rawveg@gmail.com"}],"homepage":"https://github.com/rawveg/ollama-mcp#readme","bugs":{"url":"https://github.com/rawveg/ollama-mcp/issues"},"bin":{"ollama-mcp":"dist/index.js"},"dist":{"shasum":"7a2e0d1a55ce5e758f7f50031f466a7c200d9676","tarball":"https://registry.npmjs.org/ollama-mcp/-/ollama-mcp-2.0.1.tgz","fileCount":79,"integrity":"sha512-Wazn6eo6LX/FRLAN/+opCH23OpdyQurBzmjc8rhGiHOkWUFBDMHRp1FiXmKCk+a7OEpY8lgkgwKKYMaCBC6NJg==","signatures":[{"sig":"MEUCIQCL9Ty1YZiWw+YV0fzmjn2XKp67Zc/RMPsLZItqdJAWjwIgDyL1+ivNB2MBBWrOOzQr/LhDt4BIGjGQeCS1D36u0ms=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":147448},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"b2a733092ffdde14f93dc9caf0cf082360d3e591","scripts":{"dev":"node dist/index.js","test":"vitest run","build":"tsc","prepare":"npm run build","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"rawveg","email":"rawveg@gmail.com"},"repository":{"url":"git+https://github.com/rawveg/ollama-mcp.git","type":"git"},"_npmVersion":"10.9.2","description":"MCP server for Ollama - exposes all Ollama SDK functionality through MCP tools","directories":{},"_nodeVersion":"23.11.0","dependencies":{"zod":"^3.24.1","ollama":"^0.5.11","json2md":"^2.0.3","markdown-table":"^3.0.4","@modelcontextprotocol/sdk":"^1.0.4"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.9","typescript":"^5.7.3","@types/node":"^22.10.5","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/ollama-mcp_2.0.1_1761985387053_0.052067201655383366","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"ollama-mcp","version":"2.0.2","keywords":["mcp","ollama","ai","llm"],"author":{"name":"Tim Green","email":"rawveg@gmail.com"},"license":"AGPL-3.0","_id":"ollama-mcp@2.0.2","maintainers":[{"name":"rawveg","email":"rawveg@gmail.com"}],"homepage":"https://github.com/rawveg/ollama-mcp#readme","bugs":{"url":"https://github.com/rawveg/ollama-mcp/issues"},"bin":{"ollama-mcp":"dist/index.js"},"dist":{"shasum":"2a3d9f431198f8d230d52f2c7af7a32bcbe9140b","tarball":"https://registry.npmjs.org/ollama-mcp/-/ollama-mcp-2.0.2.tgz","fileCount":79,"integrity":"sha512-6DIatD5UsFFDNkjT+7kgkJ0TaCnUZtxOxb+Ul2K3ZU61zLZKn3PoUXXM7Zj9up5y3Nn6xogPRK9MhGxL/i9tzg==","signatures":[{"sig":"MEQCIA8A90T07VwBguA6ssgdbQZRNj6mPYu28BjxAcN7BNtnAiAZq02B/ElhTlpYdKGnLdo89tmXHw7CnP+QtypL4TqdaA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":147788},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"a8862dbe412eb5aee0cde691478a10eb810c20f8","scripts":{"dev":"node dist/index.js","test":"vitest run","build":"tsc","prepare":"npm run build","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"rawveg","email":"rawveg@gmail.com"},"repository":{"url":"git+https://github.com/rawveg/ollama-mcp.git","type":"git"},"_npmVersion":"10.9.2","description":"MCP server for Ollama - exposes all Ollama SDK functionality through MCP tools","directories":{},"_nodeVersion":"23.11.0","dependencies":{"zod":"^3.24.1","ollama":"^0.5.11","json2md":"^2.0.3","markdown-table":"^3.0.4","@modelcontextprotocol/sdk":"^1.0.4"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.9","typescript":"^5.7.3","@types/node":"^22.10.5","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/ollama-mcp_2.0.2_1761986719482_0.18403088597722284","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"ollama-mcp","version":"2.0.3","keywords":["mcp","ollama","ai","llm"],"author":{"name":"Tim Green","email":"rawveg@gmail.com"},"license":"AGPL-3.0","_id":"ollama-mcp@2.0.3","maintainers":[{"name":"rawveg","email":"rawveg@gmail.com"}],"homepage":"https://github.com/rawveg/ollama-mcp#readme","bugs":{"url":"https://github.com/rawveg/ollama-mcp/issues"},"bin":{"ollama-mcp":"dist/index.js"},"dist":{"shasum":"d69b4a2cd94ddb000d9d23fb4964c1502a26d349","tarball":"https://registry.npmjs.org/ollama-mcp/-/ollama-mcp-2.0.3.tgz","fileCount":79,"integrity":"sha512-XEqBUZP+WPQaSBhHrDeWCpCQeYjCR+6IcqCiMBffeTzf4m3JzbCfKhzNvMLI9r2zRI5w2p6+rcK3UyOg7Oky7Q==","signatures":[{"sig":"MEUCIQCXLVr3/Ekw9BFAmF/ULTpCBbn81C2CQ+oQOyeAqJ+x1AIgfXHbbEjYtLKE2ApPzRK+y8Nbt4j4eX9vthUQhZm/OCw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":149658},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"cad661062c0e2f3f9cde3f2bb7166f6eeef7bcc4","scripts":{"dev":"node dist/index.js","test":"vitest run","build":"tsc","prepare":"npm run build","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"rawveg","email":"rawveg@gmail.com"},"repository":{"url":"git+https://github.com/rawveg/ollama-mcp.git","type":"git"},"_npmVersion":"10.9.2","description":"MCP server for Ollama - exposes all Ollama SDK functionality through MCP tools","directories":{},"_nodeVersion":"23.11.0","dependencies":{"zod":"^3.24.1","ollama":"^0.5.11","json2md":"^2.0.3","markdown-table":"^3.0.4","@modelcontextprotocol/sdk":"^1.0.4"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.9","typescript":"^5.7.3","@types/node":"^22.10.5","@vitest/coverage-v8":"^2.1.9"},"_npmOperationalInternal":{"tmp":"tmp/ollama-mcp_2.0.3_1762233804771_0.791438812805267","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"ollama-mcp","version":"2.1.0","description":"MCP server for Ollama - exposes all Ollama SDK functionality through MCP tools","type":"module","main":"dist/index.js","types":"dist/index.d.ts","bin":{"ollama-mcp":"dist/index.js"},"repository":{"type":"git","url":"git+https://github.com/rawveg/ollama-mcp.git"},"bugs":{"url":"https://github.com/rawveg/ollama-mcp/issues"},"homepage":"https://github.com/rawveg/ollama-mcp#readme","scripts":{"build":"tsc","test":"vitest run","test:coverage":"vitest run --coverage","dev":"node dist/index.js","prepare":"npm run build"},"keywords":["mcp","ollama","ai","llm"],"author":{"name":"Tim Green","email":"rawveg@gmail.com"},"license":"AGPL-3.0","dependencies":{"@modelcontextprotocol/sdk":"^1.0.4","json2md":"^2.0.3","markdown-table":"^3.0.4","ollama":"^0.5.11","zod":"^3.24.1"},"devDependencies":{"@types/node":"^22.10.5","@vitest/coverage-v8":"^2.1.9","typescript":"^5.7.3","vitest":"^2.1.9"},"_id":"ollama-mcp@2.1.0","gitHead":"9d5a9930a7cda05d81f10d0d762965ab0c205979","_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-YcdXq+pIS2W1EIQT9T+Cbpi1OV40b0T7KOpM4nLEHPEj92gtQTVEoD/8RkKSuxWJZgXtXODDu2mp1aOgWH/Pqw==","shasum":"f7bfb8a1b54436a2120ceb0704614e28cc2cc6ef","tarball":"https://registry.npmjs.org/ollama-mcp/-/ollama-mcp-2.1.0.tgz","fileCount":111,"unpackedSize":247537,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCUqEgq0qXMK2rGP4q9rKIFDEEiqeyGseU5crzGZAGCtAIgBjL9Oe8VzsiaggWkic591KcbjOiqkLgvrf4SsBwUe3E="}]},"_npmUser":{"name":"rawveg","email":"rawveg@gmail.com"},"directories":{},"maintainers":[{"name":"rawveg","email":"rawveg@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ollama-mcp_2.1.0_1762792363498_0.033954755506071965"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-01T07:41:33.104Z","modified":"2025-11-10T16:32:43.896Z","2.0.0":"2025-11-01T07:41:33.408Z","2.0.1":"2025-11-01T08:23:07.256Z","2.0.2":"2025-11-01T08:45:19.710Z","2.0.3":"2025-11-04T05:23:24.965Z","2.1.0":"2025-11-10T16:32:43.696Z"},"bugs":{"url":"https://github.com/rawveg/ollama-mcp/issues"},"author":{"name":"Tim Green","email":"rawveg@gmail.com"},"license":"AGPL-3.0","homepage":"https://github.com/rawveg/ollama-mcp#readme","keywords":["mcp","ollama","ai","llm"],"repository":{"type":"git","url":"git+https://github.com/rawveg/ollama-mcp.git"},"description":"MCP server for Ollama - exposes all Ollama SDK functionality through MCP tools","maintainers":[{"name":"rawveg","email":"rawveg@gmail.com"}],"readme":"<div align=\"center\">\n\n# 🦙 Ollama MCP Server\n\n**Supercharge your AI assistant with local LLM access**\n\n[![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue)](https://www.typescriptlang.org/)\n[![MCP](https://img.shields.io/badge/MCP-1.0-green)](https://github.com/anthropics/model-context-protocol)\n[![Coverage](https://img.shields.io/badge/Coverage-96%25-brightgreen)](https://github.com/rawveg/ollama-mcp)\n\nAn MCP (Model Context Protocol) server that exposes the complete Ollama SDK as MCP tools, enabling seamless integration between your local LLM models and MCP-compatible applications like Claude Desktop and Cline.\n\n[Features](#-features) • [Installation](#-installation) • [Available Tools](#-available-tools) • [Configuration](#-configuration) • [Retry Behavior](#-retry-behavior) • [Development](#-development)\n\n</div>\n\n---\n\n## ✨ Features\n\n- ☁️ **Ollama Cloud Support** - Full integration with Ollama's cloud platform\n- 🔧 **14 Comprehensive Tools** - Full access to Ollama's SDK functionality\n- 🔄 **Hot-Swap Architecture** - Automatic tool discovery with zero-config\n- 🎯 **Type-Safe** - Built with TypeScript and Zod validation\n- 📊 **High Test Coverage** - 96%+ coverage with comprehensive test suite\n- 🚀 **Zero Dependencies** - Minimal footprint, maximum performance\n- 🔌 **Drop-in Integration** - Works with Claude Desktop, Cline, and other MCP clients\n- 🌐 **Web Search & Fetch** - Real-time web search and content extraction via Ollama Cloud\n- 🔀 **Hybrid Mode** - Use local and cloud models seamlessly in one server\n\n## 💡 Level Up Your Ollama Experience with Claude Code and Desktop\n\n### The Complete Package: Tools + Knowledge\n\nThis MCP server gives Claude the **tools** to interact with Ollama - but you'll get even more value by also installing the **Ollama Skill** from the [Skillsforge Marketplace](https://github.com/rawveg/skillsforge-marketplace):\n\n- 🚗 **This MCP = The Car** - All the tools and capabilities\n- 🎓 **Ollama Skill = Driving Lessons** - Expert knowledge on how to use them effectively\n\nThe Ollama Skill teaches Claude:\n- Best practices for model selection and configuration\n- Optimal prompting strategies for different Ollama models\n- When to use chat vs generate, embeddings, and other tools\n- Performance optimization and troubleshooting\n- Advanced features like tool calling and function support\n\n**Install both for the complete experience:**\n1. ✅ This MCP server (tools)\n2. ✅ [Ollama Skill](https://github.com/rawveg/skillsforge-marketplace) (expertise)\n\nResult: Claude doesn't just have the car - it knows how to drive! 🏎️\n\n## 📦 Installation\n\n### Quick Start with Claude Desktop\n\nAdd to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):\n\n```json\n{\n  \"mcpServers\": {\n    \"ollama\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"ollama-mcp\"]\n    }\n  }\n}\n```\n\n### Global Installation\n\n```bash\nnpm install -g ollama-mcp\n```\n\n### For Cline (VS Code)\n\nAdd to your Cline MCP settings (`cline_mcp_settings.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"ollama\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"ollama-mcp\"]\n    }\n  }\n}\n```\n\n## 🛠️ Available Tools\n\n### Model Management\n| Tool | Description |\n|------|-------------|\n| `ollama_list` | List all available local models |\n| `ollama_show` | Get detailed information about a specific model |\n| `ollama_pull` | Download models from Ollama library |\n| `ollama_push` | Push models to Ollama library |\n| `ollama_copy` | Create a copy of an existing model |\n| `ollama_delete` | Remove models from local storage |\n| `ollama_create` | Create custom models from Modelfile |\n\n### Model Operations\n| Tool | Description |\n|------|-------------|\n| `ollama_ps` | List currently running models |\n| `ollama_generate` | Generate text completions |\n| `ollama_chat` | Interactive chat with models (supports tools/functions) |\n| `ollama_embed` | Generate embeddings for text |\n\n### Web Tools (Ollama Cloud)\n| Tool | Description |\n|------|-------------|\n| `ollama_web_search` | Search the web with customizable result limits (requires `OLLAMA_API_KEY`) |\n| `ollama_web_fetch` | Fetch and parse web page content (requires `OLLAMA_API_KEY`) |\n\n> **Note:** Web tools require an Ollama Cloud API key. They connect to `https://ollama.com/api` for web search and fetch operations.\n\n## ⚙️ Configuration\n\n### Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `OLLAMA_HOST` | `http://127.0.0.1:11434` | Ollama server endpoint (use `https://ollama.com` for cloud) |\n| `OLLAMA_API_KEY` | - | API key for Ollama Cloud (required for web tools and cloud models) |\n\n### Custom Ollama Host\n\n```json\n{\n  \"mcpServers\": {\n    \"ollama\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"ollama-mcp\"],\n      \"env\": {\n        \"OLLAMA_HOST\": \"http://localhost:11434\"\n      }\n    }\n  }\n}\n```\n\n### Ollama Cloud Configuration\n\nTo use Ollama's cloud platform with web search and fetch capabilities:\n\n```json\n{\n  \"mcpServers\": {\n    \"ollama\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"ollama-mcp\"],\n      \"env\": {\n        \"OLLAMA_HOST\": \"https://ollama.com\",\n        \"OLLAMA_API_KEY\": \"your-ollama-cloud-api-key\"\n      }\n    }\n  }\n}\n```\n\n**Cloud Features:**\n- ☁️ Access cloud-hosted models\n- 🔍 Web search with `ollama_web_search` (requires API key)\n- 📄 Web fetch with `ollama_web_fetch` (requires API key)\n- 🚀 Faster inference on cloud infrastructure\n\n**Get your API key:** Visit [ollama.com](https://ollama.com) to sign up and obtain your API key.\n\n### Hybrid Mode (Local + Cloud)\n\nYou can use both local and cloud models by pointing to your local Ollama instance while providing an API key:\n\n```json\n{\n  \"mcpServers\": {\n    \"ollama\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"ollama-mcp\"],\n      \"env\": {\n        \"OLLAMA_HOST\": \"http://127.0.0.1:11434\",\n        \"OLLAMA_API_KEY\": \"your-ollama-cloud-api-key\"\n      }\n    }\n  }\n}\n```\n\nThis configuration:\n- ✅ Runs local models from your Ollama instance\n- ✅ Enables cloud-only web search and fetch tools\n- ✅ Best of both worlds: privacy + web connectivity\n\n## 🔄 Retry Behavior\n\nThe MCP server includes intelligent retry logic for handling transient failures when communicating with Ollama APIs:\n\n### Automatic Retry Strategy\n\n**Web Tools (`ollama_web_search` and `ollama_web_fetch`):**\n- Automatically retry on rate limit errors (HTTP 429)\n- Maximum of **3 retry attempts** (4 total requests including initial)\n- **Request timeout:** 30 seconds per request (prevents hung connections)\n- Respects the `Retry-After` header when provided by the API\n- Falls back to exponential backoff with jitter when `Retry-After` is not present\n\n### Retry-After Header Support\n\nThe server intelligently handles the standard HTTP `Retry-After` header in two formats:\n\n**1. Delay-Seconds Format:**\n```\nRetry-After: 60\n```\nWaits exactly 60 seconds before retrying.\n\n**2. HTTP-Date Format:**\n```\nRetry-After: Wed, 21 Oct 2025 07:28:00 GMT\n```\nCalculates delay until the specified timestamp.\n\n### Exponential Backoff\n\nWhen `Retry-After` is not provided or invalid:\n- **Initial delay:** 1 second (default)\n- **Maximum delay:** 10 seconds (default, configurable)\n- **Strategy:** Exponential backoff with full jitter\n- **Formula:** `random(0, min(initialDelay × 2^attempt, maxDelay))`\n\n**Example retry delays:**\n- 1st retry: 0-1 seconds\n- 2nd retry: 0-2 seconds\n- 3rd retry: 0-4 seconds (capped at 0-10s max)\n\n### Error Handling\n\n**Retried Errors (transient failures):**\n- HTTP 429 (Too Many Requests) - rate limiting\n- HTTP 500 (Internal Server Error) - transient server issues\n- HTTP 502 (Bad Gateway) - gateway/proxy received invalid response\n- HTTP 503 (Service Unavailable) - server temporarily unable to handle request\n- HTTP 504 (Gateway Timeout) - gateway/proxy did not receive timely response\n\n**Non-Retried Errors (permanent failures):**\n- Request timeouts (30 second limit exceeded)\n- Network timeouts (no status code)\n- Abort/cancel errors\n- HTTP 4xx errors (except 429) - client errors requiring changes\n- Other HTTP 5xx errors (501, 505, 506, 508, etc.) - configuration/implementation issues\n\nThe retry mechanism ensures robust handling of temporary API issues while respecting server-provided retry guidance and preventing excessive request rates. Transient 5xx errors (500, 502, 503, 504) are safe to retry for the idempotent POST operations used by `ollama_web_search` and `ollama_web_fetch`. Individual requests timeout after 30 seconds to prevent indefinitely hung connections.\n\n## 🎯 Usage Examples\n\n### Chat with a Model\n\n```typescript\n// MCP clients can invoke:\n{\n  \"tool\": \"ollama_chat\",\n  \"arguments\": {\n    \"model\": \"llama3.2:latest\",\n    \"messages\": [\n      { \"role\": \"user\", \"content\": \"Explain quantum computing\" }\n    ]\n  }\n}\n```\n\n### Generate Embeddings\n\n```typescript\n{\n  \"tool\": \"ollama_embed\",\n  \"arguments\": {\n    \"model\": \"nomic-embed-text\",\n    \"input\": [\"Hello world\", \"Embeddings are great\"]\n  }\n}\n```\n\n### Web Search\n\n```typescript\n{\n  \"tool\": \"ollama_web_search\",\n  \"arguments\": {\n    \"query\": \"latest AI developments\",\n    \"max_results\": 5\n  }\n}\n```\n\n## 🏗️ Architecture\n\nThis server uses a **hot-swap autoloader** pattern:\n\n```\nsrc/\n├── index.ts          # Entry point (27 lines)\n├── server.ts         # MCP server creation\n├── autoloader.ts     # Dynamic tool discovery\n└── tools/            # Tool implementations\n    ├── chat.ts       # Each exports toolDefinition\n    ├── generate.ts\n    └── ...\n```\n\n**Key Benefits:**\n- Add new tools by dropping files in `src/tools/`\n- Zero server code changes required\n- Each tool is independently testable\n- 100% function coverage on all tools\n\n## 🧪 Development\n\n### Prerequisites\n\n- Node.js v16+\n- npm or pnpm\n- Ollama running locally\n\n### Setup\n\n```bash\n# Clone repository\ngit clone https://github.com/rawveg/ollama-mcp.git\ncd ollama-mcp\n\n# Install dependencies\nnpm install\n\n# Build project\nnpm run build\n\n# Run tests\nnpm test\n\n# Run tests with coverage\nnpm run test:coverage\n```\n\n### Test Coverage\n\n```\nStatements   : 96.37%\nBranches     : 84.82%\nFunctions    : 100%\nLines        : 96.37%\n```\n\n### Adding a New Tool\n\n1. Create `src/tools/your-tool.ts`:\n\n```typescript\nimport { ToolDefinition } from '../autoloader.js';\nimport { Ollama } from 'ollama';\nimport { ResponseFormat } from '../types.js';\n\nexport const toolDefinition: ToolDefinition = {\n  name: 'ollama_your_tool',\n  description: 'Your tool description',\n  inputSchema: {\n    type: 'object',\n    properties: {\n      param: { type: 'string' }\n    },\n    required: ['param']\n  },\n  handler: async (ollama, args, format) => {\n    // Implementation\n    return 'result';\n  }\n};\n```\n\n2. Create tests in `tests/tools/your-tool.test.ts`\n3. Done! The autoloader discovers it automatically.\n\n## 🤝 Contributing\n\nContributions are welcome! Please follow these guidelines:\n\n1. **Fork** the repository\n2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)\n3. **Write tests** - We maintain 96%+ coverage\n4. **Commit** with clear messages (`git commit -m 'Add amazing feature'`)\n5. **Push** to your branch (`git push origin feature/amazing-feature`)\n6. **Open** a Pull Request\n\n### Code Quality Standards\n\n- All new tools must export `toolDefinition`\n- Maintain ≥80% test coverage\n- Follow existing TypeScript patterns\n- Use Zod schemas for input validation\n\n## 📄 License\n\nThis project is licensed under the **GNU Affero General Public License v3.0** (AGPL-3.0).\n\nSee [LICENSE](LICENSE) for details.\n\n## 🔗 Related Projects\n\n- [Skillsforge Marketplace](https://github.com/rawveg/skillsforge-marketplace) - Claude Code skills including the Ollama Skill\n- [Ollama](https://ollama.ai) - Get up and running with large language models locally\n- [Model Context Protocol](https://github.com/anthropics/model-context-protocol) - Open standard for AI assistant integration\n- [Claude Desktop](https://claude.ai/desktop) - Anthropic's desktop application\n- [Cline](https://github.com/cline/cline) - VS Code AI assistant\n\n## 🙏 Acknowledgments\n\nBuilt with:\n- [Ollama SDK](https://github.com/ollama/ollama-js) - Official Ollama JavaScript library\n- [MCP SDK](https://github.com/anthropics/model-context-protocol) - Model Context Protocol SDK\n- [Zod](https://zod.dev) - TypeScript-first schema validation\n\n---\n\n<div align=\"center\">\n\n**[⬆ back to top](#-ollama-mcp-server)**\n\nMade with ❤️ by [Tim Green](https://github.com/rawveg)\n\n</div>\n","readmeFilename":"README.md"}