ollama-mcp-bridge  by patruff

MCP bridge for local LLMs to use external tools

Created 9 months ago
925 stars

Top 39.5% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a TypeScript bridge enabling local LLMs via Ollama to interact with Model Context Protocol (MCP) servers, replicating advanced tool-use capabilities found in proprietary models like Claude. It targets developers and power users seeking to equip open-source models with local filesystem access, web search, GitHub integration, email/drive management, and image generation.

How It Works

The bridge acts as an intermediary, translating LLM outputs into MCP's JSON-RPC protocol. It dynamically routes tool requests from the LLM to the appropriate MCP server based on detected intent and keywords. This architecture allows any Ollama-compatible model to leverage a suite of external tools, enhancing their utility for complex, real-world tasks.

Quick Start & Requirements

  • Install Ollama & Model: ollama pull qwen2.5-coder:7b-instruct
  • Install MCP Servers: npm install -g @modelcontextprotocol/server-filesystem @modelcontextprotocol/server-brave-search @modelcontextprotocol/server-github @modelcontextprotocol/server-memory @patruff/server-flux @patruff/server-gmail-drive
  • Configure Credentials: Set environment variables (e.g., BRAVE_API_KEY, GITHUB_PERSONAL_ACCESS_TOKEN, REPLICATE_API_TOKEN) and run Gmail/Drive MCP auth.
  • Configuration: Define MCP server details, LLM settings, and tool permissions in bridge_config.json.
  • Run Bridge: npm run start
  • Prerequisites: Node.js, npm, Ollama, specific MCP server packages, API keys for certain services.

Highlighted Details

  • Enables local LLMs to perform filesystem operations, web searches (Brave), GitHub interactions, Google Drive/Gmail management, and image generation (Flux).
  • Features smart tool detection from natural language prompts and structured output validation for tool calls.
  • Supports dynamic tool routing and robust process management for Ollama.

Maintenance & Community

The project is maintained by patruff. Links to related projects like Model Context Protocol, Claude Desktop Configuration, Ollama, and various MCP server implementations are provided.

Licensing & Compatibility

The README does not explicitly state the license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The project is described as a bridge and relies on external MCP server implementations, which may have their own dependencies and setup requirements. Specific details on error recovery and parallel tool execution are listed as future improvements.

Health Check
Last Commit

5 months ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
22 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.