PO

patruff/ollama-mcp-bridge

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

984 stars 113 forks 品質 66 トレンド 22MIT

OllamaサーバーとMCPサーバー間のブリッジ、ローカルLLMがモデルコンテキストプロトコルツールを使用できるようにする

概要

ローカルLLM(Ollama経由)とModel Context Protocol(MCP)サーバーを接続するTypeScript実装です。このブリッジにより、オープンソースモデルはClaudeと同じツールや機能を利用でき、強力なローカルAIアシスタントが実現します。 このプロジェクトは、ローカルの大規模言語モデルとMCPサーバーを橋渡しし、以下のような機能を提供します:- ファイルシステム操作 - Braveウェブ検索 - GitHubとのやり取り - GoogleドライブとGmail連携 - メモリ/ストレージ - Fluxによる画像生成 このブリッジはLLMの出力とMCPのJSON-RPCプロトコル間を変換し、Ollama互換モデルでもClaudeのようにこれらのツールを使用できるようにします。 - : Qwen 2.5 7B(qwen2.

概要(AI 翻訳)

ローカルLLM(Ollama経由)とModel Context Protocol(MCP)サーバーを接続するTypeScript実装です。このブリッジにより、オープンソースモデルはClaudeと同じツールや機能を利用でき、強力なローカルAIアシスタントが実現します。

概要

このプロジェクトは、ローカルの大規模言語モデルとMCPサーバーをブリッジし、以下のような様々な機能を提供します。

  • ファイルシステム操作
  • Braveウェブ検索
  • GitHubでのやり取り
  • Google DriveとGmail連携
  • メモリ/ストレージ
  • フラックスによる画像生成

このブリッジはLLMの出力とMCPのJSON-RPCプロトコル間を変換し、Ollama互換モデルでもClaudeのようにこれらのツールを使用できるようにします。

現在のセットアップ

  • LLM: Ollama 経由のQwen 2.5 7B (qwen2.5-coder:7b-instruct)
  • MCP:
  • ファイルシステム操作(@modelcontextprotocol/server-filesystem)
  • ブレイブサーチ(@modelcontextprotocol/server-brave-search)
  • GitHub(@modelcontextprotocol/server-github)
  • メモリ(@modelcontextprotocol/server-memory)
  • フラックスイメージ生成(@patruff/server-flux)
  • GmailとDrive(@patruff/server-gmail-drive)

建築

  • Bridge:ツール登録と実行を管理するコアコンポーネント

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

MCP-LLM Bridge

A TypeScript implementation that connects local LLMs (via Ollama) to Model Context Protocol (MCP) servers. This bridge allows open-source models to use the same tools and capabilities as Claude, enabling powerful local AI assistants.

Overview

This project bridges local Large Language Models with MCP servers that provide various capabilities like:

  • Filesystem operations
  • Brave web search
  • GitHub interactions
  • Google Drive & Gmail integration
  • Memory/storage
  • Image generation with Flux

The bridge translates between the LLM’s outputs and the MCP’s JSON-RPC protocol, allowing any Ollama-compatible model to use these tools just like Claude does.

Current Setup

  • LLM: Using Qwen 2.5 7B (qwen2.5-coder:7b-instruct) through Ollama
  • MCPs:
    • Filesystem operations (@modelcontextprotocol/server-filesystem)
    • Brave Search (@modelcontextprotocol/server-brave-search)
    • GitHub (@modelcontextprotocol/server-github)
    • Memory (@modelcontextprotocol/server-memory)
    • Flux image generation (@patruff/server-flux)
    • Gmail & Drive (@patruff/server-gmail-drive)

Architecture

  • Bridge: Core component that manages tool registration and execution
  • LLM Client: Handles Ollama interactions and formats tool calls
  • MCP Client: Manages MCP server connections and JSON-RPC communication
  • Tool Router: Routes requests to appropriate MCP based on tool type

Key Features

  • Multi-MCP support with dynamic tool routing
  • Structured output validation for tool calls
  • Automatic tool detection from user prompts
  • Robust process management for Ollama
  • Detailed logging and error handling

Setup

  1. Install Ollama and required model:
ollama pull qwen2.5-coder:7b-instruct
  1. Install MCP servers:
npm install -g @modelcontextprotocol/server-filesystem
npm install -g @modelcontextprotocol/server-brave-search
npm install -g @modelcontextprotocol/server-github
npm install -g @modelcontextprotocol/server-memory
npm install -g @patruff/server-flux
npm install -g @patruff/server-gmail-drive
  1. Configure credentials:
    • Set BRAVE_API_KEY for Brave Search
    • Set GITHUB_PERSONAL_ACCESS_TOKEN for GitHub
    • Set REPLICATE_API_TOKEN for Flux
    • Run Gmail/Drive MCP auth: node path/to/gmail-drive/index.js auth
    • For example node C:\Users\patru\AppData\Roaming\npm\node_modules@patruff\server-gmail-drive\dist\index.js auth

Configuration

The bridge is configured through bridge_config.json:

  • MCP server definitions
  • LLM settings (model, temperature, etc.)
  • Tool permissions and paths

Example:

{
  "mcpServers": {
    "filesystem": {
      "command": "node",
      "args": ["path/to/server-filesystem/dist/index.js"],
      "allowedDirectory": "workspace/path"
    },
    // ... other MCP configurations
  },
  "llm": {
    "model": "qwen2.5-coder:7b-instruct",
    "baseUrl": "http://localhost:11434"
  }
}

Usage

  1. Start the bridge:
npm run start
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "filesystem": { "command": "node", "args": ["path/to/server-filesystem/dist/index.js"], "allowedDirectory": "workspace/path" }, // ... other MCP configurations }, "llm": { "model": "qwen2.5-coder:7b-instruct", "baseUrl": "http://localhost:11434" } }