Package Exports
- mcp-interactive
- mcp-interactive/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mcp-interactive) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
MCP Interactive Server
An interactive MCP (Model Context Protocol) server with a graphical interface for user interaction.
Description
This server provides the ask_user tool, which allows MCP clients to display interactive dialogues to the user via an Electron GUI. It supports both text input and predefined answer options.
Features
- Interactive Dialogues: Displaying pop-up windows with questions to the user
- Predefined Options: Support for radio buttons to select from predefined options
- Markdown Support: Formatting messages using Markdown
- Text Input: Ability for free text input by the user
Installation
- Install dependencies:
npm install- Make sure you have Electron installed:
npm list electronUsage
Starting the Server
node index.jsThe server will await JSON-RPC requests via stdin/stdout.
ask_user Tool
Parameter Schema:
{
"projectName": "string", // Project/context name (required)
"message": "string", // Message for the user (required)
"predefinedOptions": [ // Predefined answer options (optional)
"string"
]
}Example Request with Predefined Options:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ask_user",
"arguments": {
"projectName": "My Project",
"message": "Please select one of the options:",
"predefinedOptions": ["Option 1", "Option 2", "Option 3"]
}
}
}Example Request with Text Input:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "ask_user",
"arguments": {
"projectName": "My Project",
"message": "Please enter your name:"
}
}
}Server Response:
{
"result": {
"content": [
{
"text": "User replied: Option 1",
"type": "text"
}
]
},
"jsonrpc": "2.0",
"id": 1
}Testing
Quick Test with echo:
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}' | node index.jsask_user Tool Test:
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "ask_user", "arguments": {"projectName": "Test", "message": "Choose option:", "predefinedOptions": ["A", "B", "C"]}}}' | node index.jsInteractive Test:
node test_interactive.jsWorkflow:
- MCP client sends an
ask_userrequest - The server launches the Electron GUI process
- A dialog window with the question is displayed
- The user selects an option or enters text
- The response is sent back to the MCP server
- The server returns the result to the client
License
MIT