Skip to main content

An open-source client for the Model Context Protocol

Project description

MCP Open Client

A NiceGUI-based chat application for Claude and other OpenAI-compatible APIs. Version 0.1.1.

Features

  • Chat interface for Claude and other OpenAI-compatible APIs
  • Support for custom tools and function calling
  • Conversation management
  • Settings customization
  • Dark mode support

Installation

You can install the latest version of the package from PyPI:

pip install mcp-open-client

To install a specific version:

pip install mcp-open-client==0.1.1

Or install the latest development version directly from GitHub:

pip install git+https://github.com/alejoair/mcp-open-client.git

For development installation:

# Clone the repository
git clone https://github.com/alejoair/mcp-open-client.git
cd mcp-open-client

# Install in development mode
python install_dev.py

Usage

After installation, you can run the application with:

mcp-open-client [--port PORT] [--host HOST]

Command-line options:

  • --port PORT: Specify the port to run the application on (default: 8081)
  • --host HOST: Specify the host to run the application on (default: 0.0.0.0)

Or from Python:

from mcp_open_client.main import main

if __name__ == "__main__":
    main(port=8081, host="0.0.0.0")

Configuration

The application stores its configuration in the user's home directory at ~/mcp-open-client/config/. The following files are created:

  • user_settings.json: Contains user settings like API key, model, etc.
  • user_tools.json: Contains custom tools created by the user
  • user_theme.css: Contains the user's custom CSS theme (created on first installation)

Theme Customization

During the first installation, the default theme CSS file is copied to your configuration directory. You can customize the application's appearance by editing the user_theme.css file located at ~/mcp-open-client/config/user_theme.css.

API Configuration

To use the application, you need to configure your API key in the settings. The application supports:

  • OpenAI API (ChatGPT, GPT-4)
  • Anthropic API (Claude)
  • Any OpenAI-compatible API endpoint

Package Structure

mcp_open_client/
├── __init__.py           # Package initialization with version info
├── main.py               # Main entry point
├── api.py                # API client implementation
├── state.py              # Application state management
├── ui/                   # UI components
│   ├── __init__.py       # UI package initialization
│   ├── common.py         # Common UI elements
│   ├── chat.py           # Chat interface
│   ├── settings.py       # Settings interface
│   └── tools.py          # Tools interface
├── assets/               # Static assets
│   └── favicon           # Application favicon
└── settings/             # Default settings
    ├── default_settings.json  # Default application settings
    └── default_tools.json     # Default tools configuration

Development

To set up the development environment:

  1. Clone the repository: git clone https://github.com/alejoair/mcp-open-client.git
  2. Navigate to the project directory: cd mcp-open-client
  3. Install in development mode: python install_dev.py
  4. Run the application: python -m mcp_open_client.main

Testing

To verify the package installation:

python test_import.py

API Reference

Main Module

from mcp_open_client.main import main

# Run the application with custom settings
main(port=8080, host="127.0.0.1")

State Module

from mcp_open_client.state import State

# Access the application state
state = State()

API Module

from mcp_open_client.api import ChatAPI

# Create a chat API instance
api = ChatAPI()

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_open_client-0.1.8.tar.gz (47.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_open_client-0.1.8-py3-none-any.whl (57.7 kB view details)

Uploaded Python 3

File details

Details for the file mcp_open_client-0.1.8.tar.gz.

File metadata

  • Download URL: mcp_open_client-0.1.8.tar.gz
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for mcp_open_client-0.1.8.tar.gz
Algorithm Hash digest
SHA256 eb8c39c6f5e5cb084c26c52d50095f7bd140e9d79ec975ced92440a4b0425663
MD5 2a689ad41d0515e6051048cd2293adf4
BLAKE2b-256 bd37d3e97b7afc4c246f1d952832cd8fde9c4f0f2d2ff4c3c2a206d956eb4a39

See more details on using hashes here.

File details

Details for the file mcp_open_client-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_open_client-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3319e5153e2cec610c11a9ed464ab6b344f858cc92df41f98bc1a0df281baf11
MD5 cb6dda65a587d0a747387d70c4cccedc
BLAKE2b-256 12e059dd6f1abda35dd5549d59ff21f9042faf7d2a64fa4aeaf4ba5a03db27f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page