Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
66c9e71
fix: prevent crashes from control key combinations
Cheffromspace Apr 23, 2025
b16684e
test: fix tests for control key validation
Cheffromspace Apr 23, 2025
2644919
fix: add type annotations to fix TypeScript errors
Cheffromspace Apr 23, 2025
36ecc42
fix: block Windows key combinations to prevent server crashes
Cheffromspace Apr 23, 2025
5f53b1c
Merge pull request #121 from Cheffromspace/fix/disable-ctrl-key-combi…
Cheffromspace Apr 23, 2025
ab62aa1
bump version to 0.1.21
Cheffromspace Apr 23, 2025
38c3fd6
chore: upgrade to MCP SDK 1.10.2 for HTTP streaming support
Cheffromspace Apr 23, 2025
d0ba998
Merge pull request #123 from Cheffromspace/feature/upgrade-mcp-sdk-1.…
Cheffromspace Apr 23, 2025
5fcdea3
feat: implement HTTP Stream transport server
Cheffromspace Apr 23, 2025
3edeb4e
enhance: improve HTTP transport security and organization
Cheffromspace Apr 23, 2025
16e4518
fix: address PR review feedback
Cheffromspace Apr 23, 2025
0bfc0a9
Merge pull request #132 from Cheffromspace/feature/http-stream-transport
Cheffromspace Apr 23, 2025
4972b38
feat: implement human-like typing with streaming support
Cheffromspace Apr 23, 2025
8016478
enhance: improve human-like typing with streaming support
Cheffromspace Apr 23, 2025
5c4aa5c
Merge pull request #136 from Cheffromspace/feature/human-like-typing-…
Cheffromspace Apr 23, 2025
ce35144
Merge pull request #137 from Cheffromspace/feature/human-like-typing-…
Cheffromspace Apr 23, 2025
617120d
feat: add AutoHotkey provider for Windows automation
Cheffromspace May 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 90 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,26 @@

Windows control server for the Model Context Protocol, providing programmatic control over system operations including mouse, keyboard, window management, and screen capture functionality.

I developed this project as an experiment a few months ago, wanting to see if Claude could play some video games. After seeing it work, I was impressed but set it aside. Recently, it's gained attention from the community, prompting me to resume development. While currently in pre-release state, I'm actively working toward a stable version. If you encounter any issues, please submit them through the issue tracker.

> **Note**: This project currently supports Windows only.

## Quick Demo (30-Second Wow Demo)

Want to see what MCPControl can do in 30 seconds? Try our interactive demo:

```bash
# Run the demo with just one command
node demo.cjs
```

The demo will:
1. Show you available MCPControl tools
2. Display your screen size
3. Track your cursor position
4. Identify active window information
5. Optionally take a screenshot and save it to your desktop

No need to run anything else - the demo manages the MCPControl server for you!

## ⚠️ IMPORTANT DISCLAIMER

**THIS SOFTWARE IS EXPERIMENTAL AND POTENTIALLY DANGEROUS**
Expand Down Expand Up @@ -57,39 +73,49 @@ By using this software, you acknowledge and accept that:

## Usage

