RE

rakesh-eltropy/mcp-client

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

49 stars 18 forks Качество 47 Тренд 13MIT

rakesh-eltropy/mcp-клиент - кандидат на сервер MCP, импортированный из https://github.com/rakesh-eltropy/mcp-client.

Обзор

rakesh-eltropy/mcp-клиент - кандидат на сервер MCP, импортированный из https://github.com/rakesh-eltropy/mcp-client.

Обзор (машинный перевод)

Простой REST API и клиент CLI для взаимодействия с серверами протокола Model Context Protocol (MCP).

Ключевые особенности

###1. MCP-совместимые серверы Поддерживает любые MCP-совместимые серверы. Преднастроенные серверы по умолчанию: SQLite (test.db был предоставлен с данными образцов продукции) ** Храбрый поиск** Дополнительные серверы MCP могут быть добавлены в файл mcp-server-config.json.

###2 Интегрированный с LangChain Использует LangChain для выполнения подсказок LLM. Позволяет нескольким MCP-серверам сотрудничать и отвечать на конкретный запрос одновременно.

###3 Поддержка провайдера LLM Совместим с любым поставщиком LLM, который поддерживает API с функциональными возможностями.

  • Примеры: ** OpenAI**
  • ** Клод** ** Джемини** ** AWS Nova**
  • Грок Олама* По сути, все поставщики LLM поддерживаются до тех пор, пока они предоставляют API на основе функций. Пожалуйста, обратитесь к документации Langchain для получения более подробной информации.

Настройка

  1. Клонировать хранилище:

  2. ** Навигация в директорию проекта** После клонирования репозитория перейдите в каталог проекта:

  3. Установить переменную среды OPENAI API KEY:

Вы также можете установить OPENAI_API_KEY в файле mcp-server-config.json.

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

MCP REST API and CLI Client

A simple REST API and CLI client to interact with Model Context Protocol (MCP) servers.

Key Features

1. MCP-Compatible Servers

  • Supports any MCP-compatible servers servers.
  • Pre-configured default servers:
    • SQLite (test.db has been provided with sample products data)
    • Brave Search
  • Additional MCP servers can be added in the mcp-server-config.json file

2. Integrated with LangChain

  • Leverages LangChain to execute LLM prompts.
  • Enables multiple MCP servers to collaborate and respond to a specific query simultaneously.

3. LLM Provider Support

  • Compatible with any LLM provider that supports APIs with function capabilities.
  • Examples:
    • OpenAI
    • Claude
    • Gemini
    • AWS Nova
    • Groq
    • Ollama
    • Essentially all LLM providers are supported as long as they provide a function-based API. Please refer langchain documentation for more details.

Setup

  1. Clone the repository:

    git clone https://github.com/rakesh-eltropy/mcp-client.git
    
  2. Navigate to the Project Directory After cloning the repository, move to the project directory:

    cd mcp-client
    
  3. Set the OPENAI_API_KEY environment variable:

    export OPENAI_API_KEY=your-openai-api-key
    

    You can also set the OPENAI_API_KEY in the mcp-server-config.json file.

    You can also set the provider and model in the mcp-server-config.json file. e.g. provider can be ollama and model can be llama3.2:3b.

4.Set the BRAVE_API_KEY environment variable:

export BRAVE_API_KEY=your-brave-api-key

You can also set the BRAVE_API_KEY in the mcp-server-config.json file. You can get the free BRAVE_API_KEY from Brave Search API.

  1. Running from the CLI:

    uv run cli.py
    

    To explore the available commands, use the help option. You can chat with LLM using chat command. Sample prompts:

      What is the capital city of India?
    
      Search the most expensive product from database and find more details about it from amazon?
    
  2. Running from the REST API:

    uvicorn app:app --reload
    

    You can use the following curl command to chat with llm:

    curl -X POST -H "Content-Type: application/json" -d '{"message": "list all the products from my local database?"}' http://localhost:8000/chat
    

    You can use the following curl command to chat with llm with streaming:

    curl -X POST -H "Content-Type: application/json" -d '{"message": "list all the products from my local database?", "streaming": true}' http://localhost:8000/chat
Открыть полный README на GitHub

Установка

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

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →