Interaction MCP MCP server

Enables high-frequency communication between users and AI tools through multiple interface options, providing option selection and information requests to improve interaction efficiency by confirming approaches before execution.
Back to servers
Setup instructions
Provider
Daniel Zhao
Release date
May 20, 2025
Stats
28 stars

This MCP server enables interactive communication between AI tools (like Cursor and Windsurf) and users. It allows AI tools to request user input, present options for selection, and collect additional information while executing tasks, significantly improving the efficiency and effectiveness of AI interactions.

Installation Options

Using Pre-compiled Executable (Windows)

  1. Download the latest executable from the GitHub Releases page
  2. Run the executable without any installation

Test the functionality with:

# Test option selection with PyQt interface
.\dist\mcp-interactive.exe test select_option --ui pyqt

# Test information supplement with PyQt interface
.\dist\mcp-interactive.exe test request_additional_info --ui pyqt

Installing from Source Code

Choose your preferred UI type and install the corresponding dependencies:

Using pip

cd requirements

# For CLI UI (minimal dependencies)
pip install -r requirements-base.txt

# For PyQt5 UI
pip install -r requirements-pyqt.txt

# For Web UI
pip install -r requirements-web.txt

Using uv (Faster alternative)

If you have uv installed:

# Create and activate virtual environment
uv venv
# On Windows
.venv\Scripts\activate
# On macOS/Linux
source .venv/bin/activate

cd requirements

# Install dependencies based on UI type
# CLI UI (minimal)
uv pip install -r requirements-base.txt
# PyQt5 UI
uv pip install -r requirements-pyqt.txt
# Web UI
uv pip install -r requirements-web.txt

Alternatively, use pyproject.toml:

# Install base dependencies
uv pip install -e .

# Install specific UI type dependencies
uv pip install -e ".[pyqt]"     # PyQt5 UI
uv pip install -e ".[web]"      # Web UI
uv pip install -e ".[all]"      # All UI types

Starting the Server

Start the MCP server with your preferred UI type:

# Command line interface (default)
python main.py run --ui=cli

# Web interface
python main.py run --ui=web

# PyQt interface
python main.py run --ui=pyqt

Additional options:

# Specify host and port
python main.py run --host 0.0.0.0 --port 8888

# Specify log level
python main.py run --log-level warning

Configuring AI Tools

Using stdio Protocol (Recommended)

Python Source Code Configuration

{
  "ai-interaction": {
    "command": "python",
    "args": ["path/to/main.py", "run", "--transport", "stdio", "--ui", "cli"],
    "env": {}
  }
}

Executable Configuration

{
  "ai-interaction": {
    "command": "D:/Path/To/Your/mcp-interactive.exe",
    "args": ["run", "--transport", "stdio", "--ui", "pyqt"],
    "env": {}
  }
}

Using SSE Protocol (Alternative)

Start the server with:

python main.py run --transport sse

Cursor configuration:

{
  "ai-interaction": {
    "type": "sse",
    "url": "http://127.0.0.1:8000/sse",
    "env": {}
  }
}

Windsurf configuration:

{
  "ai-interaction": {
    "serverUrl": "http://127.0.0.1:7888/sse",
    "disabled": false
  }
}

Using the MCP Tools

Option Selection Tool

This tool presents options to users and lets them select by entering numbers or providing custom answers.

from fastmcp import Client

async with Client("http://127.0.0.1:8000/sse") as client:
    options = [
        "Option 1: Implement with TensorFlow",
        "Option 2: Implement with PyTorch",
        {"title": "Option 3: Implement with JAX", "description": "Better for research purposes"}
    ]
    result = await client.call_tool(
        "select_option", 
        {"options": options, "prompt": "Please select a framework implementation"}
    )
    selected_option = result.json
    print(f"User selected: {selected_option}")

The tool returns:

{
    "selected_index": 0,     // Index of the user's selection, -1 if custom answer
    "selected_option": {},   // Content of the user's selected option
    "custom_input": "",      // User's custom input, if any
    "is_custom": false       // Whether it's a custom answer
}

Information Supplement Tool

This tool requests additional information from users.

from fastmcp import Client

async with Client("http://127.0.0.1:8000/sse") as client:
    additional_info = await client.call_tool(
        "request_additional_info",
        {
            "prompt": "Please provide specific project requirements"
        }
    )
    print(f"User provided information: {additional_info.text}")

Testing the Tools

Testing Individual Tools

# Test option selection tool
python main.py test select_option --ui=cli

# Test information supplement tool
python main.py test request_additional_info --ui=cli

Interactive Test Client

# Run the interactive test client
python mcp_client_en.py --host localhost --port 7888 --ui cli

Options:

  • --host: Server host (default: localhost)
  • --port: Server port (default: 7888)
  • --ui: UI type to use (cli, pyqt, web)

STDIO Test Client

# Test stdio connection with default settings
python mcp_client_stdio.py

# Specify UI type
python mcp_client_stdio.py --ui=pyqt

# Test specific tools
python mcp_client_stdio.py --test=select_option

Configuration File

The config.json file in the project root directory can configure various options:

{
  "reminder": {
    "enable_reminder": true,
    "reminder_text": "**Note**:\nUnless I explicitly state there are no new tasks, you must never terminate the conversation. After completing each task, call mcp ai-interaction to request or confirm tasks with me!"
  },
  "ui": {
    "default_ui_type": "pyqt"
  },
  "logging": {
    "level": "warning"
  }
}

UI Types

The MCP server supports three different user interface types:

CLI (Command Line Interface)

  • Opens a new command prompt window for user interaction
  • Minimal dependencies, can handle multiple dialog windows simultaneously
  • Best for server environments or systems with limited resources

PyQt Interface

  • Provides a modern graphical user interface
  • Clean, professional-looking dialogs
  • Can only display one dialog at a time
  • Best for desktop use where visual appeal is important

Web Interface

  • Opens dialogs in a web browser
  • Can handle multiple dialog windows simultaneously
  • Accessible from anywhere via web browser
  • Best for remote access scenarios

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "ai-interaction" '{"command":"python","args":["path/to/main.py","run","--transport","stdio","--ui","cli"],"env":[]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "ai-interaction": {
            "command": "python",
            "args": [
                "path/to/main.py",
                "run",
                "--transport",
                "stdio",
                "--ui",
                "cli"
            ],
            "env": []
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "ai-interaction": {
            "command": "python",
            "args": [
                "path/to/main.py",
                "run",
                "--transport",
                "stdio",
                "--ui",
                "cli"
            ],
            "env": []
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later