mcp-chatbot  by 3choff

CLI chatbot for Model Context Protocol (MCP) integration

Created 1 year ago
250 stars

Top 100.0% on SourcePulse

GitHubView on GitHub
Project Summary

This project offers a command-line interface (CLI) chatbot that demonstrates the integration of the Model Context Protocol (MCP). It targets developers seeking to build LLM-powered applications with extensible tool capabilities, providing LLM provider flexibility by adhering to OpenAI API standards and enabling dynamic tool integration.

How It Works

The chatbot integrates the Model Context Protocol (MCP) for dynamic tool management. It loads configurations, initializes MCP servers (e.g., SQLite, Puppeteer), and discovers available tools. These tools are then formatted and included in the system prompt sent to an LLM compatible with OpenAI API standards. User input is processed, and the LLM decides whether to execute a tool or provide a direct response. Tool execution results are fed back to the LLM for interpretation, ensuring a coherent final response presented to the user.

Quick Start & Requirements

  • Primary install: pip install -r requirements.txt after cloning the repository.
  • Prerequisites: Python 3.10, python-dotenv, requests, mcp, uvicorn.
  • Setup: Create a .env file in the root directory with LLM_API_KEY=your_api_key_here. Configure MCP servers in servers_config.json.
  • Usage: Run python main.py to start the client. Type quit or exit to end the session.
  • Links: Repository available at https://github.com/3choff/mcp-chatbot.git.

Highlighted Details

  • LLM Provider Flexibility: Works with any LLM adhering to OpenAI API standards, demonstrated with Llama 3.2 90b on Groq and GPT-4o mini on GitHub Marketplace.
  • Dynamic Tool Integration: Tools are declared in the system prompt, enhancing LLM compatibility and enabling flexible functionality.
  • Server Configuration: Supports multiple MCP servers via a JSON configuration file (servers_config.json), mirroring the structure of the Claude Desktop App for straightforward integration.
  • Architecture: Features distinct classes for Configuration, Server, Tool, LLMClient, and ChatSession to manage components and orchestrate the interaction flow.

Maintenance & Community

Contributions and feedback are welcomed via GitHub issues and pull requests. No specific community channels (e.g., Discord, Slack) or roadmap details are provided in the README.

Licensing & Compatibility

This project is licensed under the MIT License, which is permissive for commercial use and closed-source linking.

Limitations & Caveats

The README presents the project as a demonstration example and does not explicitly detail limitations, alpha status, or known bugs.

Health Check
Last Commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
2 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Kent Dodds Kent Dodds(Cofounder of Remix), and
10 more.

agentic by transitive-bullshit

0.0%
18k
AI agent stdlib for LLM-based TypeScript tooling
Created 3 years ago
Updated 3 months ago
Feedback? Help us improve.