Skip to content

Latest commit

Β 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GPT Inner Call (Browcall)

Nx Node.js React TypeScript Express.js Vite Playwright n8n License

GPT Inner Call is a monorepo project designed to bridge the gap between AI chat interfaces (like ChatGPT and Perplexity), automated workflows, and local Model Context Protocol (MCP) servers.

Browcall Demo

Watch Browcall Demo Video
▢️ Watch Demo Video on YouTube


πŸš€ Key Components

The project is organized as a monorepo using Nx:

🧩 Apps

  • Browcall Extension: A browser extension (Manifest V3) that injects logic into AI chat platforms (ChatGPT, Perplexity) to facilitate automated interactions.
  • GPT Auto API: A Node.js backend server that exposes an OpenAI-compatible /v1/chat/completions endpoint. It communicates with the browser extension to execute requests and retrieve responses.
  • MCP Gateway: Remote MCP proxy and routing server that exposes an MCP endpoint (/mcp) for GPT/clients and accepts WebSocket connections from Local MCP Bridges.
  • Interface CLI: CLI launcher tool (browcall) to manage and quick-start all backend services (gpt-auto-api, mcp-gateway, local-mcp-bridge). Publishable to NPM as @ducy23061999/browcall-cli.

πŸ“¦ Packages

  • n8n-nodes-browcall-gate: Custom n8n nodes to integrate Browcall directly into your automation workflows.
  • Interfaces: Shared TypeScript definitions and interfaces used across the monorepo.

⚑ MCP Architecture Flow

GPT / Client
     β”‚
     β”‚ HTTP POST / GET (JSON-RPC 2.0 / MCP Endpoint: http://localhost:8767/mcp)
     β–Ό
MCP Gateway (apps/mcp-gateway)
     β”‚
     β”‚ Workspace-aware WebSocket routing (ws://localhost:8768)
     β–Ό
Local MCP Bridge(s)
     β”‚
     β”‚ Stdio / Child Process (JSON-RPC 2.0)
     β–Ό
Local MCP Server(s) (e.g., @modelcontextprotocol/server-filesystem)

Workspace-aware multi-bridge routing

The MCP Gateway supports multiple Local MCP Bridge connections concurrently, including multiple bridge instances with the same bridgeId.

The routing model is:

User / AI Request
       β”‚
       β–Ό
   Workspace
       β”‚
       β–Ό
     Bridge
       β”‚
       β–Ό
      Tool
  • Workspace identifies the project/context where an operation should run.
  • Bridge identifies the local MCP connection that provides access to that workspace.
  • Scope is the filesystem boundary enforced by the bridge.
  • A request with an explicit workspaceId is routed only to bridges registered for that workspace. It never silently falls back to another workspace.
  • Multiple bridge connections can belong to the same workspace, allowing duplicate bridge instances without rejecting an existing socket.
  • MCP sessions can select a workspace with the workspaceId query parameter or x-workspace-id header.

Example workspace mapping:

mighty-note-backend
  β†’ mac-local-bridge
  β†’ /Users/tranducy/Documents/Project/mighty_note_backend

gpt-inner-call
  β†’ mac-local-bridge-1787664580312-17sl
  β†’ /Users/tranducy/Documents/Project/gpt-inner-call

The execution flow is:

User Request
    ↓
Workspace Resolution
    ↓
Bridge Resolution
    ↓
MCP Tool Execution

πŸ›  Tech Stack

  • Monorepo Management: Nx
  • Backend: Node.js, Express, WebSocket (ws)
  • Frontend/Extension: React, TypeScript, Vite
  • Integration: n8n, Model Context Protocol (MCP)

🎬 Getting Started

Prerequisites

  • Node.js (v18+)
  • Yarn or npm
  • Google Chrome or Chromium-based browser (for the extension)

Installation

  1. Clone the repository:

    git clone https://github.com/gys-dev/browcall-gate.git
    cd browcall-gate
  2. Install dependencies:

    yarn install
    # or
    npm install

πŸƒ Running & Development

1. GPT Auto API & Extension

  • Start API server:

    yarn serve

    Runs at http://localhost:8766.

  • Build Extension:

    yarn build-extension-react

    Artifacts located in dist/apps/extension. Load as an unpacked extension in Chrome.

2. MCP Gateway & Local MCP Bridge

  • Start MCP Gateway:

    yarn serve:gateway

    Starts HTTP server at http://localhost:8767 and WebSocket server at ws://localhost:8768.

  • Start Local MCP Bridge:

    yarn serve:bridge

    Connects to ws://localhost:8768 and initializes configured local MCP servers (e.g., filesystem MCP).

  • Build Gateway & Bridge:

    yarn build:gateway
    yarn build:bridge

3. Interface CLI (Quick-Start All Services)

  • Start all backend services via CLI:

    # Build backend services & CLI
    yarn build:all:apps
    
    # Launch CLI (starts gpt-auto-api, mcp-gateway, local-mcp-bridge)
    yarn start:cli start --all
    
    # Or launch interactive menu
    yarn start:cli interactive
  • Prepare & Publish CLI to NPM:

    # Prepares dist/apps/interface-cli with embedded dist artifacts
    yarn prepare:cli-dist
    
    # Build, prepare dist, and publish
    yarn publish:cli

βš™οΈ Local MCP Bridge Configuration

Create an mcp-config.json file in the root directory (see mcp-config.sample.json):

{
  "gatewayUrl": "ws://localhost:8768",
  "bridgeId": "mac-local-bridge",
  "clientName": "Local Mac MCP Bridge",
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/me/projects"
      ]
    }
  }
}

πŸ“– API Documentation

Claude Code (Anthropic Messages API)

  • Endpoint: POST /v1/messages (Port 8766)
  • Description: Anthropic Messages API specification for Claude Code CLI integration (ANTHROPIC_BASE_URL=http://localhost:8766).

Live SSE Streaming

  • Endpoint: GET /sse or POST /sse (Port 8766)
  • Description: Real-time live rendering streaming deltas via Server-Sent Events.

MCP Gateway

  • Endpoint: POST /mcp & GET /sse (Port 8767)
  • Description: Forwards JSON-RPC 2.0 MCP requests (tools/list, tools/call, initialize, ping) to connected Local MCP Bridges with workspace-aware routing.
  • Workspace selection: workspaceId query parameter or x-workspace-id header.
  • Health Check: GET /health includes active bridge and workspace information.
  • Connected Bridges & Tools: GET /bridges

Multi-bridge verification

The project includes an end-to-end test covering concurrent bridge connections, duplicate bridge IDs, workspace routing, tool aggregation, and collision disambiguation:

yarn ts-node scripts/test-multi-bridge-e2e.ts

The verification currently passes with three concurrent bridge connections, including two connections registered with the same bridgeId.

For step-by-step setup guides, see the Claude Code & AI Agent Guide.


🀝 Contributing

  1. Follow the Knowns Guidelines.
  2. Ensure linting passes: npm run lint.
  3. Test your changes: npm run test.

πŸ“„ License

This project is licensed under the MIT License.

About

GPT Inner Call is a monorepo project designed to bridge the gap between AI chat interfaces (like ChatGPT and Claude) and automated workflows. It provides a way to "call" these AI models internally by automating their web interfaces through a dedicated browser extension.

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages