A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Extend the Ollama API with dynamic AI tool integration from multiple MCP (Model Context Protocol) servers. Fully compati
Provides an API layer in front of the Ollama API, seamlessly adding tools from multiple MCP servers so every Ollama request can access all connected tools transparently.
${env:VAR_NAME} and ${workspaceFolder} in config strings/api/chat adds tools while all other Ollama API endpoints are transparently proxiedlinux/amd64 and linux/arm64 images published to GitHub Container Registry on every releaseYou can install ollama-mcp-bridge in several ways, depending on your preference:
Install instantly with uvx:
uvx ollama-mcp-bridge
pip install --upgrade ollama-mcp-bridge
docker compose up
This uses the included docker-compose.yml file which:
host.docker.internal:11434)8000 on the hostCORS_ORIGINS environment variable)OLLAMA_PROXY_TIMEOUT[!TIP] To skip the local build and use the pre-built image from GitHub Container Registry instead, replace the
build:block indocker-compose.ymlwith:hljs language-yamlimage: ghcr.io/jonigl/ollama-mcp-bridge:latest
[!NOTE] ✨ NEW: Pre-built multi-arch Docker images (
linux/amd64andlinux/arm64) are now published automatically to the GitHub Container Registry on every release. No local build required!
Pre-built multi-arch images (linux/amd64 and linux/arm64) are published to the GitHub Container Registry on every release. Available tags:
latest — most recent stable releasevX.Y.Z — specific version (e.g. v0.10.0)sha-<commit> — exact commit SHA builddocker run -p 8000:8000 \
-e OLLAMA_URL=http://host.docker.internal:11434 \
-v "$PWD/mcp-config.json:/mcp-config.json" \
-v "$PWD/mock-weather-mcp-server:/mock-weather-mcp-server" \
-w / \
ghcr.io/jonigl/ollama-mcp-bridge:latest
Key flags:
-p 8000:8000 — exposes the bridge on your host at port 8000-e OLLAMA_URL=http://host.docker.internal:11434 — routes Ollama traffic to the host machine (required on macOS and Windows; on Linux use --network host or the host's IP instead)-v "$PWD/mcp-config.json:/mcp-config.json" — mounts your local config into the container-v "$PWD/mock-weather-mcp-server:/mock-weather-mcp-server" — mounts the mock MCP server without :ro so uv can create its .venv inside the directory-w / — sets the working directory to / so relative paths in mcp-config.json resolve correctly[!NOTE] On Linux,
host.docker.internalmay not resolve automatically. Use--network hostand keepOLLAMA_URL=http://localhost:11434, or replace it with your host's LAN IP.
# Clone the repository
git clone https://github.com/jonigl/ollama-mcp-bridge.git
cd ollama-mcp-bridge
# Start Ollama (if not already running)
ollama serve
# Run the bridge
uv run ollama-mcp-bridge
If you want to install the project in editable mode (for development):
# Install the project in editable mode
uv tool install --editable .
# Run it like this:
ollama-mcp-bridge
/api/chat endpoint only): When a chat completion request is received on /api/chat:
/api/chat, /health, and /version) are fully proxied to the underlying Ollama server with no modification.You can configure MCP servers in three ways:
{"command": "...", "args": [...], "env": {...}}{"url": "https://..."} - Uses StreamableHTTP by default{"url": "https://.../sse"} - If the URL ends with /sse, the bridge connects via Server-Sent EventsCreate an MCP configuration file at mcp-config.json with your servers:
{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"--directory",
"./mock-weather-mcp-server",
"run",
"main.py"
],
"env": {
"MCP_LOG_LEVEL": "ERROR"
},
"toolFilter": {
"mode": "include",
"tools": ["get_current_temperature", "get_forecast"]
}
},
"remote_streamable_http": {
"url": "https://example.com/mcp"
},
"remote_sse": {
"url": "https://example.com/sse"
},
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/tmp"
],
"toolFilter": {
"mode": "exclude",
"tools": ["delete_file", "write_file"]
}
}
}
}
You can filter which tools from an MCP server are made available to Ollama using the optional toolFilter configuration:
toolFilter (optional): Object with filtering options
mode: Either "include" (allow-list) or "exclude" (deny-list). Defaults to "include" if not specified.tools: Array of exact tool names to include or excludeBehavior:
toolFilter is not set or tools array is empty, all tools from the server are loaded (default behavior)tools array are made available. If a listed tool is not found on the server, a warning is logged but the server connection continues.tools array are made available. Listed tools are filtered out.mode values cause the application to exit with an error messageExample with include mode (default):
{
"mcpServers": {
"weather": {
"command": "uv",
"args": ["--directory", "./mock-weather-mcp-server", "run", "main.py"],
"toolFilter": {
"tools": ["get_current_temperature", "get_forecast"]
}
}
}
}
Example with explicit modes:
{
"mcpServers": {
"weather": {
"command": "uv",
"args": ["--directory", "./mock-weather-mcp-server", "run", "main.py"],
"toolFilter": {
"mode": "include",
"tools": ["get_current_temperature"]
}
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
"toolFilter": {
"mode": "exclude",
"tools": ["delete_file", "write_file"]
}
}
}
}
The config also supports simple expansion in any string value:
${workspaceFolder} resolves to the directory containing the config file${env:VAR_NAME} resolves to the corresponding environment variableExample:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"${workspaceFolder}/data"
]
},
"remote_with_headers": {
"url": "https://example.com/mcp",
"headers": {
"X-Client-Name": "ollama-mcp-bridge",
"X-Request-Tag": "${env:MCP_REQUEST_TAG}"
}
}
}
}
[!WARNING] Docker Command Limitations: When running in Docker, MCP servers should use commands available in the container:
- ✅
npxfor Node.js-based MCP servers- ✅
uvxfor Python-based MCP servers- ✅ Direct executables in the container
- ❌
dockercommands (unless Docker-in-Docker is configured)- ❌ Local file paths from your host machine
Configure Cross-Origin Resource Sharing (CORS) to allow requests from your frontend applications:
# Allow all origins (default, not recommended for production)
ollama-mcp-bridge
# Allow specific origins
CORS_ORIGINS="http://localhost:3000,https://myapp.com" ollama-mcp-bridge
# Allow multiple origins with different ports
CORS_ORIGINS="http://localhost:3000,http://localhost:8080,https://app.example.com" ollama-mcp-bridge
CORS Logging:
* (all origins)[!WARNING] Using
CORS_ORIGINS="*"allows all origins and is not recommended for production. Always specify exact origins for security.
CORS_ORIGINS: Comma-separated list of allowed origins (default: *)
* allows all origins (shows warning in logs)CORS_ORIGINS="http://localhost:3000,https://myapp.com" ollama-mcp-bridgeMAX_TOOL_ROUNDS: Maximum number of tool execution rounds (default: unlimited)
--max-tool-rounds CLI parameter (CLI takes precedence)MAX_TOOL_ROUNDS=5 ollama-mcp-bridgeOLLAMA_URL: URL of the Ollama server (default: http://localhost:11434)
--ollama-url CLI parameterOLLAMA_URL=http://192.168.1.100:11434 ollama-mcp-bridgeOLLAMA_PROXY_TIMEOUT: Timeout for HTTP requests sent to Ollama, in milliseconds (default: unset)
/api/chat is not timed out)OLLAMA_PROXY_TIMEOUT=600000 ollama-mcp-bridgeSYSTEM_PROMPT: Optional system prompt to prepend to all forwarded /api/chat requests
SYSTEM_PROMPT environment variable or --system-prompt CLI flagsystem) to the beginning of the messages array for /api/chat requests unless the request already starts with a system message.SYSTEM_PROMPT="You are a concise assistant." ollama-mcp-bridge[!NOTE] An example MCP server script is provided at mock-weather-mcp-server/main.py.
# Start with default settings (config: ./mcp-config.json, host: 0.0.0.0, port: 8000)
ollama-mcp-bridge
# Start with custom configuration file
ollama-mcp-bridge --config /path/to/custom-config.json
# Custom host and port
ollama-mcp-bridge --host 0.0.0.0 --port 8080
# Custom Ollama server URL (local or cloud)
ollama-mcp-bridge --ollama-url http://192.168.1.100:11434
# Limit tool execution rounds (prevents excessive tool calls)
ollama-mcp-bridge --max-tool-rounds 5
# Set a system prompt to prepend to all /api/chat requests
ollama-mcp-bridge --system-prompt "You are a concise assistant."
# Combine options
ollama-mcp-bridge --config custom.json --host 0.0.0.0 --port 8080 --ollama-url http://remote-ollama:11434 --max-tool-rounds 10
# Check version and available updates
ollama-mcp-bridge --version
[!TIP] If using
uvxto run the bridge, you have to specify the command asuvx ollama-mcp-bridgeinstead of justollama-mcp-bridge.
[!NOTE] This bridge supports both streaming responses and thinking mode. You receive incremental responses as they are generated, with tool calls and intermediate thinking messages automatically proxied between Ollama and all connected MCP tools.
--config: Path to MCP configuration file (default: mcp-config.json)--host: Host to bind the server (default: 0.0.0.0)--port: Port to bind the server (default: 8000)--ollama-url: Ollama server URL (default: http://localhost:11434)--max-tool-rounds: Maximum tool execution rounds (default: unlimited)--reload: Enable auto-reload during development--version: Show version information, check for updates and exit--system-prompt: Optional system prompt to prepend to /api/chat requests (default: none)The API is available at http://localhost:8000.
POST /api/chat — Chat endpoint (same as Ollama API, but with MCP tool support)
/api/chat, /health, and /version) are fully proxied to the underlying Ollama server with no modification. You can use your existing Ollama clients and libraries as usual.GET /health — Health check endpoint (not proxied)GET /version — Version information and update check[!IMPORTANT]
/api/chatis the only endpoint with MCP tool integration. All other endpoints are transparently proxied to Ollama./healthand/versionare specific to the bridge.
This bridge acts as a drop-in proxy for the Ollama API, but with all MCP tools from all connected servers available to every /api/chat request. The bridge automatically handles multiple rounds of tool execution until completion, streaming responses in real-time. You can use your existing Ollama clients and libraries with both local and cloud Ollama models, just point them to this bridge instead of your Ollama server.
curl -N -X POST http://localhost:8000/api/chat \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3:0.6b",
"messages": [
{
"role": "system",
"content": "You are a weather assistant."
},
{
"role": "user",
"content": "What is the weather like in Paris today?"
}
],
"think": true,
"stream": true,
"options": {
"temperature": 0.7,
"top_p": 0.9
}
}'
[!TIP] Use
/docsfor interactive API exploration and testing.
The project has two types of tests:
# Install test dependencies
uv sync --extra test
# Run unit tests (no server required)
uv run pytest tests/test_unit.py -v
These tests check:
# First, start the server in one terminal
ollama-mcp-bridge
# Then in another terminal, run the integration tests
uv run pytest tests/test_api.py -v
These tests check:
# Quick manual test with curl (server must be running)
curl -X GET "http://localhost:8000/health"
# Check version information and update status
curl -X GET "http://localhost:8000/version"
curl -X POST "http://localhost:8000/api/chat" \
-H "Content-Type: application/json" \
-d '{"model": "qwen3:0.6b", "messages": [{"role": "user", "content": "What tools are available?"}]}'
[!NOTE] Tests require the server to be running on localhost:8000. Make sure to start the server before running pytest.
We welcome contributions! Please see CONTRIBUTING.md for:
MCP Client for Ollama - A text-based user interface (TUI) client for interacting with MCP servers using Ollama. Features include multi-server support, dynamic model switching, streaming responses, tool management, human-in-the-loop capabilities, thinking mode, full model parameters configuration, custom system prompt and saved preferences. Built for developers working with local LLMs.
simple-ollama-chat – A simple, user-friendly chat client for Ollama that works seamlessly with the Ollama MCP Bridge. Lets you interact with models and use all MCP server tools integrated via the bridge, with a clean UI and easy setup. Ideal for quickly testing, chatting, and exploring tool-augmented LLMs through the bridge.
This project is based on the basic MCP client from my Medium article: Build an MCP Client in Minutes: Local AI Agents Just Got Real.
The inspiration to create this simple bridge came from this GitHub issue: jonigl/mcp-client-for-ollama#22, suggested by @nyomen.
Made with ❤️ by jonigl
MCP server integration for DaVinci Resolve Studio
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnos
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots