ollama-mcp-bridge

This repository provides a TypeScript bridge connecting local LLMs via Ollama to Model Context Protocol servers, enabling open-source models to utilize tools like filesystem operations, web search, and more.

660
52

MCP-LLM Bridge

This TypeScript project connects local LLMs (via Ollama) to Model Context Protocol (MCP) servers, enabling open-source models to leverage tools and capabilities similar to Claude.

Overview

The bridge facilitates communication between local LLMs and MCP servers, providing functionalities like filesystem operations, web search, GitHub interactions, Google Drive & Gmail integration, memory/storage, and image generation. It translates LLM outputs into the MCP's JSON-RPC protocol, allowing any Ollama-compatible model to utilize these tools.

Current Setup

  • LLM: Qwen 2.5 7B (qwen2.5-coder:7b-instruct) via Ollama.
  • MCPs: Filesystem, Brave Search, GitHub, Memory, Flux image generation, and Gmail & Drive.

Architecture

The core components include a Bridge for tool management, an LLM Client for Ollama interaction, an MCP Client for server communication, and a Tool Router.

Key Features

Multi-MCP support, structured output validation, automatic tool detection, robust process management, and detailed logging.

Usage

The bridge detects tools based on user input and processes responses through stages: LLM generates tool calls, the bridge validates and routes to the appropriate MCP, the MCP executes the operation, and the bridge formats the response for the user.

Repository

PA
patruff

patruff/ollama-mcp-bridge

Created

December 12, 2024

Updated

March 28, 2025

Language

TypeScript

Category

AI