Back to Home
jonigl icon

ollama-mcp-bridge

by jonigl

Overview

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.

Installation

Run Command
docker-compose up

Environment Variables

  • OLLAMA_URL
  • CORS_ORIGINS
  • MAX_TOOL_ROUNDS
  • OLLAMA_PROXY_TIMEOUT
  • SYSTEM_PROMPT
  • MCP_REQUEST_TAG

Security Notes

The bridge allows configuration of Model Context Protocol (MCP) servers via a `mcp-config.json` file. When configuring `stdio` transport, the `command` and `args` fields in this file are executed as shell commands on the host machine. If `mcp-config.json` is not trusted or can be manipulated by an attacker, this can lead to arbitrary code execution, which is a critical security risk. Environment variables, either directly retrieved via `os.getenv` or expanded from `${env:VAR_NAME}` within the configuration, can influence server behavior including commands executed or URLs accessed, posing an injection risk if untrusted. The default `CORS_ORIGINS` is `*`, which allows all origins and is not recommended for production environments.

Similar Servers

Stats

Interest Score47
Security Score2
Cost ClassMedium
Avg Tokens250
Stars52
Forks13
Last Update2026-01-16

Tags

MCPOllamaAPI GatewayToolsLLM