Skip to content
Back to search

ollama-mcp-bridge

Bridge between Ollama and MCP servers, enabling local LLMs to use Model Context Protocol tools

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/patruff--ollama-mcp-bridge/badge.svg)](/listings/patruff--ollama-mcp-bridge)

HTML

<a href="/listings/patruff--ollama-mcp-bridge"><img src="/api/listings/patruff--ollama-mcp-bridge/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

- **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`)

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 159 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # MCP-LLM Bridge
  2. 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.
  3. ## Overview
  4. This project bridges local Large Language Models with MCP servers that provide various capabilities like:
  5. - Filesystem operations
  6. - Brave web search
  7. - GitHub interactions
  8. - Google Drive & Gmail integration
  9. - Memory/storage
  10. - Image generation with Flux
  11. 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.
  12. ## Current Setup
  13. - **LLM**: Using Qwen 2.5 7B (qwen2.5-coder:7b-instruct) through Ollama
  14. - **MCPs**:
  15. - Filesystem operations (`@modelcontextprotocol/server-filesystem`)
  16. - Brave Search (`@modelcontextprotocol/server-brave-search`)
  17. - GitHub (`@modelcontextprotocol/server-github`)
  18. - Memory (`@modelcontextprotocol/server-memory`)
  19. - Flux image generation (`@patruff/server-flux`)
  20. - Gmail & Drive (`@patruff/server-gmail-drive`)
  21. ## Architecture
  22. - **Bridge**: Core component that manages tool registration and execution
  23. - **LLM Client**: Handles Ollama interactions and formats tool calls
  24. - **MCP Client**: Manages MCP server connections and JSON-RPC communication
  25. - **Tool Router**: Routes requests to appropriate MCP based on tool type
  26. ### Key Features
  27. - Multi-MCP support with dynamic tool routing
  28. - Structured output validation for tool calls
  29. - Automatic tool detection from user prompts
  30. - Robust process management for Ollama
  31. - Detailed logging and error handling
  32. ## Setup
  33. 1. Install Ollama and required model:
  34. ```bash
  35. ollama pull qwen2.5-coder:7b-instruct
  36. ```
  37. 2. Install MCP servers:
  38. ```bash
  39. npm install -g @modelcontextprotocol/server-filesystem
  40. npm install -g @modelcontextprotocol/server-brave-search
  41. npm install -g @modelcontextprotocol/server-github
  42. npm install -g @modelcontextprotocol/server-memory
  43. npm install -g @patruff/server-flux
  44. npm install -g @patruff/server-gmail-drive
  45. ```
  46. 3. Configure credentials:
  47. - Set `BRAVE_API_KEY` for Brave Search
  48. - Set `GITHUB_PERSONAL_ACCESS_TOKEN` for GitHub
  49. - Set `REPLICATE_API_TOKEN` for Flux
  50. - Run Gmail/Drive MCP auth: `node path/to/gmail-drive/index.js auth`
  51. - For example node C:\Users\patru\AppData\Roaming\npm\node_modules\@patruff\server-gmail-drive\dist\index.js auth
  52. ## Configuration
  53. The bridge is configured through `bridge_config.json`:
  54. - MCP server definitions
  55. - LLM settings (model, temperature, etc.)
  56. - Tool permissions and paths
  57. Example:
  58. ```json
  59. {
  60. "mcpServers": {
  61. "filesystem": {
  62. "command": "node",
  63. "args": ["path/to/server-filesystem/dist/index.js"],
  64. "allowedDirectory": "workspace/path"
  65. },
  66. // ... other MCP configurations
  67. },
  68. "llm": {
  69. "model": "qwen2.5-coder:7b-instruct",
  70. "baseUrl": "http://localhost:11434"
  71. }
  72. }
  73. ```
  74. ## Usage
  75. 1. Start the bridge:
  76. ```bash
  77. npm run start
  78. ```
  79. 2. Available commands:
  80. - `list-tools`: Show available tools
  81. - Regular text: Send prompts to the LLM
  82. - `quit`: Exit the program
  83. Example interactions:
  84. ```
  85. > Search the web for "latest TypeScript features"
  86. [Uses Brave Search MCP to find results]
  87. > Create a new folder called "project-docs"
  88. [Uses Filesystem MCP to create directory]
  89. > Send an email to user@example.com
  90. [Uses Gmail MCP to compose and send email]
  91. ```
  92. ## Technical Details
  93. ### Tool Detection
  94. The bridge includes smart tool detection based on user input:
  95. - Email operations: Detected by email addresses and keywords
  96. - Drive operations: Detected by file/folder keywords
  97. - Search operations: Contextually routed to appropriate search tool
  98. ### Response Processing
  99. Responses are processed through multiple stages:
  100. 1. LLM generates structured tool calls
  101. 2. Bridge validates and routes to appropriate MCP
  102. 3. MCP executes operation and returns result
  103. 4. Bridge formats response for user
  104. ## Extended Capabilities
  105. This bridge effectively brings Claude's tool capabilities to local models:
  106. - Filesystem manipulation
  107. - Web search and research
  108. - Email and document management
  109. - Code and GitHub interactions
  110. - Image generation
  111. - Persistent memory
  112. All while running completely locally with open-source models.
  113. ## Future Improvements
  114. - Add support for more MCPs
  115. - Implement parallel tool execution
  116. - Add streaming responses
  117. - Enhance error recovery
  118. - Add conversation memory
  119. - Support more Ollama models
  120. ## Related Projects
  121. This bridge integrates with the broader Claude ecosystem:
  122. - Model Context Protocol (MCP)
  123. - Claude Desktop Configuration
  124. - Ollama Project
  125. - Various MCP server implementations
  126. The result is a powerful local AI assistant that can match many of Claude's capabilities while running entirely on your own hardware.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.