RayBridge MCP Server

Bridges locally installed Raycast extensions to any MCP-compatible client.

README.md

RayBridge

MCP server that bridges Raycast extensions to any MCP-compatible client.

Discovers locally installed Raycast extensions, loads their tool definitions, and serves them over the Model Context Protocol via stdio or HTTP.

RayBridge TUI

How it works

  1. Scans ~/.config/raycast/extensions/ for installed extensions with tools definitions
  2. Loads OAuth tokens from Raycast's encrypted SQLite database
  3. Registers tools as MCP tools accessible to any MCP client

Extensions that use Raycast UI APIs (List, Detail, Form, etc.) are supported — the UI components are shimmed to no-ops so the underlying tool logic can execute headlessly. Extensions whose tools perform background work (API calls, data lookups, transformations) work best.

Setup

Prerequisites

  • Bun
  • Raycast installed with extensions
  • sqlcipher CLI (for OAuth token access): brew install sqlcipher

Install

bun install

Configure MCP client

Claude Code (~/.claude/settings.json):

{
  "mcpServers": {
    "raybridge": {
      "command": "bun",
      "args": ["run", "src/index.ts"],
      "cwd": "/path/to/raybridge"
    }
  }
}

Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "raybridge": {
      "command": "bun",
      "args": ["run", "src/index.ts"],
      "cwd": "/path/to/raybridge"
    }
  }
}

HTTP Transport

The server can also run as an HTTP server for remote MCP clients.

Start the server:

# Default: http://0.0.0.0:3000
bun run start:http

# Custom host/port
MCP_PORT=8080 MCP_HOST=0.0.0.0 bun run start:http

# With API key authentication
MCP_API_KEY=your-secret-key bun run start:http

# CLI flags also work
bun run src/index.ts --http --port 8080 --host 0.0.0.0

Endpoints:

Endpoint Method Description
/health GET Health check (no auth required)
/mcp POST MCP requests (requires auth if MCP_API_KEY set)
/mcp DELETE Terminate session

Authentication:

When MCP_API_KEY is set, requests to /mcp must include a Bearer token (per MCP spec):

Authorization: Bearer your-secret-key

Example session:

# 1. Initialize session (capture session ID from response header)
curl -X POST http://127.0.0.1:3000/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer your-secret-key" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{
    "protocolVersion":"2024-11-05",
    "capabilities":{},
    "clientInfo":{"name":"my-client","version":"1.0"}
  }}'
# Response includes: mcp-session-id header

# 2. List available tools
curl -X POST http://127.0.0.1:3000/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer your-secret-key" \
  -H "mcp-session-id: <session-id-from-step-1>" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'

# 3. Call a tool
curl -X POST http://127.0.0.1:3000/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer your-secret-key" \
  -H "mcp-session-id: <session-id-from-step-1>" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{
    "name":"web",
    "arguments":{"tool_name":"read_page","input":{"url":"https://example.com"}}
  }}'

Sessions auto-expire after 30 minutes of inactivity.

CLI

RayBridge includes a CLI for managing which extensions and tools are exposed:

bun link                    # Register the raybridge command (one-time setup)

raybridge                   # Launch interactive TUI
raybridge config            # Launch interactive TUI
raybridge list              # List all extensions and their status
raybridge help              # Show help

The TUI allows you to:

  • Toggle extensions on/off
  • Expand extensions to toggle individual tools
  • Switch between blocklist mode (all enabled by default) and allowlist mode
  • Save configuration to ~/.config/raybridge/tools.json

Configuration

Tools configuration

Control which extensions and tools are exposed via ~/.config/raybridge/tools.json:

{
  "mode": "blocklist",
  "extensions": {
    "extension-name": {
      "enabled": false
    },
    "another-extension": {
      "enabled": true,
      "tools": ["specific-tool-1", "specific-tool-2"]
    }
  }
}
  • blocklist mode (default): All extensions enabled unless explicitly disabled
  • allowlist mode: All extensions disabled unless explicitly enabled

Extension preferences

Extensions that require configuration (API keys, personal access tokens, etc.) read fr

Tools 1

raycast-extension-toolsExposes tools defined within locally installed Raycast extensions for headless execution.

Environment Variables

MCP_PORTPort for HTTP server mode
MCP_HOSTHost for HTTP server mode
MCP_API_KEYAPI key for HTTP server authentication

Try it

List all my installed Raycast extensions that are currently enabled in RayBridge.
Use the Raycast extension tool to perform a search or data lookup using my existing Raycast configuration.
Run the background logic for my installed Raycast productivity extension to process data.

Frequently Asked Questions

What are the key features of RayBridge?

Discovers and loads locally installed Raycast extensions. Supports headless execution of Raycast extension logic. Shims Raycast UI components to no-ops for background execution. Integrates with Raycast's encrypted SQLite database for OAuth tokens. Supports both stdio and HTTP transport protocols.

What can I use RayBridge for?

Automating background API calls and data lookups from Raycast extensions via Claude. Executing Raycast extension logic without needing the Raycast UI window open. Leveraging existing Raycast OAuth tokens for authenticated API interactions in AI workflows.

How do I install RayBridge?

Install RayBridge by running: bun install

What MCP clients work with RayBridge?

RayBridge works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep RayBridge docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare