Skip to main content
Glama

通过 WebSocket 为支持 MCP 的 AI 智能体提供类型化的实时应用操作。

由 BrainBlend AI 构建


最新消息:加入我们的 Discord 社区 discord.gg/J3W9b5AZJR — 欢迎交流协议问题、反馈以及 SDK 贡献。

实时应用程序(浏览器标签页、Electron/Tauri 桌面应用、Node 守护进程、CLI)使用 Zod 风格的构建器声明操作;智能体(Claude Code、Claude Desktop、Cursor、Copilot、Codex、Cline 等)将其作为 MCP 工具调用。您的真实处理程序将针对您的真实状态运行。无需浏览器自动化,无需抓取,无需 Playwright。

为什么选择 Tesseron

  • 类型化操作,而非抓取的 DOM。 使用 Zod 或任何 Standard Schema 验证器进行声明;处理程序是针对您真实状态的普通函数。

  • 框架无关。 适用于原生 TS、React、Svelte、Vue 和 Node 的相同 API。选择您自己的技术栈。

  • MCP 原生。 每个操作、资源和能力都映射到一个标准的 MCP 原语。用户选择他们自己的智能体。

  • 一键连接。 六字符声明码握手。无需 API 密钥,无需 OAuth 流程,无需针对每个客户端进行配置。

  • 一流的能力。 ctx.confirm 用于是/否确认,ctx.elicit 用于模式验证的提示,ctx.sample 用于智能体 LLM 调用,ctx.progress 用于流式更新,可订阅资源用于实时读取。

  • 捆绑交付。 MCP 网关内置于 Claude Code 插件 中 — 一条安装命令即可完成。

Related MCP server: @agent-mcp/react

快速安装 (Claude Code)

/plugin marketplace add BrainBlend-AI/tesseron
/plugin install tesseron@tesseron

这将安装 tesseron Claude Code 插件,它会自动启动 MCP 网关并将其注册为 MCP 服务器。然后将 @tesseron/web、@tesseron/server 或 @tesseron/react 放入您的应用中,声明操作,让 Claude 驱动您的真实 UI。

import { tesseron } from '@tesseron/web';
import { z } from 'zod';

tesseron.app({ id: 'todo_app', name: 'Todo App' });

tesseron
  .action('addTodo')
  .input(z.object({ text: z.string().min(1) }))
  .handler(({ text }) => {
    state.todos.push({ id: newId(), text, done: false });
    render();
    return { ok: true };
  });

await tesseron.connect();

对于其他 MCP 客户端(Claude Desktop、Cursor、Codex、VS Code Copilot 等),请参阅 examples/README.md 中的一次性设置。

请参阅 examples/ 以获取原生 TS、React、Svelte、Vue、Express 和普通 Node 中的工作应用示例。

包

包

用途

@tesseron/core

协议类型,操作构建器。除 Standard Schema 外零运行时依赖。

@tesseron/web

浏览器 SDK。

@tesseron/server

Node SDK。

@tesseron/mcp

MCP 网关服务器(CLI;已捆绑到插件中)。

@tesseron/react

React hooks 适配器。

@tesseron/devtools

由 MCP 网关提供的浏览器内调试 UI (私有存根,尚未发布)。

create-tesseron

npm create tesseron@latest 脚手架 (私有存根,尚未发布)。

Claude Code 插件位于 plugin/,通过 .claude-plugin/marketplace.json 中的市场清单公开。

客户端能力支持

Tesseron 的操作上下文为处理程序提供了除普通工具调用之外的四种能力,每种能力都由一个 MCP 原语支持。给定的调用是否实际触发取决于用户 MCP 客户端的声明:

SDK 表面

MCP 原语

tool(...) (操作调用)

tools

resource(...) (实时读取,订阅)

resources (+ resources.subscribe)

ctx.sample(...)

sampling

ctx.confirm(...) / ctx.elicit(...)

elicitation

ctx.progress(...)

notifications/progress (客户端必须在 tools/call 上传递 _meta.progressToken)

有关哪些客户端支持哪些原语的权威且持续更新的列表,请参阅 官方 MCP 客户端兼容性矩阵 — 通过 Sampling 或 Elicitation 进行过滤,以查看该领域的覆盖范围。在选择能力之前,有几点值得了解:

  • 工具 是通用的 — 每个 MCP 客户端都可以调用您的操作。

  • 采样 (Sampling) 是最罕见的。Claude Code、Claude Desktop 和 Claude.ai 不公开它;目前的支持主要集中在 VS Code + GitHub Copilot、goose 和 fast-agent 中。

  • 启发 (Elicitation) (MCP 2025-06) 已在 Claude Code (2.1.76, 2026年3月)、Cursor、Codex、VS Code Copilot、goose 和 fast-agent 中落地,但不支持 Claude Desktop、Claude.ai、ChatGPT、Windsurf 或 Zed。

  • 当能力缺失时,Tesseron 会引发类型化错误(SamplingNotAvailableError、ElicitationNotAvailableError)或回退到安全默认值(ctx.confirm 返回 false),因此处理程序可以显式分支,而不是静默地表现异常。

状态

v1.0 于 2026 年 4 月发布。协议在 1.0.0 处保持稳定,并有意保持精简:基于 WebSocket 的双向 JSON-RPC 2.0、动态 MCP 工具注册、一键连接握手、流式进度、取消、采样、确认、模式验证的启发、可订阅资源。

已发布到 npm(均为 v1.0.1):@tesseron/core、@tesseron/web、@tesseron/server、@tesseron/react、@tesseron/mcp。JS/TS SDK 是参考实现;协议规范采用 CC BY 4.0,因此任何人都可以用任何语言编写兼容的客户端或服务器。

路线图:Svelte/Vue 适配器、devtools UI、可流式传输的 HTTP 传输、Python SDK 以及桌面原生运行时的绑定(用于 Tauri 的 Rust 等)。

开发

pnpm install
pnpm typecheck
pnpm test                                    # 65 tests across core + mcp
pnpm --filter @tesseron/mcp build:plugin     # rebuild plugin/server/index.cjs after gateway changes

贡献

欢迎提交错误报告、协议改进、新的框架适配器以及对参考实现的改进。

  • 阅读 CONTRIBUTING.md 了解工作流程。

  • 每次提交必须根据 开发者原产地证书 进行 Signed-off-by: 签名 — 使用 git commit -s。

  • 对于大于小修复的任何内容,请先开启一个 issue。

Star 历史

许可证

参考实现 — 商业源码许可证 1.1 (源码可用)。您可以将 Tesseron 嵌入到您自己的应用程序中,在内部使用它,对其进行分叉,并自由重新分发。您不得将 Tesseron 或其很大一部分作为托管或管理服务提供给第三方。每个版本在发布四年后自动转换为 Apache-2.0。

协议规范 — CC BY 4.0。明确鼓励以任何语言、出于任何目的(包括商业目的)进行兼容实现。

欢迎根据 开发者原产地证书 做出贡献 — 每次提交必须包含 Signed-off-by。


Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to discover and call business actions from browser-only legacy web applications as typed MCP tools, executing them through the original GUI via Playwright.
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables agents to drive a running React application through typed MCP tools, using the same actions as the UI instead of browser automation.
    28 npm
    1
    Apache 2.0
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables remote AI agents to control a local, authenticated desktop browser over MCP through an outbound WebSocket bridge and Chrome extension, supporting tab management, navigation, page reading, clicking, typing, scrolling, screenshots, and JavaScript evaluation.
    1
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to control live Zen Browser and Firefox tabs via MCP, performing actions like navigation, clicking, typing, scrolling, and running JavaScript through a local WebSocket bridge.
    MIT