Skip to main content

Add your description here

Project description

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:

uv add mcp-repl

Development Installation

Clone and install in editable mode:

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 examples/databases/setup.sh

Install databases related dependencies

uv add mcp-repl['databases']

Generate mock data:

uv run examples/databases/generate_mock_data.py

Start the REPL:

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:

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:

uv run pytest

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_repl-0.1.2.tar.gz (57.0 kB view details)

Uploaded Source

Built Distribution

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

mcp_repl-0.1.2-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file mcp_repl-0.1.2.tar.gz.

File metadata

  • Download URL: mcp_repl-0.1.2.tar.gz
  • Upload date:
  • Size: 57.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.4

File hashes

Hashes for mcp_repl-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d6d610b8e5c440992e22a9b0e11895772fcd4247e6c75501e9d103140c4d4f1e
MD5 c399fc93701c1570eeb13a6fb4289d1e
BLAKE2b-256 eeaee422c818f9b738c2b1274715dacb5c7719eb2a3d11b72e6a847d7a36aaf3

See more details on using hashes here.

File details

Details for the file mcp_repl-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mcp_repl-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.4

File hashes

Hashes for mcp_repl-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b094f4ed7117339c2d608f0b19f693fc85b0754373d3ed7b093be49638482ea6
MD5 3a9b39d8703e1727c1c2087396721e56
BLAKE2b-256 9eaf32f20485344c8b0fb4eccd0e76908a3f0c9be79065af91a95f6c4fe2e8b9

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