AM

ausboss/mcp-ollama-agent

Developer tools

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

30 stars 13 forks 품질 54 트렌드 0

TypeScript 예제는 모델 Context Protocol (MCP) 서버와 Ollama의 통합을 보여줍니다.

개요

이 프로젝트는 모델 Context Protocol (MCP) 서버와 Ollama 간의 통합을 보여줌으로써 AI 모델을 통합 인터페이스를 통해 다양한 도구와 상호 작용할 수 있습니다. - 여러 MCP 서버 (both uvx 및 npx 테스트) 지원 - 파일 시스템 운영 및 웹 연구를위한 내장 지원 - claude desktop config.json과 유사한 mcp-config.json을 통해 쉽게 구성 - LLM없이 웹 및 파일 시스템 도구를 테스트하기위한 독립 데모 모드를 지원하는 Ollama 통합과 대화 형 채팅 인터페이스 - Node.js (version 18 이상) - Ollama 설치 및 실행 - 당신이 사용하려는 MCP 도구 글로벌 설치 : - mcpServers 섹션에 MCP 호환 서버 추가 - 호스트 및 모델 구성 (지원 기능 호출) - Python (uvx) 및 Node.js (npx) MCP 서버 모두 지원 이 예제는이 모델 qwen2.5 :latest를 사용 몇몇 국부적으로 모형은 공구 선택에 도움 필요로 할지도 모릅니다. ChatManager에서 시스템 프롬프트를 지정합니다.

개요(AI 번역)

이 프로젝트는 모델 Context Protocol (MCP) 서버와 Ollama 간의 통합을 보여줌으로써 AI 모델을 통합 인터페이스를 통해 다양한 도구와 상호 작용할 수 있습니다.

✨ 특징

  • 여러 MCP 서버 지원 (테스트 된 uvx 및 npx)
  • 파일 시스템 운영 및 웹 연구에 대한 내장 지원
  • mcp-config.json]를 통한 쉬운 구성 claude_desktop_config.json
  • Ollama 통합과 대화 형 채팅 인터페이스는 모든 도구를 지원해야
  • LLM없이 웹 및 파일 시스템 도구를 테스트하기위한 독립 데모 모드

⭐ 시작하기

  1. ** 필수품: **
  • Node.js (버전 18 이상)
  • Ollama 설치 및 실행
  • 글로벌 MCP 도구 설치:
  1. ** 복제 및 설치 : **

  2. ** 도구 및 도구가 mcp-config.json에서 Ollama 모델을 지원 구성 : **

  3. ** LLM없이 파일 시스템 및 웹 검색 도구를 테스트 데모를 : **

  4. ** Ollama와 채팅 인터페이스를 시작:**

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

  • MCP 서버: MCP 호환 서버 추가 mcpServers] 섹션
  • 올라마: 호스트 및 모델 구성 (근육 지원 기능 호출)
  • Python (uvx) 및 Node를 모두 지원합니다.

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

README

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

TypeScript MCP Agent with Ollama Integration

This project demonstrates integration between Model Context Protocol (MCP) servers and Ollama, allowing AI models to interact with various tools through a unified interface.

✨ Features

  • Supports multiple MCP servers (both uvx and npx tested)
  • Built-in support for file system operations and web research
  • Easy configuration through mcp-config.json similar to claude_desktop_config.json
  • Interactive chat interface with Ollama integration that should support any tools
  • Standalone demo mode for testing web and filesystem tools without an LLM

🚀 Getting Started

  1. Prerequisites:

    • Node.js (version 18 or higher)

    • Ollama installed and running

    • Install the MCP tools globally that you want to use:

      # For filesystem operations
      npm install -g @modelcontextprotocol/server-filesystem
      
      # For web research
      npm install -g @mzxrai/mcp-webresearch
      
  2. Clone and install:

    git clone https://github.com/ausboss/mcp-ollama-agent.git
    cd mcp-ollama-agent
    npm install
    
    
  3. Configure your tools and tool supported Ollama model in mcp-config.json:

    {
      "mcpServers": {
        "filesystem": {
          "command": "npx",
          "args": ["@modelcontextprotocol/server-filesystem", "./"]
        },
        "webresearch": {
          "command": "npx",
          "args": ["-y", "@mzxrai/mcp-webresearch"]
        }
      },
      "ollama": {
        "host": "http://localhost:11434",
        "model": "qwen2.5:latest"
      }
    }
    
  4. Run the demo to test filesystem and webresearch tools without an LLM:

    npx tsx ./src/demo.ts
    
  5. Or start the chat interface with Ollama:

    npm start
    

⚙️ Configuration

  • MCP Servers: Add any MCP-compatible server to the mcpServers section
  • Ollama: Configure host and model (must support function calling)
  • Supports both Python (uvx) and Node.js (npx) MCP servers

💡 Example Usage

This example used this model qwen2.5:latest

Chat started. Type "exit" to end the conversation.
You: can you use your list directory tool to see whats in test-directory then use your read file tool to read it to me?
Model is using tools to help answer...
Using tool: list_directory
With arguments: { path: 'test-directory' }
Tool result: [ { type: 'text', text: '[FILE] test.txt' } ]
Assistant:
Model is using tools to help answer...
Using tool: read_file
With arguments: { path: 'test-directory/test.txt' }
Tool result: [ { type: 'text', text: 'rosebud' } ]
Assistant: The content of the file `test.txt` in the `test-directory` is:
rosebud
You: thanks
Assistant: You're welcome! If you have any other requests or need further assistance, feel free to ask.

System Prompts

GitHub에서 전체 README 보기

설치

npx @modelcontextprotocol/server-filesystem ./
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "filesystem": { "command": "npx", "args": ["@modelcontextprotocol/server-filesystem", "./"] }, "webresearch": { "command": "npx", "args": ["-y", "@mzxrai/mcp-webresearch"] } }, "ollama": { "host": "http://localhost:11434", "model": "qwen2.5:latest" } }