Metadata-Version: 2.4
Name: repl-mcp
Version: 0.1.0
Summary: Interactive REPL for testing Model Context Protocol (MCP) servers
Project-URL: Homepage, https://github.com/kkokosa/repl-mcp
Project-URL: Repository, https://github.com/kkokosa/repl-mcp
Project-URL: Issues, https://github.com/kkokosa/repl-mcp/issues
Author: Konrad Kokosa
License: MIT License
        
        Copyright (c) 2026 Konrad Kokosa
        
        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. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: ai,mcp,model-context-protocol,repl,tools
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Requires-Dist: mcp>=1.0.0
Requires-Dist: prompt-toolkit>=3.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: rich>=13.0.0
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: tomli; (python_version < '3.11') and extra == 'dev'
Provides-Extra: yaml
Requires-Dist: pyyaml>=6.0; extra == 'yaml'
Description-Content-Type: text/markdown

# MCP REPL

[![PyPI](https://img.shields.io/pypi/v/repl-mcp)](https://pypi.org/project/repl-mcp/)
[![License](https://img.shields.io/github/license/kkokosa/repl-mcp)](https://github.com/kkokosa/repl-mcp/blob/main/LICENSE)
[![Python Versions](https://img.shields.io/pypi/pyversions/repl-mcp)](https://pypi.org/project/repl-mcp/)

Interactive REPL for testing Model Context Protocol (MCP) servers.

![Demo of repl-mcp](repl-mcp-demo.gif)

## Features

- List and inspect tools, prompts, and resources
- Call tools with JSON or interactive parameter input
- Tab autocompletion for commands and tool names
- Command history (arrow keys)
- Rich terminal UI with syntax highlighting

## Installation

### Option 1: Install from PyPI (Recommended)

```bash
# Using uv (fast, Rust-based)
uv tool install repl-mcp

# Using pipx
pipx install repl-mcp

# Using pip
pip install repl-mcp
```

### Option 2: Run directly without installing

```bash
# Using uvx
uvx repl-mcp -c "npx mcp-remote https://mcp.atlassian.com/v1/mcp"
```

### Option 3: Development Setup

```bash
git clone https://github.com/kkokosa/repl-mcp.git
cd repl-mcp
pip install -e .
```

## Usage

> [!NOTE] 
> `mcp-remote` sidenote - Some MCP servers (like Atlassian) use OAuth for authentication and don't support direct HTTP connections. The `mcp-remote` MCP bridges this gap by handling OAuth flows locally and/or converting HTTP-based MCP servers to stdio transport. Beware that for OAuth-based servers, `mcp-remote` needs to receive the OAuth callback. If you're running in an environment without a public URL (like WSL or a remote server), you'll need a tunneling tool like [ngrok](https://ngrok.com/) to expose the callback endpoint.


### Stdio Transport (command-based)

```bash
# Remote MCP server via mcp-remote
repl-mcp -c "npx mcp-remote https://mcp.atlassian.com/v1/mcp"

# Local Python MCP server
repl-mcp -c "python my_mcp_server.py"

# Using uvx
repl-mcp -c "uvx mcp-server-sqlite --db-path test.db"
```

### HTTP Transport (URL-based)

```bash
# GitHub Copilot MCP
repl-mcp --url https://api.githubcopilot.com/mcp/ \
         --header "Authorization: Bearer YOUR_GITHUB_TOKEN"

# Notion MCP
repl-mcp -u https://mcp.notion.com/mcp

# Multiple headers
repl-mcp -u https://example.com/mcp \
         -H "Authorization: Bearer TOKEN" \
         -H "X-Custom-Header: value"
```

### Using a config file

```bash
# If multiple servers in config, you'll be prompted to choose
repl-mcp --config sample-mcp-config.json

# Or select specific server directly
repl-mcp --config sample-mcp-config.json --server github
```

#### Config file formats

**Stdio transport:**

```json
{
  "command": "npx",
  "args": ["mcp-remote", "https://mcp.atlassian.com/v1/mcp"]
}
```

**HTTP transport:**

```json
{
  "url": "https://api.githubcopilot.com/mcp/",
  "headers": {
    "Authorization": "Bearer YOUR_TOKEN"
  }
}
```

**Multiple servers (Cursor/Claude Desktop format):**

```json
{
  "mcpServers": {
    "atlassian": {
      "command": "npx",
      "args": ["mcp-remote", "https://mcp.atlassian.com/v1/mcp"]
    },
    "github": {
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer YOUR_TOKEN"
      }
    },
    "notion": {
      "url": "https://mcp.notion.com/mcp",
      "headers": {}
    }
  }
}
```

**YAML format:**

```yaml
command: npx
args:
  - mcp-remote
  - https://mcp.atlassian.com/v1/mcp
```

## REPL Commands

| Command | Description |
|---------|-------------|
| `tools` | List all available tools |
| `tool <name>` | Show detailed info about a specific tool |
| `prompts` | List all available prompts |
| `resources` | List all available resources |
| `call <tool> [args]` | Call a tool (interactive input if no args) |
| `prompt <name> [args]` | Get a prompt with optional JSON arguments |
| `read <uri>` | Read a resource by URI |
| `info` | Show server info and capabilities |
| `help` | Show help message |
| `quit` / `exit` / `q` | Exit the REPL |

### Keyboard Shortcuts

| Key | Action |
|-----|--------|
| `Tab` | Autocomplete commands and tool names |
| `↑` / `↓` | Navigate command history |
| `Ctrl+C` | Cancel current input |
| `Ctrl+D` | Exit REPL |

## Examples

```
mcp> tools
┌─────────────────────────────────────────────────────────┐
│ Available Tools (15)                                    │
├──────────────────┬───────────────────────────┬──────────┤
│ Name             │ Description               │ Params   │
├──────────────────┼───────────────────────────┼──────────┤
│ get_issue        │ Retrieves a Jira issue... │ issueKey │
│ search_issues    │ Search for issues using...│ jql      │
└──────────────────┴───────────────────────────┴──────────┘

mcp> call get_issue {"issueKey": "PROJ-123"}
┌─────────────────────────────────────────────────────────┐
│ Result                                                  │
├─────────────────────────────────────────────────────────┤
│ {                                                       │
│   "key": "PROJ-123",                                    │
│   "summary": "Example issue",                           │
│   ...                                                   │
│ }                                                       │
└─────────────────────────────────────────────────────────┘

mcp> quit
Goodbye!
```

## Requirements

- Python 3.10+
- Node.js (if using `npx mcp-remote`)
