AM

adhikasp/mcp-client-cli

Developer tools

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

675 stars 83 forks 품질 74 트렌드 21MIT

LLM 프롬프트를 실행하고 MCP 클라이언트를 구현하는 간단한 CLI입니다.

개요

LLM 프롬프트를 실행하고 모델 컨텍스트 프로토콜(MCP) 클라이언트를 구현하는 간단한 CLI 프로그램입니다. 터미널에서 편리하게 MCP 호환 서버를 사용할 수 있습니다. 이 클라이언트는 Claude Desktop 옆에 있는 대체 클라이언트 역할을 합니다. 또한 OpenAI, Groq 같은 LLM 제공업체나 llama를 통한 로컬 LLM 모델 등 어떤 LLM 제공업체도 사용할 수 있습니다. 2. LLM 및 MCP 서버를 구성할 ~/.llm/config.json 파일을 생성하세요: 참고: - 구성 형식에 대한 완전한 문서는 CONFIG.md 을 참조하세요 - 실행 전에 사용자 확인이 필요한 도구를 지정하려면 requires_confirmation을 사용하세요 - LLM API 키는 환경 변수 LLM_API_KEY 또는 OPENAI_API_KEY를 통해 설정할 수 있습니다 - 설정 파일은 ~/.llm/config.json 또는 $PWD/.llm/config.json에 배치할 수 있습니다. - 구성 변경을 원한다면 JSON config 파일에 //를 주석으로 표시할 수 있습니다. 따옴표를 생략해도 되지만, bash의 특수 문자인 &, |, ; 쉘에서 해석될 수 있으니 주의하세요.

개요(AI 번역)

LLM 프롬프트를 실행하고 모델 컨텍스트 프로토콜(MCP) 클라이언트를 구현하는 간단한 CLI 프로그램입니다.

터미널에서 편리하게 MCP 호환 서버를 사용할 수 있습니다.

이 클라이언트는 Claude Desktop 옆에 있는 대체 클라이언트 역할을 합니다. 또한 OpenAI, Groq 같은 LLM 제공업체나 llama를 통한 로컬 LLM 모델 등 어떤 LLM 제공업체도 사용할 수 있습니다.

준비

  1. PIP를 통한 설치:

  2. LLM 및 MCP 서버를 구성할 ~/.llm/config.json 파일을 생성하세요:

참고:

  • 구성 형식에 대한 완전한 문서는 CONFIG.md 를 참조하세요
  • requires_confirmation를 사용하여 실행 전에 사용자 확인이 필요한 도구를 지정합니다
  • LLM API 키는 환경 변수 LLM_API_KEY 또는 [[T3]를 통해서도 설정할 수 있습니다.
  • 설정 파일은 ~/.llm/config.json 또는 $PWD/.llm/config.json 중 하나에 배치할 수 있습니다.
  • 구성 설정을 바꾸고 싶다면 //로 JSON config 파일에 주석을 달 수 있습니다
  1. CLI 실행:

사용

기본 사용법

따옴표를 생략해도 되지만, &, |, ; 같은 bash 특수 문자는 셸에서 해석될 수 있으니 주의하세요.

다른 명령어나 파일에서 입력을 파이프로 받을 수도 있습니다:

이미지 입력

멀티모달 LLM으로 이미지 파일을 분석하기 위해 파이프로 전송할 수 있습니다:

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

README

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

MCP CLI client

A simple CLI program to run LLM prompt and implement Model Context Protocol (MCP) client.

You can use any MCP-compatible servers from the convenience of your terminal.

This act as alternative client beside Claude Desktop. Additionally you can use any LLM provider like OpenAI, Groq, or local LLM model via llama.

Setup

  1. Install via pip:

    pip install mcp-client-cli
    
  2. Create a ~/.llm/config.json file to configure your LLM and MCP servers:

    {
      "systemPrompt": "You are an AI assistant helping a software engineer...",
      "llm": {
        "provider": "openai",
        "model": "gpt-4",
        "api_key": "your-openai-api-key",
        "temperature": 0.7,
        "base_url": "https://api.openai.com/v1"  // Optional, for OpenRouter or other providers
      },
      "mcpServers": {
        "fetch": {
          "command": "uvx",
          "args": ["mcp-server-fetch"],
          "requires_confirmation": ["fetch"],
          "enabled": true,  // Optional, defaults to true
          "exclude_tools": []  // Optional, list of tool names to exclude
        },
        "brave-search": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-brave-search"],
          "env": {
            "BRAVE_API_KEY": "your-brave-api-key"
          },
          "requires_confirmation": ["brave_web_search"]
        },
        "youtube": {
          "command": "uvx",
          "args": ["--from", "git+https://github.com/adhikasp/mcp-youtube", "mcp-youtube"]
        }
      }
    }
    

    Note:

    • See CONFIG.md for complete documentation of the configuration format
    • Use requires_confirmation to specify which tools need user confirmation before execution
    • The LLM API key can also be set via environment variables LLM_API_KEY or OPENAI_API_KEY
    • The config file can be placed in either ~/.llm/config.json or $PWD/.llm/config.json
    • You can comment the JSON config file with // if you like to switch around the configuration
  3. Run the CLI:

    llm "What is the capital city of North Sumatra?"
    

Usage

Basic Usage

$ llm What is the capital city of North Sumatra?
The capital city of North Sumatra is Medan.

You can omit the quotes, but be careful with bash special characters like &, |, ; that might be interpreted by your shell.

You can also pipe input from other commands or files:

$ echo "What is the capital city of North Sumatra?" | llm
The capital city of North Sumatra is Medan.

$ echo "Given a location, tell me its capital city." > instructions.txt
$ cat instruction.txt | llm "West Java"
The capital city of West Java is Bandung.

Image Input

GitHub에서 전체 README 보기

설치

uvx mcp-server-fetch
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "systemPrompt": "You are an AI assistant helping a software engineer...", "llm": { "provider": "openai", "model": "gpt-4", "api_key": "your-openai-api-key", "temperature": 0.7, "base_url": "https://api.openai.com/v1" // Optional, for OpenRouter or other providers }, "mcpServers": { "fetch": { "command": "uvx", "args": ["mcp-server-fetch"], "requires_confirmation": ["fetch"], "enabled": true, // Optional, defaults to true "exclude_tools": [] // Optional, list of tool names to exclude }, "brave-search": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-brave-search"], "env": { "BRAVE_API_KEY": "your-brave-api-key" }, "requires_confirmation": ["brave_web_search"] }, "youtube": { "command": "uvx", "args": ["--from", "git+https://github.com/adhikasp/mcp-youtube", "mcp-youtube"] } } }