Skip to main content
Glama

Ollama MCP Server

Ollama MCP 服务器

Ollama 的 MCP(模型上下文协议)服务器,可实现 Ollama 本地 LLM 模型与 Claude Desktop 等 MCP 兼容应用程序之间的无缝集成。

特征

  • 列出可用的 Ollama 型号
  • 从 Ollama 提取新模型
  • 使用 Ollama 的聊天 API 与模特聊天
  • 获取详细模型信息
  • 自动端口管理
  • 环境变量配置

先决条件

  • Node.js(v16 或更高版本)
  • npm
  • Ollama 已在本地安装并运行

安装

手动安装

通过 npm 全局安装:

npm install -g @rawveg/ollama-mcp

在其他 MCP 应用程序中安装

要在其他 MCP 兼容应用程序(如 Cline 或 Claude Desktop)中安装 Ollama MCP 服务器,请将以下配置添加到应用程序的 MCP 设置文件中:

{ "mcpServers": { "@rawveg/ollama-mcp": { "command": "npx", "args": [ "-y", "@rawveg/ollama-mcp" ] } } }

设置文件位置因应用程序而异:

  • Claude 桌面:Claude 应用数据目录中的claude_desktop_config.json
  • Cline:VS Code 全局存储中的cline_mcp_settings.json

用法

启动服务器

只需运行:

ollama-mcp

服务器默认在 3456 端口启动。你可以使用 PORT 环境变量指定其他端口:

PORT=3457 ollama-mcp

环境变量

  • PORT :服务器端口(默认值:3456)。可以直接运行时使用:
    # When running directly PORT=3457 ollama-mcp
  • OLLAMA_API :Ollama API 端点(默认: http://localhost:11434

API 端点

  • GET /models - 列出可用模型
  • POST /models/pull - 拉取新模型
  • POST /chat - 与模特聊天
  • GET /models/:name - 获取模型详细信息

发展

  1. 克隆存储库:
git clone https://github.com/rawveg/ollama-mcp.git cd ollama-mcp
  1. 安装依赖项:
npm install
  1. 构建项目:
npm run build
  1. 启动服务器:
npm start

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

然而,这并不意味着未经事先讨论和同意,即可将该项目纳入第三方服务或商业平台。虽然我之前接受了贡献(例如 Dockerfile 和相关的 README 更新)以支持与Smithery等服务的集成,但类似服务Glama最近的举动要求我重新评估此政策。

Glama 未经通知或同意,就选择将开源 MCP 项目纳入其商业产品,并随后创建了问题请求,要求维护人员进行无偿工作,以确保与其平台的兼容性。这种行为——利用社区劳动牟利,却不进行对话或提供报酬——不仅缺乏考虑,而且在道德上存在问题

因此,为了保护本项目及其贡献者的完整性,许可证已更新为GNU Affero 通用公共许可证 v3.0 (AGPL-3.0) 。此变更确保任何软件的使用——尤其是在商业或基于服务的平台上——必须完全遵守 AGPL 的条款获得单独的商业许可证。如果项目正在积极盈利,仅仅提供原始来源链接是不够的。如果您希望将此项目纳入商业产品,请先联系我们,讨论许可条款。

执照

AGPL v3.0

有关的

该项目之前采用 MIT 许可证。自 2025 年 4 月 20 日起,该项目现采用 AGPL-3.0 许可证,以防止未经授权的商业利用。如果您在此变更之前使用此项目,请参阅相关的 Git 标签或提交以了解适用的许可证。

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

实现Ollama本地LLM模型与MCP兼容应用程序的无缝集成,支持模型管理和聊天交互。

  1. 特征
    1. 先决条件
      1. 安装
        1. 手动安装
        2. 在其他 MCP 应用程序中安装
      2. 用法
        1. 启动服务器
        2. 环境变量
        3. API 端点
      3. 发展
        1. 贡献
          1. 执照
            1. 有关的

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                An interactive chat interface that combines Ollama's LLM capabilities with PostgreSQL database access through the Model Context Protocol (MCP). Ask questions about your data in natural language and get AI-powered responses backed by real SQL queries.
                Last updated -
                45
                TypeScript
              • A
                security
                A
                license
                A
                quality
                MCP Ollama server integrates Ollama models with MCP clients, allowing users to list models, get detailed information, and interact with them through questions.
                Last updated -
                3
                12
                Python
                MIT License
                • Apple
              • A
                security
                F
                license
                A
                quality
                A bridge that enables seamless integration of Ollama's local LLM capabilities into MCP-powered applications, allowing users to manage and run AI models locally with full API coverage.
                Last updated -
                10
                33
                JavaScript
                • Apple
              • -
                security
                F
                license
                -
                quality
                A generic Model Context Protocol framework for building AI-powered applications that provides standardized ways to create MCP servers and clients for integrating LLMs with support for Ollama and Supabase.
                Last updated -
                TypeScript

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/rawveg/ollama-mcp'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server