MCP Canvas Dev
A Model Context Protocol (MCP) server for Canvas Medical API/SDK development assistance, providing streamlined access to Canvas Medical documentation and AI-powered development tools.
README
MCP Canvas Dev
A Model Context Protocol (MCP) server for Canvas Medical API/SDK development assistance. This server provides streamlined access to Canvas Medical documentation and AI-powered development tools.
🚀 Quick Start
1. Installation
# Clone and install dependencies
git clone https://github.com/your-username/mcp-canvas.git
cd mcp-canvas
pnpm install
2. Configuration
# Copy environment template
cp packages/server/env.template packages/server/.env
# Edit with your API credentials
nano packages/server/.env
# Set CARA_CANVAS_API_KEY=your_api_key_here
# Contact nils@caramedical.com for API credentials
3. Build and Start
# Build the server
pnpm build
# Start in stdio mode (for MCP clients like Claude Desktop)
pnpm dev
# Start in HTTP mode (for web applications)
STREAMABLE_HTTP=1 pnpm dev
🔧 Configuration Options
Option 1: Use Public API (Recommended)
The server uses public API endpoints with API key authentication:
# Set environment variables in packages/server/.env (only API key needed for most users)
CARA_CANVAS_BASE_URL=https://k8zoi0cmul.execute-api.us-east-1.amazonaws.com/dev
CARA_CANVAS_API_KEY=your_api_key_here
Need API credentials? Email nils@caramedical.com to request access.
Option 2: Deploy Your Own Lambda Proxy
For production use or custom knowledge bases, deploy your own Lambda proxy:
# Navigate to lambda-proxy directory
cd lambda-proxy
# Install dependencies
npm install
# Configure your AWS credentials and Knowledge Base IDs
export API_KNOWLEDGE_BASE_ID=your_api_knowledge_base_id
export SDK_KNOWLEDGE_BASE_ID=your_sdk_knowledge_base_id
# Deploy to AWS
npm run deploy:dev
Option 3: Use Your Own API Endpoints
Configure the server to use your own API endpoints:
# In packages/server/.env
CARA_CANVAS_BASE_URL=https://your-api-endpoint.com
CARA_CANVAS_API_KEY=your_api_key
🛠️ Available Tools
The server provides 9 streamlined tools and 6 comprehensive prompts for Canvas Medical development:
📚 Documentation Search
search_api_docs- Search Canvas Medical API documentationsearch_sdk_docs- Search Canvas Medical SDK documentationsearch_all_docs- Search all Canvas Medical documentation
🤖 AI-Powered Development
generate_response- Generate AI responses using Canvas Medical documentationgenerate_code- Generate code examples for Canvas Medical API integrationreview_code- Review Canvas Medical integration code and provide suggestionssmart_canvas_development- Intelligent assistant with automatic documentation search and code generationgenerate_canvas_manifest- Generate complete Canvas Medical plugin manifest files with proper structure and data access permissionsvalidate_code_against_docs- Validate that code only uses documented APIs, methods, and imports from Canvas Medical documentation. Prevents hallucination of non-existent features.
🎯 Code Generation Prompts
prompts.generate_code_from_docs- Generate complete code from Canvas Medical documentation search resultsprompts.implement_from_findings- Create complete implementation from research findings and documentationprompts.code_review- Review Canvas Medical integration code and provide suggestionsprompts.api_implementation- Generate implementation guidance for Canvas Medical API featuresprompts.debug_assistance- Help debug issues with Canvas Medical API integrationprompts.canvas_manifest_guide- Comprehensive guide for creating and understanding Canvas Medical plugin manifest files (CANVAS_MANIFEST.json)
🧠 Intelligent Auto-Triggering
The MCP server now automatically provides comprehensive responses for Canvas Medical development requests:
- Plugin Development: Auto-triggers documentation search and code generation
- API Integration: Automatically searches relevant API documentation
- SDK Development: Provides SDK-specific guidance and examples
- Physician Information: Intelligent responses for clinical workflow questions
Example: Ask "create a plugin for canvas which creates a text in a note about what physician / clinician did the note" and get:
- 📚 Relevant API and SDK documentation
- 💻 Complete Python plugin code
- 🚀 Step-by-step implementation guide
- 🛠️ Best practices and deployment instructions
🔄 Code Generation Workflow
Clear Path from Research to Implementation:
-
🔍 Research Phase:
- Use
search_api_docsto find relevant Canvas Medical APIs - Use
search_sdk_docsto understand Canvas Medical SDK patterns - Use
search_all_docsfor comprehensive documentation coverage
- Use
-
📝 Code Generation Phase:
- Use
prompts.generate_code_from_docsfor documentation-based code generation - Use
prompts.implement_from_findingsfor complete implementation from research - Get production-ready code with Canvas Medical best practices
- Use
-
🔧 Development Phase:
- Use
prompts.code_reviewto review and improve generated code - Use
prompts.debug_assistancefor troubleshooting - Use
prompts.api_implementationfor implementation guidance
- Use
Example Workflow:
1. search_api_docs("note creation") → Get API documentation
2. search_sdk_docs("plugin development") → Get SDK patterns
3. prompts.generate_code_from_docs({
request: "Create note analysis plugin",
documentation: [API + SDK results],
language: "Python"
}) → Get complete implementation
4. prompts.code_review({code: generated_code}) → Review and improve
🛡️ Anti-Hallucination Measures
Production-Ready Code Generation:
The MCP server includes comprehensive anti-hallucination measures to ensure all generated code uses only documented Canvas Medical APIs:
Documentation Search with Source Verification:
- Source verification for each API and method
- Anti-hallucination warnings in all documentation results
- Clear guidelines on what can and cannot be used
- Explicit warnings about undocumented features
Code Generation with Strict Validation:
- Source verification comments in generated code
- Validation for undocumented methods and imports
- Error handling for non-existent APIs
- Strict requirements in all prompts
Code Validation Tool:
validate_code_against_docs- Validates code against documentation- Detects undocumented APIs and methods
- Prevents hallucination of non-existent features
- Provides specific recommendations for fixes
Example Anti-Hallucination Workflow:
User: "Create a Canvas plugin for note analysis"
MCP Server Response:
1. 🔍 search_api_docs("note analysis") → Get documented APIs with source verification
2. 🔍 search_sdk_docs("Canvas plugin development") → Get documented SDK methods
3. 📝 generate_canvas_manifest({...}) → Generate manifest with documented structure
4. 💻 prompts.generate_code_from_docs({...}) → Generate code with strict validation
5. 🔧 validate_code_against_docs({...}) → Validate generated code against documentation
Result: Complete Canvas Medical plugin with:
- ✅ Only documented APIs and methods
- ✅ Source verification for all components
- ✅ Anti-hallucination validation
- ✅ Proper error handling for undocumented features
📚 Documentation
- MCP Client Setup - Detailed MCP client configuration
- Troubleshooting - Common issues and solutions
- API Credentials - How to get API access
Prerequisites
- Node.js 18+
- pnpm
Setup
# Install dependencies
pnpm install
# Build the server
pnpm build
# Run tests
pnpm test
# Start development server
pnpm dev
🛡️ Security
- No credentials required - Uses public API endpoints
- Open source - All code is publicly available
- Environment variable configuration for customization
�� Documentation
- README.md - This file with setup and usage instructions
- MCP Client Setup - Detailed MCP client configuration
- Troubleshooting - Common issues and solutions
- API Credentials - How to get API access
🔒 Security & Privacy
Public API Usage
- API key required - Contact nils@caramedical.com for credentials
- No AWS credentials required for basic usage
- No sensitive data stored in the repository
- Public endpoints available with API key authentication
Custom Deployment
- Deploy your own Lambda proxy for production use
- Keep your AWS credentials private
- Use your own API keys and endpoints
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
📄 License
MIT License - see LICENSE file for details.
��️ MCP Client Setup
The Canvas Medical MCP server works with various MCP-compatible applications. Here's how to set it up:
Claude Desktop (Anthropic)
-
Install Claude Desktop from Anthropic's website
-
Create configuration file:
# Create config directory mkdir -p ~/.config/claude-desktop # Create configuration file nano ~/.config/claude-desktop/claude_desktop_config.json -
Add MCP server configuration:
{ "mcpServers": { "canvas-medical": { "command": "node", "args": ["/path/to/your/mcp-canvas/packages/server/dist/index.js"], "env": { "CARA_CANVAS_API_KEY": "your_api_key_here" } } } } -
Restart Claude Desktop and start using Canvas Medical tools!
Cursor IDE
-
Open Cursor IDE
-
Create MCP configuration:
# Create config directory mkdir -p ~/.cursor # Create configuration file nano ~/.cursor/mcp.json -
Add MCP server configuration:
{ "mcpServers": { "canvas-medical": { "command": "node", "args": ["/path/to/your/mcp-canvas/packages/server/dist/index.js"], "env": { "CARA_CANVAS_API_KEY": "your_api_key_here" } } } } -
Restart Cursor and use Canvas Medical tools in chat!
Continue.dev (VS Code Extension)
-
Install Continue extension in VS Code
-
Open Continue config (
Cmd/Ctrl + Shift + P→ "Continue: Open Config") -
Add MCP server configuration:
{ "mcpServers": { "canvas-medical": { "command": "node", "args": ["/path/to/your/mcp-canvas/packages/server/dist/index.js"], "env": { "CARA_CANVAS_API_KEY": "your_api_key_here" } } } } -
Restart VS Code and use Canvas Medical tools!
Open WebUI
-
Install Open WebUI with MCP support
-
Configure MCP server in settings:
- Server Name:
canvas-medical - Command:
node - Args:
["/path/to/your/mcp-canvas/packages/server/dist/index.js"] - Environment Variables:
CARA_CANVAS_API_KEY=your_api_key_here
- Server Name:
-
Start using Canvas Medical tools!
LM Studio
-
Install LM Studio with MCP support
-
Configure MCP server in settings:
- Server Path:
/path/to/your/mcp-canvas/packages/server/dist/index.js - Environment Variables:
CARA_CANVAS_API_KEY=your_api_key_here
- Server Path:
-
Start using Canvas Medical tools!
Custom Applications
For custom applications that support MCP:
-
Start the server:
cd packages/server CARA_CANVAS_API_KEY="your_api_key" pnpm dev -
Connect via stdio or HTTP mode:
# HTTP mode for web applications STREAMABLE_HTTP=1 CARA_CANVAS_API_KEY="your_api_key" pnpm dev
🔑 Getting API Credentials
Need API credentials? Email nils@caramedical.com to request access.
Note: Only the API key is required for most users. The server uses public endpoints by default.
🔧 Troubleshooting
Common Issues:
"API key is required" error:
- Make sure
CARA_CANVAS_API_KEYis set in your MCP client configuration - Verify the API key is valid by emailing nils@caramedical.com
"Cannot find module" error:
- Make sure you've built the server:
pnpm build - Check that the path to
dist/index.jsis correct
"Connection refused" error:
- Verify the server is running:
pnpm dev - Check that the MCP client configuration is correct
Tools not appearing:
- Restart your MCP client after configuration changes
- Verify the server is running and accessible
Testing the Server:
# Test the server directly
cd packages/server
CARA_CANVAS_API_KEY="your_api_key" pnpm dev
Getting Help:
- Issues: GitHub Issues
- API Credentials: nils@caramedical.com
- Documentation: Check the README.md for detailed examples
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。