The Scenic MCP server enables remote control of Scenic GUI applications via TCP connection with these capabilities:
- Connection Management: Establish and test connectivity with
connect_scenic
and check status withget_scenic_status
- Keyboard Input: Send text and special keys (enter, escape, tab, arrows, F1-F12) with
send_keys
, including modifier key combinations (ctrl, shift, alt, cmd/meta) - Mouse Control: Move cursor to precise coordinates with
send_mouse_move
and simulate clicks withsend_mouse_click
using left, right, or middle buttons - Viewport Inspection: Retrieve details of what's currently displayed on the Scenic application with
inspect_viewport
Provides integration with Scenic (an Elixir UI framework), enabling AI-driven automation and testing for Scenic applications through a TCP server that exposes app state and allows interaction with UI elements.
Uses Node.js to implement the MCP server component that bridges between the Elixir TCP server and AI assistants, enabling the control of Scenic applications.
Scenic MCP - Input Control for Scenic Applications
A Model Context Protocol (MCP) server that enables external keyboard and mouse input injection into Scenic GUI applications.
Features
- Keyboard Input: Send text and special keys to Scenic applications
- Mouse Control: Move cursor and click at specific coordinates
- Visual Feedback: Get descriptions of what's displayed on screen (v0.2.0)
- MCP Integration: Works with any MCP-compatible client (Claude Desktop, etc.)
- Real-time Communication: TCP-based connection for low-latency input
- Scenic Compatible: Uses proper Scenic ViewPort input routing
Installation
- Add to your Scenic application's
mix.exs
:
- Configure your Scenic viewport with proper naming:
IMPORTANT: For scenic_mcp to work correctly, your Scenic application MUST name both the viewport and driver. Update your scenic_config()
function:
- Install Node.js dependencies and build:
- Configure for Claude Code:
Note: Replace /path/to/scenic_mcp
with the actual path to your scenic_mcp directory.
Usage
Using with Claude Code
Once configured, you can use the MCP tools directly within Claude Code conversations:
- Start your Scenic application (with the ScenicMcp.Server running on port 9999)
- Use MCP tools in Claude Code:
connect_scenic
- Test connection to your Scenic appget_scenic_status
- Check connection statussend_keys
- Send keyboard inputsend_mouse_move
- Move mouse cursorsend_mouse_click
- Click at coordinatesinspect_viewport
- Get visual description of current screen
Example conversation:
MCP Tools
The server provides these MCP tools:
connect_scenic
Test connection to the Scenic application.
get_scenic_status
Check server status and available commands.
send_keys
Send keyboard input to the Scenic application.
Parameters:
text
(string): Text to type (each character sent as individual key press)key
(string): Special key name (enter, escape, tab, backspace, delete, up, down, left, right, home, end, page_up, page_down, f1-f12)modifiers
(array): Modifier keys (ctrl, shift, alt, cmd, meta)
send_mouse_move
Move mouse cursor to specific coordinates.
Parameters:
x
(number): X coordinatey
(number): Y coordinate
send_mouse_click
Click mouse at specific coordinates.
Parameters:
x
(number): X coordinatey
(number): Y coordinatebutton
(string): Mouse button (left, right, middle) - default: left
get_scenic_graph
(NEW in v0.2.0)
Return the script table for a ViewPort, providing a visual description of the scene.
take_screenshot
Capture a screenshot of the current Scenic display.
Parameters:
filename
(string, optional): Custom filename for the screenshotformat
(string, optional): Output format - "path" (default) or "base64"
Examples
Send text:
Send special key:
Send key with modifiers:
Move mouse:
Click mouse:
Get visual feedback:
Architecture
Key Components
- ScenicMcp.Server: TCP server that receives commands from the TypeScript bridge
- ScenicMcp.Probes: Direct interface to Scenic internals, sends input via
Scenic.Driver.send_input/2
- Process Names: Uses
:main_viewport
and:scenic_driver
registered process names
Development
Start the Elixir server:
Test the MCP server:
Testing
This project includes comprehensive testing to ensure reliability and guide improvements.
Test Suites
- Elixir Unit Tests - Core server functionality
- TypeScript Tests - MCP integration testing
- LLM Tool Testing - Validates tool descriptions and usability
Testing Innovation: LLM-Driven Tool Enhancement
One of the unique aspects of this project is how we use LLM testing to improve the tool descriptions:
- Tool Usage Analysis: We run scenarios through LLMs to see which tools they discover and use
- Description Enhancement: Based on usage patterns, we automatically enhance tool descriptions
- Real-World Validation: The enhanced descriptions are tested against real development scenarios
This approach has led to significant improvements in tool discoverability and correct usage by AI assistants.
Running All Tests
For detailed testing documentation, see TESTING.md.
Requirements
- Elixir/OTP 24+
- Node.js 18+
- Scenic 0.11+
License
MIT License
A Model Context Protocol server that enables AI-driven automation and testing of Scenic Elixir applications through a TCP connection.
Related MCP Servers
- -securityFlicense-qualityA demonstration implementation of the Model Context Protocol server that facilitates communication between AI models and external tools while maintaining context awareness.Last updated -Python
- -securityFlicense-qualityImplements a Model Context Protocol server that provides context from CucumberStudio to AI assistants, enabling them to fetch data and generate or modify test scenarios, features, and other CucumberStudio resources.Last updated -JavaScript
- -securityFlicense-qualityA Model Context Protocol server that enables integration with the TESS API, allowing users to list and manage agents, execute agents with custom messages, and manage files through natural language interfaces.Last updated -TypeScript
- -security-license-qualityA Model Context Protocol server that enables generating and executing Elisp code in a running Emacs process, allowing AI assistants to control and interact with Emacs.Last updated -Python