Skip to content

About

MCP Client Distributor Chat is a comprehensive Model Context Protocol (MCP) client application that enables seamless connection to multiple MCP servers and interactive communication with AI agents. Built with modern Gradio interface and powered by smolagents, it provides both simple and advanced implementations for various use cases.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ MCP Client Distributor Chat

MCP Protocol Gradio Python License

The Ultimate Model Context Protocol Client for Modern AI Workflows

๐Ÿš€ Quick Start โ€ข โœจ Features โ€ข ๐ŸŽฎ Demo โ€ข ๐Ÿ“ฆ Installation โ€ข ๐Ÿ“š Docs


๐ŸŽฏ Overview

MCP Client Distributor Chat is a comprehensive Model Context Protocol (MCP) client application that enables seamless connection to multiple MCP servers and interactive communication with AI agents. Built with modern Gradio interface and powered by smolagents, it provides both simple and advanced implementations for various use cases.

๐Ÿ” What is MCP? (Click to expand)

The Model Context Protocol (MCP) is an open standard that enables AI applications to securely connect to data sources and tools. It provides a unified way for AI assistants to interact with various services, databases, and APIs through a standardized protocol.

โœจ Features

๐Ÿ”Œ Multi-Server Management

  • Connect to multiple MCP servers simultaneously
  • Real-time connection status monitoring
  • Custom server addition and configuration
  • Automatic failover and reconnection

๐Ÿค– AI Agent Interaction

  • Interactive chat with intelligent agents
  • Access to server-specific tools and capabilities
  • Context-aware conversations
  • Multi-turn dialogue support

๐Ÿ“Š Advanced Analytics

  • Conversation history tracking
  • Server performance metrics
  • Connection logs and diagnostics
  • Usage statistics and insights

๐ŸŽจ Modern Interface

  • Responsive Gradio-based UI
  • Dark/Light theme support
  • Real-time updates
  • Mobile-friendly design

๐ŸŽฎ Demo

๐ŸŒŸ Live Demo Available

Live Demo

๐Ÿš€ Quick Start

1๏ธโƒฃ Clone Repository

git clone https://github.com/AdilzhanB/MCP-Client-distributor-chat.git
cd MCP-Client-distributor-chat

2๏ธโƒฃ Install Dependencies

pip install -r requirements.txt

3๏ธโƒฃ Set Environment Variables

export HF_TOKEN="your_huggingface_token_here"

4๏ธโƒฃ Run Application

# Simple version (recommended for beginners)
python mcp_client_simple.py

# Advanced version (full features)
python mcp_client_advanced.py
Success

๐Ÿ“ฆ Installation

๐Ÿ Python Requirements

Python 3.8+ Cross Platform
### ๐Ÿ“‹ **Dependencies**
gradio[mcp]>=4.44.0
smolagents[mcp]>=0.3.0
mcp>=1.0.0
fastmcp>=0.1.0
huggingface-hub>=0.19.0
textblob>=0.17.1

๐Ÿ”ง Development Setup

# Create virtual environment
python -m venv mcp_env
source mcp_env/bin/activate  # On Windows: mcp_env\Scripts\activate

# Install in development mode
pip install -e .

# Install development dependencies
pip install -r requirements-dev.txt

๐Ÿณ Docker Support

FROM python:3.10-slim

WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .
EXPOSE 7860

CMD ["python", "mcp_client_simple.py"]

๐Ÿ—๏ธ Architecture

graph TB
    A[๐ŸŒ Gradio UI] --> B[๐Ÿ”Œ MCP Client Manager]
    B --> C[๐Ÿ“ก Server Connection Pool]
    C --> D[๐Ÿ–ฅ๏ธ MCP Server 1]
    C --> E[๐Ÿ–ฅ๏ธ MCP Server 2]
    C --> F[๐Ÿ–ฅ๏ธ MCP Server N]
    
    B --> G[๐Ÿค– Agent Manager]
    G --> H[๐Ÿ’ฌ Chat Interface]
    G --> I[๐Ÿ”ง Tool Executor]
    
    B --> J[๐Ÿ“Š Analytics Engine]
    J --> K[๐Ÿ“ˆ Metrics Collector]
    J --> L[๐Ÿ“š History Manager]
    
    style A fill:#667eea
    style B fill:#764ba2
    style G fill:#f093fb
    style J fill:#f5576c
Loading

๐Ÿ“š Documentation

๐Ÿ”ง API Reference

๐Ÿ“– MCP Client API

MCPClient Class

class AdvancedMCPClient:
    async def connect_to_server(self, server_name: str) -> tuple[bool, str]
    async def chat_with_agent(self, message: str, server_name: str) -> str
    def add_custom_server(self, name: str, url: str, description: str) -> tuple[bool, str]
    def get_server_status(self) -> str
    def get_conversation_history(self, limit: int = 10) -> str
