Logo de Kapture

Kapture

Communauté
williamkapke

Chrome DevTools Extension that enables browser automation through MCP

Éditeurwilliamkapke
Dépôtkapture
LangueJavaScript
Forks
54
Étoiles
184
Outils disponibles
21
Type de transportstdio
Catégories
Liens
  • Connectez des outils à vos workflows IA

    Kapture propose des fonctionnalités MCP utilisables par les clients et agents IA compatibles.

  • 21 outils disponibles

    Parcourez les actions invocables ci-dessous, avec leurs noms et descriptions lorsque le serveur les fournit.

  • Configuration prête à copier

    Utilisez les exemples de configuration pour configurer ce serveur dans votre client MCP préféré.

  • Indicateurs de popularité open source

    184 étoiles et 54 forks sur le dépôt associé.

Kapture - Browser Automation via Chrome DevTools

Kapture is a Chrome DevTools Extension that enables browser automation through the Model Context Protocol (MCP). It allows AI applications like Claude to control web browsers via a three-layer architecture.

✨ Key Feature: Multiple AI clients can connect to the same server! Claude Desktop, Cline, and other MCP clients can all control browser tabs through a single server instance.

Available in the Chrome Web Store

Kapture DevTools Extension Panel

Overview

Kapture bridges AI assistants with web browsers through:

  • MCP Server: Handles MCP protocol communication
  • Chrome Extension: Background service worker executes browser automation commands (DevTools does not need to be open)
  • WebSocket Bridge: Real-time communication between server and extensions
  • Multi-Client Support: Multiple AI clients can connect simultaneously via WebSocket

Architecture

How Kapture Works

Quick Start

1. Install Dependencies

bash
# Server
cd server
npm install
npm run build

# Test App (optional)
cd test-app
npm install

2. Install Chrome Extension

Option A: Install from Chrome Web Store (Recommended)

  1. Visit the Kapture Chrome Web Store page
  2. Click "Add to Chrome"
  3. Confirm the installation

Option B: Load Unpacked (Developer Mode)

  1. Open Chrome and navigate to chrome://extensions/
  2. Enable "Developer mode"
  3. Click "Load unpacked"
  4. Select the extension folder

3. Start MCP Server

Configure your AI client and open it. It will start the MCP server automatically.

OR

Run the Test App:

bash
cd test-app
npm run dev

The server starts on port 61822.

bash
# Server
cd server
npm start

# Test App
cd test-app
npm start

4. Connect a Tab

  1. Open any website in Chrome
  2. Click the Kapture toolbar icon and flip the connection toggle
  3. The extension connects to the server on port 61822 (the badge shows ✓ when connected)

Alternatively, connect from the "Kapture" panel in DevTools, or load a page with ?kapture-connect=true in the URL to auto-connect.

Using with Claude Desktop

Add to your Claude Desktop config:

Option 1: Using the bridge command (Recommended)

This single command starts the server and handles stdio-to-WebSocket translation:

json
{
  "mcpServers": {
    "kapture": {
      "command": "npx",
      "args": ["-y", "kapture-mcp@latest", "bridge"]
    }
  }
}

Option 2: Direct WebSocket connection (Advanced)

For advanced use cases where you need manual server control:

  1. Start the server manually:
bash
npx kapture-mcp
  1. Configure Claude Desktop to connect via WebSocket:
json
{
  "mcpServers": {
    "kapture": {
      "transport": "websocket",
      "url": "ws://localhost:61822/mcp"
    }
  }
}

Note: This approach requires manually managing the server lifecycle. Use Option 1 (bridge command) for most use cases.

🚀 Run Multiple AI Assistants Simultaneously

Kapture supports multiple MCP clients connecting to the same server! You can run Claude Desktop, Cline, and other MCP clients simultaneously through a single server instance.

How It Works

  • All MCP clients connect via WebSocket to ws://localhost:61822/mcp
  • All MCP clients share access to the same browser tabs
  • Notifications are broadcast to all connected clients

Smart Server Detection

When running npx kapture-mcp, the command automatically detects if a server is already running:

  • No existing server: Starts a new server on port 61822
  • Server already running: Shows connection information and exits gracefully

This prevents errors and confusion when multiple clients try to start servers.

Setting Up Multiple Clients