Simply configure your Claude MCP settings to use MCPControl as shown in the [MCP Server Configuration](#mcp-server-configuration) section. No installation needed!

### Building From Source

If you're interested in contributing or building from source, please see [CONTRIBUTING.md](CONTRIBUTING.md) for detailed instructions.

#### Development Requirements

To build this project for development, you'll need:

1. Windows operating system (required for the keysender dependency)
2. Node.js 18 or later (install using the official Windows installer which includes build tools)
3. npm package manager
4. Native build tools:
- node-gyp: `npm install -g node-gyp`
- cmake-js: `npm install -g cmake-js`

The keysender dependency relies on Windows-specific native modules that require these build tools.

## MCP Server Configuration

To use this project, you'll need the necessary build tools:

1. Install Node.js using the official Windows installer, which includes necessary build tools
2. Install additional required tools:

```
npm install -g node-gyp
npm install -g cmake-js
### Quick Start

The simplest way to use MCPControl is through JSON-RPC:

```javascript
// In a Node.js script
const { spawn } = require("child_process");
const readline = require("readline");

// Start the MCP Control server as a child process
const proc = spawn("npx", ["-y", "mcp-control"], {
shell: true,
stdio: ["pipe", "pipe", "inherit"],
});

// Read responses
const rl = readline.createInterface({ input: proc.stdout });
rl.on("line", (line) => {
try {
const response = JSON.parse(line);
console.log("Response:", response);
} catch (e) {
console.log("←", line);
}
});

// Send a command
proc.stdin.write(
JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "tools/call",
params: {
name: "get_screen_size",
arguments: {}
},
}) + "\n"
);
```

Then, add the following configuration to your MCP settings:
### MCP Server Configuration

To use with Claude MCP, add the following configuration to your MCP settings:

```json
{
Expand All @@ -106,30 +132,42 @@ Then, add the following configuration to your MCP settings:
}
```

After configuring your MCP settings, restart your client to see the MCPControl service in the menu.
## Building From Source

If you're interested in contributing or building from source, please see [CONTRIBUTING.md](CONTRIBUTING.md) for detailed instructions.

### Development Requirements

## Project Structure
To build this project for development, you'll need:

- `/src`
- `/handlers` - Request handlers and tool management
- `/tools` - Core functionality implementations
- `/types` - TypeScript type definitions
- `index.ts` - Main application entry point
1. Windows operating system (required for the keysender dependency)
2. Node.js 18 or later (install using the official Windows installer which includes build tools)
3. npm package manager
4. Native build tools:
- node-gyp: `npm install -g node-gyp`
- cmake-js: `npm install -g cmake-js`

## Dependencies
## Available Tools

- [@modelcontextprotocol/sdk](https://www.npmjs.com/package/@modelcontextprotocol/sdk) - MCP SDK for protocol implementation
- [keysender](https://www.npmjs.com/package/keysender) - Windows-only UI automation library
- [clipboardy](https://www.npmjs.com/package/clipboardy) - Clipboard handling
- [sharp](https://www.npmjs.com/package/sharp) - Image processing
- [uuid](https://www.npmjs.com/package/uuid) - UUID generation
MCPControl provides the following tools:

## Testing
- `get_screenshot`: Capture a screenshot
- `click_at`: Click at specific coordinates
- `move_mouse`: Move the mouse cursor
- `click_mouse`: Click at the current position
- `drag_mouse`: Drag from one position to another
- `scroll_mouse`: Scroll the mouse wheel
- `type_text`: Type text using the keyboard
- `press_key`: Press a keyboard key
- `press_key_combination`: Press multiple keys simultaneously
- `hold_key`: Hold or release a key
- `get_screen_size`: Get screen dimensions
- `get_cursor_position`: Get current cursor position
- `get_active_window`: Get info about the active window
- `get_clipboard_content`: Get clipboard text
- `set_clipboard_content`: Set clipboard text

The project currently includes unit tests for core functionality. The following test areas are planned for future development:
- Integration tests for cross-module functionality
- Performance testing
- Error handling validation
And many more!

## Known Limitations

Expand All @@ -138,6 +176,7 @@ The project currently includes unit tests for core functionality. The following
- The get_screenshot utility does not work with the VS Code Extension Cline. See [GitHub issue #1865](https://github.com/cline/cline/issues/1865)
- Some operations may require elevated permissions depending on the target application
- Only Windows is supported
- Ctrl key combinations (Ctrl+C, Ctrl+V, etc.) may cause the server to crash due to stdio handling issues. This will be fixed in an upcoming release using the new Streaming HTTP transport protocol from the MCP specification. See [GitHub issue #120](https://github.com/Cheffromspace/MCPControl/issues/120)

## Contributing

Expand All @@ -149,4 +188,4 @@ This project is licensed under the MIT License - see the LICENSE file for detail

## References

- [Model Context Protocol Documentation](https://modelcontextprotocol.github.io/)
- [Model Context Protocol Documentation](https://modelcontextprotocol.github.io/)
Loading