AS

avento/simple_mcp_client

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

11 stars 5 forks 品質 58 トレンド 8MIT

Simple MCP Client for OpenAI/Deepseek R1/V3

概要

A simple chatbot implementation using the Model Context Protocol (MCP) to interact with various tools and LLM providers. - Connect to MCP servers and list available tools - Execute MCP tools with retry mechanism - Interact with LLM providers through OpenAI-compatible API - Manage server connections and resources - Process user input and LLM responses - Python 3.10+ - uv - MCP server configuration 2. Create and activate virtual environment using uv: 1. Edit .env file with your LLM provider credentials: 2. Configure MCP servers in servers_config.json: Available commands: - Type your message to chat - Type 'quit' or 'exit' to end the session 1. Fork the repository 2. Create your feature branch (git checkout -b feature/AmazingFeature) 3. Commit your changes (git commit -m 'Add some AmazingFeature') 4. Push to the branch (git push origin feature/AmazingFeature) 5. Open a Pull Request

README

MCP Simple Chatbot

A simple chatbot implementation using the Model Context Protocol (MCP) to interact with various tools and LLM providers.

Features

  • Connect to MCP servers and list available tools
  • Execute MCP tools with retry mechanism
  • Interact with LLM providers through OpenAI-compatible API
  • Manage server connections and resources
  • Process user input and LLM responses

Requirements

  • Python 3.10+
  • uv
  • MCP server configuration

Installation

  1. Clone the repository:
git clone https://github.com/your-repo/mcp-simple-chatbot.git
cd mcp-simple-chatbot
  1. Create and activate virtual environment using uv:
uv venv .venv
# On Windows:
.\.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate
  1. Install dependencies:
uv pip install -r requirements.txt
  1. Copy example configuration files:
cp .env.example .env
cp servers_config.json.example servers_config.json

Configuration

  1. Edit .env file with your LLM provider credentials:

For OpenAI:

LLM_API_KEY=your-openai-api-key
LLM_BASE_URL=https://api.openai.com/v1
LLM_MODEL_ID=gpt-4

For Deepseek:

LLM_API_KEY=your-deepseek-api-key
LLM_BASE_URL=https://api.deepseek.com/v1
LLM_MODEL_ID=deepseek-chat
  1. Configure MCP servers in servers_config.json:
{
  "mcpServers": {
    "server-name": {
      "command": "npx",
      "args": ""
    }
  }
}

Usage

  1. Activate virtual environment:
# On Windows:
.\.venv\Scripts\activate
# On macOS/Linux:
source .venv/bin/activate
  1. Run the chatbot:
python main.py

Available commands:

  • Type your message to chat
  • Type ‘quit’ or ‘exit’ to end the session

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

GitHub で README 全文を見る

インストール

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

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "server-name": { "command": "npx", "args": "" } } }