READMEmain
We couldn't render this README. Read it on GitHub
Cursor MCP (Model Context Protocol)
A browser extension that provides enhanced debugging and context gathering capabilities for Cursor IDE. This extension allows you to capture console logs, network requests, screenshots, and selected DOM elements from web pages.
Features
- Console Logging: Capture and view all console logs and errors
- Network Monitoring: Track successful and failed network requests
- Screenshot Capture: Take screenshots of the current tab
- DOM Element Selection: Get details about selected elements on the page
- Log Management: Clear logs when needed
- Cursor Integration: Seamlessly integrate with Cursor IDE settings
Functions
The MCP provides the following functions:
- GetConsoleLogs: Retrieve all console logs from the current tab
- GetConsoleErrors: Retrieve all console errors from the current tab
- GetNetworkErrorLogs: Retrieve logs of failed network requests
- GetNetworkSuccessLogs: Retrieve logs of successful network requests
- TakeScreenshot: Capture a screenshot of the current tab
- GetSelectedElements: Get information about elements selected on the page
- WipeLogs: Clear all stored logs
Installation
Browser Extension
- Clone this repository or download the source code
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top-right corner
- Click "Load unpacked" and select the
cursor-mcpdirectory - The extension should now be installed and visible in your browser toolbar
See INSTALL.md for detailed installation instructions.
Adding to Cursor Settings
To add the MCP to Cursor IDE settings:
- Open Cursor IDE
- Go to Settings (gear icon in the bottom left corner)
- Navigate to the "Extensions" or "MCPs" section
- Click "Add MCP"
- Enter the MCP information and click "Add"
See CURSOR_SETTINGS.md for detailed instructions on adding the MCP to Cursor settings.
Usage
Browser Extension
- Click on the Cursor MCP icon in your browser toolbar to open the popup
- Use the tabs to navigate between different functions:
- Console: View console logs and errors
- Network: View network request logs
- Tools: Take screenshots and get selected elements
Cursor IDE Integration
Once added to Cursor settings, you can use the MCP directly from Cursor:
// Get console logs
const logs = await window.cursor.mcp.getConsoleLogs();
// Take a screenshot
const screenshot = await window.cursor.mcp.takeScreenshot();
// Get all context
const context = await window.cursor.mcp.getAllContext();
Configuration
The MCP can be configured through Cursor settings:
- Log Limit: Maximum number of logs to store per tab
- Capture Console: Enable/disable console log capture
- Capture Network: Enable/disable network request capture
- Auto Capture: Automatically include MCP context when sending to LLM
Development
Project Structure
cursor-mcp/
├── icons/
│ ├── icon16.png
│ ├── icon48.png
│ └── icon128.png
├── src/
│ ├── api.js
│ ├── background.js
│ ├── content.js
│ ├── cursor-integration.js
│ ├── popup.html
│ ├── popup.js
│ └── settings-integration.js
├── test/
│ └── test-page.html
├── API.md
├── CURSOR_SETTINGS.md
├── INSTALL.md
├── README.md
├── cursor-config.json
└── manifest.json
Building and Testing
- Make changes to the source code
- Reload the extension in Chrome by clicking the refresh icon on the extension card
- Test the functionality in different web pages
- Use the test page at
test/test-page.htmlto verify functionality
Documentation
- API.md - Detailed API documentation
- INSTALL.md - Installation instructions
- CURSOR_SETTINGS.md - Instructions for adding to Cursor settings
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