Each client should use the same bridge command configuration:

Claude Desktop:

json
{
  "mcpServers": {
    "kapture": {
      "command": "npx",
      "args": ["-y", "kapture-mcp@latest", "bridge"]
    }
  }
}

Cline/VS Code:

json
{
  "cline.mcpServers": {
    "kapture": {
      "command": "npx",
      "args": ["-y", "kapture-mcp@latest", "bridge"]
    }
  }
}

Other MCP Clients: Use the same configuration pattern with "command": "npx" and "args": ["-y", "kapture-mcp@latest", "bridge"].

See the complete multi-assistant guide →

Benefits of Multiple AI Assistants:

  • Parallel Workflows: Have Claude Desktop research while Cline develops code
  • Specialized Tasks: Use different AI clients for different types of automation
  • Team Collaboration: Multiple team members can use their preferred AI tools simultaneously
  • Testing & Development: Test automation scripts with one AI while developing with another

Then ask Claude to interact with web pages:

  • "Navigate to example.com and take a screenshot"
  • "Click the search button"
  • "Fill in the email field with test@example.com"

Available MCP Tools

  • navigate - Navigate to URL
  • back - Browser back button
  • forward - Browser forward button
  • reload - Reload the current page (similar to pressing F5)
  • click - Click elements (uses first matching element, returns unique selector)
  • hover - Hover over elements (uses first matching element, returns unique selector)
  • fill - Fill input fields by setting value directly (uses first matching element, returns unique selector)
  • type - Type a string as individual keystrokes (real key events; works on "fake" inputs that ignore element.value)
  • insertText - Insert a whole string at once (fires input events but no per-key events; good for bulk text and editors like Google Docs)
  • clear - Clear a text field via select-all + Backspace (real key events; works on "fake" inputs)
  • select - Select dropdown options (HTML <select> only, uses first matching element, returns unique selector)
  • keypress - Send keyboard events to the page or specific elements (supports modifier keys)
  • scroll - Scroll an element into view (selector/xpath) or to an absolute x/y document coordinate
  • elements - Query all elements matching a CSS selector or XPath with optional visibility filtering
  • console_logs - Get the tab's console contents (console messages, uncaught exceptions, browser-generated entries)
  • watch_console - Watch the console in real time for a required timeout (ms), then return everything logged during the window
  • network_monitor - Turn network monitoring on/off for a tab (enabled boolean). While on, every request's metadata is captured into a per-tab buffer. Watchers are tracked by client identity: enable is idempotent, monitoring stays on until every watcher disables (or force:true), and disconnected clients are released automatically. The buffer clears when monitoring fully stops. Enable it before the traffic you want to observe — capture has no history. (Extension 1.1.0+)
  • network_requests - List the captured requests; each carries a requestId, a monotonic seq, and hasPostData when the request had a payload. Poll incrementally by passing the prior call's cursor as since.
  • network_body - Fetch a request's bodies by requestId (monitoring must be on): the requestBody POST payload and the response body. Truncated to maxBytes (default 65536) with bodyTruncated:true while size reports the full length; returns bodyError if the response body was evicted or is streaming (text/event-stream can't be read via CDP).
  • evaluate - Execute JavaScript in the page and return the result. Off by default: only available after enabling the "Allow JS execution" toggle in the extension popup or DevTools panel for a connected tab. The grant resets on disconnect.
  • compose - Run a sequence of commands against one tab in a single call. Script is one command per line as <tool>?<query-string> (plus wait?t=<ms>); runs in order, stops on first failure, returns an array of per-command responses.

Note on Selectors: Tools that accept a selector parameter (click, hover, fill, type, insertText, clear, select, keypress, scroll, screenshot, dom) will only operate on the first element that matches the CSS selector. The tool response includes the unique selector of the actual element that was used, which may include an auto-generated ID if the element didn't have one.

XPath Support: All tools that accept a selector parameter also accept an xpath parameter as an alternative. This is particularly useful for:

  • Finding elements by text content: xpath: "//button[contains(text(), 'Submit')]"
  • Complex element relationships: xpath: "//div[@class='container']//span[2]"
  • When CSS selectors are insufficient

Use either selector OR xpath, not both. If both are provided, selector takes precedence.

Keypress Tool

The keypress tool simulates keyboard events. It accepts:

  • key (required): The key combination to press. Can be:
    • Single key: "a", "Enter", "Tab", "Escape", " " (space), "Shift", "Control"
    • With modifiers: "Control+a", "Shift+Tab", "Alt+F4", "Meta+Shift+p"
    • Modifier names: Control (or Ctrl), Shift, Alt, Meta (or Cmd/Command)
    • Note: When sending just a modifier key (e.g., "Shift"), it's treated as pressing that key alone
    • Duplicate modifiers are ignored (e.g., "Shift+Shift+a" is same as "Shift+a")
  • selector or xpath (optional): Target a specific element. If not provided, sends to document.body

Examples:

json
// Press Enter
{ "key": "Enter", "selector": "#login-form" }

// Select all text (Ctrl+A)
{ "key": "Control+a", "selector": "#username" }

// Zoom in (Ctrl+Plus)
{ "key": "Control++", "selector": "body" }

// Zoom out (Ctrl+Minus)
{ "key": "Control+-", "selector": "body" }

// New tab (Ctrl+T)
{ "key": "Control+t" }

// Close tab (Ctrl+W or Cmd+W on Mac)
{ "key": "Meta+w" }

MCP Resources

  • kapture://tabs - List all connected browser tabs
  • kapture://tab/{tabId} - Get detailed information about a specific tab
  • kapture://tab/{tabId}/console - Get console logs from a specific tab (with pagination support)
  • kapture://tab/{tabId}/screenshot - Capture screenshots of a tab or element
  • kapture://tab/{tabId}/dom - Get HTML content of a tab or element
  • kapture://tab/{tabId}/elementsFromPoint - Get elements at specific coordinates
  • kapture://tab/{tabId}/elements?selector={selector}&visible={true|false|all} - Query all elements matching a CSS selector or XPath with optional visibility filtering

Development

Server Development

bash
cd server
npm run dev    # Development with hot-reload

Test App

bash
cd test-app
npm run dev    # Run Electron test app

Extension Development

After making changes:

  1. Go to chrome://extensions/
  2. Click refresh on Kapture extension

Key Components

Server (/server/src):

  • mcp-server-manager.ts - MCP protocol implementation (one server instance per client)
  • browser-websocket-manager.ts - WebSocket server for extension connections
  • tab-registry.ts - Tab tracking
  • tool-handler.ts + tools.yaml - MCP tool definitions and dispatch

Extension (/extension):

  • background.js + modules/ - Service worker: owns WebSocket connections and executes commands (via chrome.debugger and chrome.tabs APIs)
  • page-helpers.js - Content script handling DOM commands (dom, elements, fill, select, ...)
  • modules/background-console.js - Console retrieval via CDP (reads Chrome's per-page console buffer; no extension-side log storage)
  • popup.js - Toolbar popup with connection toggle
  • panel.js - DevTools panel (connection toggle, WebSocket message viewer)

DevTools Panel Features

  • Connection Toggle - Connect/disconnect the inspected tab
  • Connection Status - Real-time server connection indicator
  • Message Viewer - Live view of WebSocket messages between extension and server
  • Keepalive Setting - Configurable ping interval

The panel is optional — connections and commands are handled by the background service worker, so automation works with DevTools closed.

Troubleshooting

Connection Issues

  • The extension connects to the server on port 61822
  • Verify the server is running (curl http://localhost:61822/)
  • Check the toolbar icon badge: ✓ = connected, ↻ = retrying
  • Check the background service worker console (chrome://extensions/ → Kapture → service worker)
  • Check server logs in the terminal

Extension Not Showing

  • Ensure extension is loaded and enabled
  • Close and reopen DevTools
  • Reload extension in chrome://extensions/

Command Timeouts

  • Default timeout is 5 seconds
  • Some commands accept custom timeout parameter
  • Check element selectors are correct

Security

  • DOM commands run in the content script's isolated world; input/navigation/screenshot commands use chrome.debugger (CDP)
  • Each tab has unique ID preventing cross-tab interference
  • No direct file system access from extension
  • Tab registry enforces command isolation

License

MIT

Installation

TypingMind
{
  "mcpServers": {
    "kapture": {
      "command": "node",
      "args": [
        "/path/to/kapture/server/dist/index.js"
      ]
    }
  }
}

Outils disponibles

  • list_tabs

    List all connected browser tabs

  • tab_detail

    Get detailed information about a specific tab

  • navigate

    Navigate browser tab to specified URL

  • back

    Navigate back in browser history

  • forward

    Navigate forward in browser history

  • click

    Click on a page element using CSS selector or XPath. Only the first matching element will be clicked. Returns the unique selector of the clicked element. Note: May experience delays if Kapture DevTools panel is not the active tab.

  • hover

    Hover over a page element using CSS selector or XPath. Only the first matching element will be hovered. Returns the unique selector of the hovered element. Note: May experience delays if Kapture DevTools panel is not the active tab.

  • focus

    Set focus on a page element using CSS selector or XPath. Only the first matching element will be focused. Returns the unique selector of the focused element. Useful for form inputs, buttons, and other interactive elements.

  • blur

    Remove focus (blur) from a page element using CSS selector or XPath. Only the first matching element will be blurred. Returns the unique selector of the blurred element. Also removes focus from document.activeElement if different.

  • fill

    Fill an input field with a value using CSS selector or XPath. Only the first matching element will be filled. Returns the unique selector of the filled element.

  • select

    Select an option from an HTML dropdown element using CSS selector or XPath. Only the first matching select element will be used. Returns the unique selector of the select element. Note: Only works with native HTML select elements, not custom dropdowns.

  • keypress

    Send a keypress event to the current tab or a specific element. Uses Chrome DevTools Protocol for proper key simulation including navigation keys (Tab, PageDown, arrows) and function keys. When delay > 500ms, automatically simulates holding the key down with repeated events.

  • screenshot

    Capture a screenshot of the page or specific element using CSS selector or XPath. When a selector/xpath is provided, only the first matching element will be captured. Returns the unique selector of the captured element if applicable.

  • dom

    Get outerHTML of the body or a specific element using CSS selector or XPath. When a selector/xpath is provided, only the first matching element will be used. Returns the unique selector of the element if applicable.

  • elements

    Query all elements matching a CSS selector or XPath and get detailed information about each element. Use the visible parameter to filter elements by visibility status.

  • elementsFromPoint

    Get information about all elements at a specific coordinate in the viewport

  • console_logs

    Get console logs from a browser tab

  • new_tab

    Opens a new browser tab with the Kapture MCP usage documentation page. The page will automatically connect to the Kapture server. Returns the tab ID of the newly opened tab once it connects.

  • close

    Closes a browser tab. The tab will be immediately closed and removed from the connected tabs list.

  • reload

    Reloads the current page in the browser tab. Performs a standard page reload similar to pressing F5 or clicking the browser's refresh button.

  • show

    Brings the browser tab to the front and focuses it. This will switch to the tab's window and make it the active tab. Useful for directing user attention to a specific tab when managing multiple browser tabs.

Utilisez le serveur MCP Kapture avec plusieurs modèles IA

TypingMind connecte les outils MCP au niveau de l’espace de travail. Une fois Kapture connecté, vous pouvez donc l’utiliser avec différents modèles IA dans TypingMind sans avoir à le configurer séparément pour chaque modèle. Cette intégration MCP s’exécute localement sur votre appareil via le connecteur MCP de TypingMind.

Guide de configuration du connecteur local

Choisissez cette méthode si le serveur MCP doit accéder à des fichiers locaux, à des applications ou à des ressources privées sur votre ordinateur.

1

Ouvrir les paramètres MCP

Dans TypingMind, accédez à « Paramètres », puis à « Paramètres avancés » et à « Model Context Protocol », et choisissez « Configurer connecteur ».

  1. Ouvrez TypingMind dans votre navigateur.
  2. Cliquez sur l’icône Paramètres.
  3. Accédez aux paramètres avancés.
  4. Ouvrez la section Model Context Protocol.
  5. Cliquez sur « Configurer connecteur » et choisissez « Cet appareil ».
Écran de configuration du connecteur MCP de TypingMind avec l’option « Cet appareil » sélectionnée
2

Exécuter la commande du connecteur

Choisissez « Cet appareil », copiez la commande depuis TypingMind et exécutez-la dans Terminal. Laissez le processus en cours d’exécution pendant que vous utilisez MCP.

  1. Copiez la commande de configuration affichée par TypingMind.
  2. Ouvrez Terminal sur macOS ou Windows Terminal sur Windows.
  3. Collez et exécutez la commande.
  4. Autorisez l’installation du paquet si Terminal vous demande de confirmer.
  5. Gardez la fenêtre de Terminal ouverte et le processus en cours d’exécution pendant que vous utilisez les outils MCP.
3

Ajoutez Kapture en tant que serveur

Lorsque l’état du connecteur affiche « Prêt », cliquez sur « Éditer serveurs » et collez la configuration du serveur MCP.

  1. Attendez que l’état du connecteur affiche « Prêt ».
  2. Cliquez sur « Éditer serveurs ».
  3. Collez la configuration du serveur MCP Kapture.
  4. Enregistrez la liste des serveurs.
  5. Actualisez pour vérifier que le connecteur est toujours prêt.
Paramètres MCP de TypingMind affichant un serveur actif et le bouton « Éditer serveurs »
{
  "mcpServers": {
    "kapture": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Utiliser la connexion avec différents modèles

Enregistrez la liste des serveurs, ouvrez « Plugins », activez les outils MCP de Kapture, puis sélectionnez un modèle IA compatible dans TypingMind et utilisez les outils dans une discussion ou attribuez-les à un agent IA.

  1. Ouvrez la page Plugins dans TypingMind.
  2. Activez les outils MCP de Kapture.
  3. Démarrez une discussion et choisissez le modèle IA que vous souhaitez utiliser.
  4. Utilisez les outils MCP dans le chat ou attribuez-les à un agent IA.
  5. Passez à un autre modèle IA selon vos besoins sans rétablir la connexion MCP.
Discussion TypingMind utilisant des outils MCP activés avec un modèle d’IA sélectionné
Pouvez-vous utiliser Kapture pour m’aider dans cette tâche ?
Kapture
Bien sûr. J’ai tout lu.
Voici ce que j’ai trouvé avec Kapture.

Foire aux questions

À quoi sert le serveur MCP Kapture ?

Kapture est un serveur MCP qui permet aux applications IA compatibles d’accéder à des outils et à des informations contextuelles externes. Dans TypingMind, il vous suffit d’ajouter ce serveur MCP une seule fois pour rendre ses outils disponibles dans votre espace de travail IA.

Puis-je utiliser le serveur MCP Kapture avec plusieurs modèles IA dans TypingMind ?

Oui. TypingMind connecte les outils MCP au niveau de l’espace de travail. Vous pouvez donc utiliser Kapture avec différents modèles IA comme Claude, ChatGPT, Gemini ou d’autres modèles configurés dans TypingMind, sans avoir à configurer le serveur MCP séparément pour chaque modèle.

Pourquoi utiliser le connecteur MCP Kapture avec TypingMind ?

TypingMind est l’une des meilleures interfaces de chat avec les LLM, car elle réunit plusieurs modèles IA, prompts, plugins, agents IA, clés API et outils MCP dans un seul espace de travail. Une fois Kapture connecté, vous pouvez utiliser ses outils MCP avec vos modèles préférés tout en gardant vos discussions bien organisées dans TypingMind.

Comment connecter le serveur MCP Kapture à TypingMind ?

Kapture fonctionne via le connecteur MCP local de TypingMind. C’est l’option idéale lorsque le serveur MCP doit accéder à des fichiers locaux, des applications de bureau, des outils en ligne de commande ou des ressources privées sur votre ordinateur.

Quels outils le serveur MCP Kapture propose-t-il dans TypingMind ?

Kapture propose 21 outils MCP que vous pouvez activer depuis la page Plugins de TypingMind et utiliser dans les discussions ou attribuer à des agents IA.

Dois-je partager mes clés API avec TypingMind pour utiliser le serveur MCP Kapture ?

Non. TypingMind privilégie le fonctionnement local et vous permet de garder le contrôle de vos fournisseurs de modèles, clés API, prompts et paramètres MCP. Si Kapture nécessite une authentification, ajoutez les en-têtes, les paramètres OAuth ou la configuration locale requis pour ce serveur MCP lors de la création de la connexion.

Connected Browser Tabs

List of all browser tabs connected to the Kapture server

Serveurs MCP similaires

Tout voir

Créez votre propre espace IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