Skip to content

alejoair/mcp-open-client

Repository files navigation

MCP Open Client

A modern, web-based chat application that implements the Model Context Protocol (MCP) for seamless integration between Large Language Models and external tools.

πŸš€ What is MCP Open Client?

MCP Open Client is a NiceGUI-based chat application that serves as a bridge between AI models and external tools through the Model Context Protocol (MCP). Think of it as "USB-C for AI" - a universal interface that allows any compatible LLM to securely interact with external data sources, tools, and services.

Key Features

  • πŸ€– Multi-LLM Support: Compatible with Claude, OpenAI, and other OpenAI-compatible APIs
  • πŸ”§ MCP Integration: Connect to MCP servers for enhanced functionality
  • πŸ’¬ Modern Chat Interface: Clean, responsive web UI built with NiceGUI
  • πŸ“š Conversation Management: Save, load, and organize your chat history
  • βš™οΈ Easy Configuration: Web-based settings management
  • 🌐 Local & Remote: Works with local models and cloud APIs
  • πŸ”’ Secure: All configurations stored locally

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Web Client    │◄──►│   MCP Client    │◄──►│  MCP Servers    β”‚
β”‚   (NiceGUI)     β”‚    β”‚  (Protocol)     β”‚    β”‚  (FastMCP)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                       β”‚                       β”‚
         β–Ό                       β–Ό                       β–Ό
    Chat Interface         API Integration         External Tools
    β€’ Conversations        β€’ OpenAI API           β€’ File Systems
    β€’ History             β€’ Claude API            β€’ Databases
    β€’ Settings            β€’ Local Models          β€’ Web Services

πŸ“¦ Installation

Option 1: Install from PyPI (Recommended)

pip install mcp-open-client
mcp-open-client

Option 2: Install from Source

git clone https://github.com/alejoair/mcp-open-client.git
cd mcp-open-client
pip install -e .
mcp-open-client

Option 3: Development Setup

git clone https://github.com/alejoair/mcp-open-client.git
cd mcp-open-client
pip install -r requirements.txt
python -m mcp_open_client.main

πŸš€ Quick Start

  1. Launch the application:

    mcp-open-client
  2. Open your browser to http://localhost:8080

  3. Configure your API settings:

    • Go to Configuration β†’ API Settings
    • Add your API key and model preferences
    • Choose from OpenAI, Claude, or local models
  4. Set up MCP servers (optional):

    • Go to Configuration β†’ MCP Servers
    • Add servers for enhanced functionality
  5. Start chatting!

βš™οΈ Configuration

API Settings

Configure your preferred AI model in the web interface:

  • API Key: Your OpenAI/Claude API key
  • Base URL: API endpoint (supports local models like LM Studio)
  • Model: Choose your preferred model
  • System Prompt: Customize the assistant's behavior

MCP Servers

Connect external tools and services:

{
  "mcpServers": {
    "mcp-requests": {
      "disabled": false,
      "command": "uvx",
      "args": ["mcp-requests"],
      "transport": "stdio"
    },
    "mcp-code-editor": {
      "disabled": false,
      "command": "uvx",
      "args": ["mcp-code-editor"]
    }
  }
}

πŸ› οΈ Supported MCP Servers

The client works with any MCP-compliant server. Popular options include:

  • mcp-requests: HTTP request capabilities
  • mcp-code-editor: File system operations
  • mcp-database: Database connectivity
  • Custom servers: Build your own with FastMCP

πŸ”§ Development

Project Structure

mcp_open_client/
β”œβ”€β”€ main.py                    # Application entry point
β”œβ”€β”€ api_client.py             # LLM API communication
β”œβ”€β”€ mcp_client.py             # MCP protocol handler
β”œβ”€β”€ config_utils.py           # Configuration management
β”œβ”€β”€ settings/                 # Default configurations
β”‚   β”œβ”€β”€ user-settings.json    # API settings
β”‚   └── mcp-config.json      # MCP server config
└── ui/                      # User interface components
    β”œβ”€β”€ home.py              # Home page
    β”œβ”€β”€ chat_interface.py    # Chat UI
    β”œβ”€β”€ configure.py         # Settings UI
    β”œβ”€β”€ mcp_servers.py       # MCP management
    └── chat_handlers.py     # Chat logic

Running Tests

python -m pytest tests/

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

🌟 Features in Detail

Chat Interface

  • Real-time messaging with streaming responses
  • Conversation history with search and organization
  • Message formatting with syntax highlighting
  • Tool integration via MCP protocol

Configuration Management

  • Web-based settings - no need to edit config files
  • Multiple API providers - OpenAI, Anthropic, local models
  • MCP server management - enable/disable servers on the fly
  • Theme customization - dark/light mode support

MCP Integration

  • Protocol compliance - works with any MCP server
  • Dynamic server loading - add servers without restart
  • Tool discovery - automatic detection of available tools
  • Error handling - graceful degradation when servers are unavailable

πŸ“‹ Requirements

  • Python 3.7+
  • Modern web browser
  • Internet connection (for cloud APIs) or local model setup

Dependencies

  • nicegui - Web UI framework
  • openai - API client library
  • fastmcp - MCP protocol implementation
  • websockets - WebSocket support
  • requests - HTTP client
  • jsonschema - Configuration validation

πŸ› Troubleshooting

Common Issues

Connection Problems:

  • Check your API key and base URL
  • Verify network connectivity
  • Ensure MCP servers are running

UI Issues:

  • Clear browser cache
  • Try a different browser
  • Check browser console for errors

MCP Server Issues:

  • Verify server configuration
  • Check server logs
  • Test servers independently

Getting Help

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ”— Links


Made with ❀️ by alejoair

About

mcp-open-client

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors