ollama-mcp-bridge
by jonigl·★ 86·综合分 47
Ollama MCP Bridge 提供 API 层面集成,将多个 MCP 服务器与 Ollama API 结合,为本地 LLM 应用启用动态 AI 工具集成。
概述
Ollama MCP Bridge 作为中间件服务,连接 Ollama 和多个 MCP 服务器,使 Ollama 能够透明地使用所有连接的 MCP 服务器工具。它为 Ollama 服务器提供完全兼容的 API 扩展,添加工具功能的同时保持与所有现有 Ollama 端点的兼容性。该桥接器支持多种传输类型(stdio、HTTP、SSE)、工具过滤和针对不同 MCP 服务器的可配置环境。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
什么时候选它
当您想在不更改现有应用程序代码的情况下扩展本地 Ollama 部署并添加 MCP 工具时,请选择此方案。
什么时候不要选它
如果您需要直接集成 MCP 而不通过 Ollama 层,或需要写入数据源权限(大多数工具只读),则不太适合。
此 server 暴露的工具
从 README 抽取出 4 个工具get_current_temperatureGet the current temperature for a specified location
get_forecastGet a weather forecast for a specified location
read_fileRead the contents of a file
list_filesList files in a specified directory
说明:Tool names were inferred from the MCP server configuration example and tool filtering documentation. The actual tool implementations depend on the connected MCP servers.
可对比工具
安装
安装选项
**使用 uvx 快速开始:**
uvx ollama-mcp-bridge**从 PyPI 安装:**
pip install --upgrade ollama-mcp-bridge**使用 Docker 运行:**
docker run -p 8000:8000 \
-e OLLAMA_URL=http://host.docker.internal:11434 \
-v "$PWD/mcp-config.json:/mcp-config.json" \
ghcr.io/jonigl/ollama-mcp-bridge:latest**Claude Desktop 配置:** 添加到 Claude Desktop config.json:
"mcpServers": {
"ollama-bridge": {
"command": "ollama-mcp-bridge",
"args": []
}
}FAQ
- 桥接器修改了哪些 Ollama 端点?
- 只有 `/api/chat` 端点被修改以包含 MCP 工具。所有其他端点都透明地代理到底层 Ollama 服务器,不做修改。
- 工具过滤如何工作?
- 您可以使用 `toolFilter` 配置为每个 MCP 服务器设置包含或排除过滤器。包含模式只允许指定的工具,而排除模式会阻止指定的工具。
ollama-mcp-bridge 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。