Lucid MCP服务器
](https://smithery.ai/server/@smartzan63/lucid-mcp-server) ](https://www.npmjs.com/package/lucid-mcp-server) ](https://www.npmjs.com/package/lucid-mcp-server)  
Lucid App集成的模型上下文协议(MCP)服务器。使多模式LLM能够通过可视化导出访问和分析Lucid图。
目录
特性
- 🔍 文档发现 以及从LucidChart、LucidSpark和LucidScale检索元数据
- 📑 轻量级选项卡元数据 用于快速查看文档结构
- 🖼️ PNG图像导出 来自Lucid图表
- 🤖 AI驱动图分析 具有多模式LLM(支持Azure OpenAI和OpenAI)
- ⚙️ 基于环境的API密钥管理 从Azure自动回退到OpenAI。
- 📝 TypeScript实现 具有完整的测试覆盖范围
- 🔧 MCP检查器集成 便于测试
先决条件
在开始之前,请确保您拥有以下内容:
- Node.js:版本18或更高版本。
- Lucid API密钥:钥匙来自 Lucid开发者门户 是 必需的 对于所有功能。
- AI提供者密钥(可选):对于AI供电的图表分析,您需要API密钥用于:
- Azure OpenAI - OpenAI
快速开始
按照以下步骤运行服务器。
通过Smithery安装
通过以下方式自动为Claude Desktop安装lucid mcp服务器 史密瑟里:
npx -y @smithery/cli install @smartzan63/lucid-mcp-server --client claude1.安装
从npm全局安装包:
npm install -g lucid-mcp-server2.配置
在终端中设置以下环境变量。只需要Lucid API密钥。
# Required for all features
export LUCID_API_KEY="your_api_key_here"
# Optional: For AI analysis, configure either Azure OpenAI or OpenAI
# Option 1: Azure OpenAI (takes precedence)
export AZURE_OPENAI_API_KEY="your_azure_openai_key"
export AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com"
export AZURE_OPENAI_DEPLOYMENT_NAME="gpt-4o"
# Option 2: OpenAI (used as a fallback if Azure is not configured)
export OPENAI_API_KEY="your_openai_api_key"
export OPENAI_MODEL="gpt-4o" # Optional, defaults to gpt-4o备注:如果满足以下条件,服务器将自动使用Azure OpenAIAZURE_OPENAI_API_KEY已设置。如果没有,它将退回OpenAIOPENAI_API_KEY提供。
3.验证
使用MCP检查器测试您的安装:
npx @modelcontextprotocol/inspector lucid-mcp-server用法
服务器运行后,您可以使用自然语言或直接调用其工具与之交互。
示例提示
- 基本命令 (只使用Lucid API密钥):
- *“显示我所有的Lucid文件”* - *“获取ID为\[文档ID\]的文档信息”*
- AI分析 (需要Azure OpenAI或OpenAI设置):
- *“分析此图:\[文档id\]”* - *“此Lucid图显示了什么:\[文档id\]”*
可用工具
🔍 search-documents
列出Lucid帐户中的文档。
- 参数:
- keywords (字符串,可选):搜索关键字以筛选文档。
- 例子:
{
"keywords": "architecture diagram"
}📋 get-document
获取文档元数据,并可以选择对其视觉内容执行AI分析。
- 参数:
- documentId (string):Lucid URL中的文档ID。 - analyzeImage (布尔值,可选):设置为 true 进行AI分析。 ⚠️ 需要Azure或OpenAI密钥。 - pageId (字符串,可选):要导出的特定页面(默认值:“0_0”)。
- 例子:
{
"documentId": "demo-document-id-here-12345678/edit",
"analyzeImage": true
}📑 get-document-tabs
获取Lucid文档中所有选项卡(页面)的轻量级元数据,而不检索完整内容。
- 参数:
- documentId (string):Lucid URL中的文档ID。
- 退货: 带有页面元数据(id、标题、索引)的文档信息,用于快速导航和概述。
- 例子:
{
"documentId": "demo-document-id-here-12345678/edit"
}VS代码集成
您可以将服务器直接集成到Visual Studio代码中。
方法一:通过VS Code UI(推荐)
- 打开 命令面板 (
Ctrl+Shift+P或Cmd+Shift+P). - 运行命令: “MCP:添加服务器”.
- 选择 “npm” 作为来源。
- 输入包名称:
lucid-mcp-server. - VS Code将指导您完成其余的设置。
- 验证自动创建的配置,因为AI可能会出错
方法2:快速安装链接
点击 “在VS代码中安装” 请在本自述顶部添加徽章,然后按照屏幕上的提示进行操作。您需要在您的 settings.json.
方法3:手动配置
Click to view manual settings.json configuration
将以下JSON添加到VS代码中 settings.json 文件。此方法提供了最多的控制,对自定义设置很有用。
{
"mcp": {
"servers": {
"lucid-mcp-server": {
"type": "stdio",
"command": "lucid-mcp-server",
"env": {
"LUCID_API_KEY": "${input:lucid_api_key}",
"AZURE_OPENAI_API_KEY": "${input:azure_openai_api_key}",
"AZURE_OPENAI_ENDPOINT": "${input:azure_openai_endpoint}",
"AZURE_OPENAI_DEPLOYMENT_NAME": "${input:azure_openai_deployment_name}",
"OPENAI_API_KEY": "${input:openai_api_key}",
"OPENAI_MODEL": "${input:openai_model}"
}
}
},
"inputs": [
{
"id": "lucid_api_key",
"type": "promptString",
"description": "Lucid API Key (REQUIRED)"
},
{
"id": "azure_openai_api_key",
"type": "promptString",
"description": "Azure OpenAI API Key (Optional, for AI analysis)"
},
{
"id": "azure_openai_endpoint",
"type": "promptString",
"description": "Azure OpenAI Endpoint (Optional, for AI analysis)"
},
{
"id": "azure_openai_deployment_name",
"type": "promptString",
"description": "Azure OpenAI Deployment Name (Optional, for AI analysis)"
},
{
"id": "openai_api_key",
"type": "promptString",
"description": "OpenAI API Key (Optional, for AI analysis - used if Azure is not configured)"
},
{
"id": "openai_model",
"type": "promptString",
"description": "OpenAI Model (Optional, for AI analysis, default: gpt-4o)"
}
]
}
}小演示
🤝 贡献
- 分叉存储库。
- 创建功能分支(
git checkout -b feature/amazing-feature). - 提交您的更改(
git commit -m 'Add amazing feature'). - 推到分支(
git push origin feature/amazing-feature). - 打开拉取请求。
📚 参考文献
📄 许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
