Metadata-Version: 2.4
Name: mcp-repl
Version: 0.1.2
Summary: Add your description here
Author-email: truskovskiyk <truskovskiyk@gmail.com>
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: aiohttp>=3.11.13
Requires-Dist: anthropic>=0.49.0
Requires-Dist: mcp[cli]>=1.3.0
Requires-Dist: prompt-toolkit>=3.0.50
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: ruff>=0.9.9
Provides-Extra: databases
Requires-Dist: faker>=36.2.2; extra == 'databases'
Requires-Dist: mysql-connector-python>=9.2.0; extra == 'databases'
Requires-Dist: psycopg2-binary>=2.9.10; extra == 'databases'
Requires-Dist: redis>=5.2.1; extra == 'databases'
Provides-Extra: test
Requires-Dist: pytest>=7.4.0; extra == 'test'
Description-Content-Type: text/markdown

# MCP-REPL

A lightweight REPL (Read-Eval-Print Loop) for interacting with various services through MCP (Model Control Protocol).

## Overview

`mcp-repl` is designed for efficient development, debugging, and testing of MCP servers. It provides an intuitive command-line interface that's simpler than using the Cloud Desktop app, allowing developers to quickly:

- Send queries to MCP servers
- View detailed tool execution
- Automatically save chat history
- Test multiple MCP services simultaneously

## Installation

Install via pip or uv:

```bash
uv add mcp-repl
```

### Development Installation

Clone and install in editable mode:

```bash
git clone https://github.com/yourusername/mcp-repl.git
cd mcp-repl
uv venv
```

## Databases Example

This example demonstrates how you can:

- Set up 3 databases (PostgreSQL, MySQL, Redis) in Kubernetes with mock data
- Run MCP servers for each dataset
- Interact with all databases from a single REPL

### Key Features

- Natural language queries across multiple databases
- Comparison of data structures across systems
- Execution of complex operations seamlessly

### Running the Example

Setup infrastructure (requires `kind` and `helm`):

```bash
bash examples/databases/setup.sh
```

Install databases related dependencies
```bash
uv add mcp-repl['databases']
```

Generate mock data:

```bash
uv run examples/databases/generate_mock_data.py
```

Start the REPL:

```bash
uv run -m mcp_repl.repl --config examples/databases/config.json --auto-approve-tools
```

### Sample Queries

You can perform queries like:

- "Find all tables in PostgreSQL and MySQL"
- "Compare the structure of the 'users' table in PostgreSQL with the 'customers' table in MySQL"
- "Count the number of records in each database"

## Usage

Start the REPL:

```bash
uv run -m mcp_repl.repl --config path/to/config.json
```

### Optional Flags

- `--auto-approve-tools`: Automatically approve all tool executions
- `--always-show-full-output`: Always display complete tool outputs
- `--chat-history-dir PATH`: Directory to save chat history (default: `./chat_history`)

## Testing

Comprehensive integration tests are included to verify functionality:

Run all tests:

```bash
uv run pytest
```
