MCP 服务器,将 Raycast 扩展桥接到任何兼容 MCP 的客户端
概览
MCP 服务器将 Raycast 扩展桥接到任何兼容 MCP 的客户端。 发现本地安装的 Raycast 扩展,加载其工具定义,并通过 Stdio 或 HTTP 通过模型上下文协议提供。 1. 扫描 ~/.config/raycast/extensions/ 以查找已安装的扩展及其工具定义 2.从 Raycast 加密的 SQLite 数据库加载 OAuth 令牌 3.将工具注册为对任何 MCP 客户端可访问的 MCP 工具 支持使用 Raycast UI API(列表、详细、表单等)的扩展——UI 组件被调整为无操作,使底层工具逻辑能够无头执行。那些工具执行后台工作(API 调用、数据查找、转换)的扩展效果最佳。 - Bun - 带扩展安装的 Raycast - sqlcipher CLI(用于 OAuth 令牌访问):brew 安装 sqlcipher 服务器也可以作为远程 MCP 客户端的 HTTP 服务器运行。
概述(AI 翻译)
MCP 服务器将 Raycast 扩展桥接到任何兼容 MCP 的客户端。
发现本地安装的 Raycast 扩展,加载其工具定义,并通过 Stdio 或 HTTP 通过模型上下文协议提供。
它是如何运作的
- 扫描
~/.config/raycast/extensions/以查找带有tools定义的已安装扩展 - 从 Raycast 加密的 SQLite 数据库加载 OAuth 令牌
- 将工具注册为对任何MCP客户端可访问的MCP工具
支持使用Raycast UI API(List、Detail、Form等)的扩展——UI组件被调整为无操作,使底层工具逻辑能够无头执行。那些工具执行后台工作(API、数据查找、转换)的扩展效果最佳。
布置
先决条件
- 面包
- 带扩展功能的Raycast安装
sqlcipherCLI(用于OAuth令牌访问):brew install sqlcipher
安装
配置MCP客户端
Claude 代码 (~/.claude/settings.json):
光标 (~/.cursor/mcp.json):
HTTP 传输
服务器也可以作为远程 MCP 客户端的 HTTP 服务器运行。
启动服务器:
终点:
| 终点 | 方法 | 描述 |
|---|
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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.
How it works
- Scans
~/.config/raycast/extensions/for installed extensions withtoolsdefinitions - Loads OAuth tokens from Raycast’s encrypted SQLite database
- 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
sqlcipherCLI (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" \
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"raybridge": {
"command": "bun",
"args": ["run", "src/index.ts"],
"cwd": "/path/to/raybridge"
}
}
}