revealjs-mcp

revealjs-mcp

MCP server for creating and managing reveal.js presentations via natural language, with built-in HTTP server to preview in browser.

Category
访问服务器

README

reveal.js-mcp

一个对 reveal.js(6.0.1,通过 npm 依赖引入)的薄封装 MCP 服务:让 Codex / Claude Code 等 MCP 客户端用自然语言创建 reveal.js 演示文稿,并立即通过内置 HTTP 服务在浏览器中查看。

  • 三种传输stdio(默认,供本地客户端拉起)、http(streamable HTTP,/mcp)、sse( legacy SSE,/sse + /messages
  • 内置静态服务/revealjs/* 提供 reveal.js 资源,/p/<id>/ 提供生成的演示文稿(stdio 模式下同样会启动,方便浏览器查看)
  • npx 直接接入、本地直接运行或 Docker 运行

快速接入(npx,无需安装)

在 MCP 客户端配置中:

{
	"type": "stdio",
	"command": "npx",
	"args": ["revealjs-mcp@latest"]
}

也可以直接跑一个 HTTP 服务:npx revealjs-mcp@latest --transport http --port 8000

从源码安装与构建

npm install
npm run build    # 输出到 dist/

运行

# stdio(MCP 客户端通常以这种方式拉起)
node dist/index.js

# streamable HTTP
node dist/index.js --transport http --port 8000

# legacy SSE
node dist/index.js --transport sse --port 8000

开发模式(免构建):npm run dev -- --transport http --port 8000

配置项

CLI 参数 环境变量 默认值 说明
--transport REVEALJS_TRANSPORT stdio stdio / sse / http
--port REVEALJS_PORT 8000 HTTP 端口(0 = 随机端口)
--host REVEALJS_HOST 127.0.0.1 监听地址
--data-dir REVEALJS_DATA_DIR ./presentations 演示文稿存储目录
--public-url REVEALJS_PUBLIC_URL http://localhost:<port> 工具返回 URL 使用的基础地址(反向代理时设置)

MCP 工具

工具 说明
create_presentation 从 slides 数组(HTML 或 markdown)创建演示文稿,返回可浏览的 URL
list_presentations 列出已创建的演示文稿
get_presentation_url 按 id 获取演示文稿 URL
delete_presentation 按 id 删除演示文稿
list_themes 列出 reveal.js 内置主题(black、white、dracula……)
list_transitions 列出转场样式(none/fade/slide/convex/concave/zoom)
get_server_info 服务器与 reveal.js 版本信息

create_presentation 支持 themetransitioncontrolsprogresscenterhashhighlight(语法高亮插件)以及 options(任意 reveal.js 配置透传到 Reveal.initialize())。

在 Claude Code 中配置

stdio(推荐,无需克隆仓库,直接走 npx;也可复制 examples/claude-code.mcp.json 为项目根的 .mcp.json):

{
	"mcpServers": {
		"revealjs": {
			"type": "stdio",
			"command": "npx",
			"args": ["revealjs-mcp@latest"]
		}
	}
}

或用命令注册:

claude mcp add revealjs -- npx revealjs-mcp@latest
# 已运行的 HTTP 服务:
claude mcp add --transport http revealjs http://localhost:8000/mcp
claude mcp add --transport sse  revealjs http://localhost:8000/sse

在 Codex 中配置

追加到 ~/.codex/config.toml(完整示例见 examples/codex.config.toml):

[mcp_servers.revealjs]
command = "npx"
args = ["revealjs-mcp@latest"]
env = { REVEALJS_PORT = "8000" }

# 或连接已运行的 streamable HTTP 服务:
# [mcp_servers.revealjs]
# url = "http://localhost:8000/mcp"

Docker

docker build -t revealjs-mcp .
docker run -d -p 8000:8000 -v "$PWD/presentations:/data" revealjs-mcp
# MCP endpoint: http://localhost:8000/mcp (streamable HTTP)
# 换成 SSE:  -e REVEALJS_TRANSPORT=sse

也可以 docker compose up -d(见 docker-compose.yml)。

容器内默认 --transport http --host 0.0.0.0 --port 8000 --data-dir /data(通过环境变量注入,均可覆盖)。

开发与测试

npm test                 # vitest:单元 + MCP 协议 + 三种传输端到端
npm run build            # tsc 类型检查 + 编译
scripts/docker-smoke.sh  # 构建镜像并对容器跑真实 MCP 会话冒烟测试

结构

src/config.ts         CLI/环境变量解析
src/themes.ts         reveal.js 包定位、主题/转场列表
src/presentations.ts  演示文稿的创建/列表/删除与 HTML 模板
src/mcp.ts            MCP server 与工具注册
src/http.ts           express 应用:/revealjs 静态资源、/p 演示文稿、/mcp 与 /sse 端点
src/index.ts          CLI 入口(三种传输)
test/                 vitest 测试(含三种传输的端到端)

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选