ai-display
v0.2.2
Published
MCP server for AI Display - AI can output any content to screen, get and update markdown documents in real-time
Maintainers
Readme
AI Display MCP Server
让 AI 可以将任何内容输出到屏幕的 MCP (Model Context Protocol) 服务器。提供实时获取和更新 Markdown 文档的功能,让 AI 能够直接在浏览器中展示内容。
功能
工具
get_content - 获取 Markdown 文档内容
- 环境变量:
DOC_ID(必需): 文档ID,在 MCP 配置中设置
- 参数:
baseUrl(可选): API 基础URL,默认为https://markdown-live-for-ai.vercel.app
- 环境变量:
update_content - 更新 Markdown 文档内容
- 环境变量:
DOC_ID(必需): 文档ID,在 MCP 配置中设置
- 参数:
content(必需): 新的文档内容baseUrl(可选): API 基础URL,默认为https://markdown-live-for-ai.vercel.app
- 环境变量:
安装
使用 npx(推荐)
npx ai-display全局安装
npm install -g ai-display使用
在 Claude Desktop 中配置
在 Claude Desktop 的配置文件中添加:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"ai-display": {
"command": "npx",
"args": ["-y", "ai-display"],
"env": {
"DOC_ID": "your-document-id-here"
}
}
}
}重要:将 your-document-id-here 替换为你的实际文档ID。配置后重启 Claude Desktop。
示例
配置完成后,documentId 会自动从环境变量 DOC_ID 读取。
获取文档内容
# 使用 MCP 工具(documentId 从环境变量自动读取)
get_content()更新文档内容
# 使用 MCP 工具(documentId 从环境变量自动读取)
update_content({
"content": "# 更新的标题\n\n更新的内容..."
})连接到本地开发服务器
{
"mcpServers": {
"ai-display": {
"command": "npx",
"args": ["-y", "ai-display"],
"env": {
"DOC_ID": "your-document-id"
}
}
}
}然后在工具调用时指定 baseUrl:
get_content({
"baseUrl": "http://localhost:3000"
})开发
构建
pnpm build发布
npm publish许可证
MIT
