NO

nighttrek/ollama-mcp

API development

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

75 stars 17 forks 품질 57 트렌드 14

nighttrek/ollama-mcp는 MCP 서버 후보로 https://github.com/nighttrek/ollama-mcp.에서 수입

개요

nighttrek/ollama-mcp는 MCP 서버 후보로 https://github.com/nighttrek/ollama-mcp.에서 수입

개요(AI 번역)

Ollama와 Model Context Protocol (MCP) 사이의 강력한 교량은 MCP 전원 응용 분야에 Ollama의 로컬 LLM 기능의 원활한 통합을 가능하게합니다.

의 특징

완전한 Ollama 통합

-Full API Coverage: 깨끗한 MCP 인터페이스를 통해 모든 필수 Ollama 기능 접근 -OpenAI-Compatible Chat: OpenAI의 채팅 완료 API를 위한 드롭인 교체

  • Local LLM Power: AI 모델을 로컬로 실행하여 전체 제어 및 개인 정보 보호

핵심 능력

  • 모형 관리**

  • 레지스트리에서 풀 모델

  • 등록에 푸시 모델

  • 사용 가능한 모델 목록

  • Modelfiles에서 사용자 정의 모델 만들기

  • 모델 복사 및 제거

  • ₢ 킹

  • customizable 신속한 모델을 실행

  • 시스템/user/assistant 역할과 채팅 완료 API

  • 구성가능한 모수 (온도, timeout)

  • 직접적인 응답을 위한 익지않는 형태 지원

  • 542 ** 서버 제어 **

  • Ollama 서버 시작 및 관리

  • 상세 모델 정보보기

  • 오류 처리 및 타임아웃 관리

⭐ 시작하기

# 필수품

  • 시스템에 Ollama 설치
  • Node.js 및 npm/pnpm

설치

  1. 의존성 설치:

  2. 서버 구축:

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

Ollama MCP Server

🚀 A powerful bridge between Ollama and the Model Context Protocol (MCP), enabling seamless integration of Ollama’s local LLM capabilities into your MCP-powered applications.

🌟 Features

Complete Ollama Integration

  • Full API Coverage: Access all essential Ollama functionality through a clean MCP interface
  • OpenAI-Compatible Chat: Drop-in replacement for OpenAI’s chat completion API
  • Local LLM Power: Run AI models locally with full control and privacy

Core Capabilities

  • 🔄 Model Management

    • Pull models from registries
    • Push models to registries
    • List available models
    • Create custom models from Modelfiles
    • Copy and remove models
  • 🤖 Model Execution

    • Run models with customizable prompts
    • Chat completion API with system/user/assistant roles
    • Configurable parameters (temperature, timeout)
    • Raw mode support for direct responses
  • 🛠 Server Control

    • Start and manage Ollama server
    • View detailed model information
    • Error handling and timeout management

🚀 Getting Started

Prerequisites

  • Ollama installed on your system
  • Node.js and npm/pnpm

Installation

  1. Install dependencies:
pnpm install
  1. Build the server:
pnpm run build

Configuration

Add the server to your MCP configuration:

For Claude Desktop:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "ollama": {
      "command": "node",
      "args": ["/path/to/ollama-server/build/index.js"],
      "env": {
        "OLLAMA_HOST": "http://127.0.0.1:11434"  // Optional: customize Ollama API endpoint
      }
    }
  }
}

🛠 Usage Examples

Pull and Run a Model

// Pull a model
await mcp.use_mcp_tool({
  server_name: "ollama",
  tool_name: "pull",
  arguments: {
    name: "llama2"
  }
});

// Run the model
await mcp.use_mcp_tool({
  server_name: "ollama",
  tool_name: "run",
  arguments: {
    name: "llama2",
    prompt: "Explain quantum computing in simple terms"
  }
});

Chat Completion (OpenAI-compatible)

await mcp.use_mcp_tool({
  server_name: "ollama",
  tool_name: "chat_completion",
  arguments: {
    model: "llama2",
    messages: [
      {
        role: "system",
        content: "You are a helpful assistant."
      },
      {
        role: "user",
        content: "What is the meaning of life?"
      }
    ],
    temperature: 0.7
  }
});

Create Custom Model

await mcp.use_mcp_tool({
  server_name: "ollama",
  tool_name: "create",
  arguments: {
    name: "custom-model",
    modelfile: "./path/to/Modelfile"
  }
});

🔧 Advanced Configuration

  • OLLAMA_HOST: Configure custom Ollama API endpoint (default: http://127.0.0.1:11434)
  • Timeout settings for model execution (default: 60 seconds)
  • Temperature control for response randomness (0-2 range)
GitHub에서 전체 README 보기

설치

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

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "ollama": { "command": "node", "args": ["/path/to/ollama-server/build/index.js"], "env": { "OLLAMA_HOST": "http://127.0.0.1:11434" // Optional: customize Ollama API endpoint } } } }