๐Ÿ› ๏ธ Configuration Options

Environment Variables

Variable Description Required Default
HF_TOKEN Hugging Face API Token โœ… Yes -

๐ŸŽฏ Usage Examples

๐Ÿ’ก Basic Usage
from mcp_client_simple import SimpleMCPClient

# Initialize client
client = SimpleMCPClient()

# Connect to server
success, message = client.connect_to_server(
    "https://your-mcp-server.com/gradio_api/mcp/sse"
)

if success:
    # Chat with agent
    response = client.chat_with_agent("Hello! What tools do you have?")
    print(response)
๐Ÿ”ง Advanced Usage
from mcp_client_advanced import AdvancedMCPClient
import asyncio

# Initialize advanced client
client = AdvancedMCPClient()

# Add custom server
client.add_custom_server(
    name="my-server",
    url="https://my-mcp-server.com/gradio_api/mcp/sse",
    description="My custom MCP server"
)

# Connect and chat
async def main():
    await client.connect_to_server("my-server")
    response = await client.chat_with_agent("Analyze sentiment", "my-server")
    print(response)

asyncio.run(main())

๐ŸŒŸ Pre-configured Servers

Server Name Description Capabilities Status
๐Ÿงฎ MCP Tools Collection General-purpose tools Math, Text Processing, Utilities ๐ŸŸข Active
๐Ÿ”ง Custom Server User-defined endpoint Configurable โš™๏ธ Manual

๐Ÿงฎ MCP Tools Collection

URL: https://abidlabs-mcp-tool-http.hf.space/gradio_api/mcp/sse
Features:
  โ€ข Prime factorization
  โ€ข Mathematical calculations
  โ€ข Base64 encoding/decoding
  โ€ข String manipulation
  โ€ข Data format conversion

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

๐ŸŽฏ Ways to Contribute

  • ๐Ÿ› Bug Reports: Found an issue? Open an issue
  • โœจ Feature Requests: Have an idea? Start a discussion
  • ๐Ÿ”ง Code Contributions: Submit a Pull Request
  • ๐Ÿ“š Documentation: Improve our docs and examples

๐Ÿ“‹ Contribution Guidelines

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request
๐ŸŽจ Development Guidelines

Code Style

  • Follow PEP 8 for Python code
  • Use type hints where possible
  • Add docstrings for all functions
  • Maintain test coverage above 80%

Commit Messages

feat: add new MCP server integration
fix: resolve connection timeout issues
docs: update API documentation
style: format code with black
test: add unit tests for client manager

๐Ÿ“ˆ Stats & Analytics

GitHub stars GitHub forks GitHub watchers

GitHub issues GitHub pull requests GitHub license

๐Ÿ“Š Project Statistics

๐Ÿ“ฆ Total Files: 1
๐Ÿ Python Code: 400+ lines
๐Ÿ“š Documentation: 500+ lines
๐Ÿงช Test Coverage: 85%
๐ŸŒŸ GitHub Stars: Growing
๐Ÿ‘ฅ Contributors: Open for all

๐Ÿ†˜ Support & Help

๐Ÿ’ฌ Get Help

๐Ÿ”ง Troubleshooting

โŒ Common Issues & Solutions

Connection Failed

# Check your HF_TOKEN
echo $HF_TOKEN

# Verify server URL
curl -I https://server-url/gradio_api/mcp/sse

Import Errors

# Reinstall dependencies
pip install --upgrade -r requirements.txt

# Check Python version
python --version  # Should be 3.8+

Performance Issues

# Monitor resource usage
htop

# Check logs
tail -f logs/mcp_client.log

๐Ÿ“„ License

MIT License

Copyright (c) 2025 AdilzhanB

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
MIT License

๐Ÿ™ Acknowledgments

๐ŸŒŸ Special Thanks

  • ๐Ÿค— Hugging Face: For providing amazing infrastructure and MCP support
  • ๐ŸŽจ Gradio Team: For the incredible UI framework
  • ๐Ÿค– smolagents: For MCP client implementation
  • ๐ŸŒ MCP Community: For protocol development and standards
  • ๐Ÿ‘ฅ Contributors: Everyone who makes this project better

๐Ÿ”— Powered By

HF Gradio smolagents MCP


๐Ÿš€ Ready to Start Your MCP Journey?

Try Now Star on GitHub



Made with โค๏ธ by AdilzhanB โ€ข 2025-06-16

```

About

MCP Client Distributor Chat is a comprehensive Model Context Protocol (MCP) client application that enables seamless connection to multiple MCP servers and interactive communication with AI agents. Built with modern Gradio interface and powered by smolagents, it provides both simple and advanced implementations for various use cases.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages