Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Code2Doce MCP ServerNew to Visual Studio Code? Get it now.
Code2Doce MCP Server

Code2Doce MCP Server

liangxuewen

|
5 installs
| (0) | Free
SCL code documentation and analysis tools via MCP for Siemens EPLAN
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Code2Doce MCP VSCode Extension

Version License

VSCode extension for seamless integration of Code2Doce MCP server - SCL code documentation and analysis tools powered by Model Context Protocol (MCP).

✨ Features

🎯 Universal Configuration (New in v1.1.0)

  • No workspace dependency - Works anywhere, not limited to Code2Doce project
  • Three installation modes:
    • 🔹 Extension Embedded - Bundled MCP server (default)
    • 🌐 Global Installation - Use system-wide Code2Doce
    • 🛠️ Custom Path - Specify your own location
  • One-click setup - Automatic resource deployment
  • Flexible configuration - Choose what fits your workflow

🖼️ Enhanced PDF Generation (New in v1.1.2)

  • Complete image support - Includes all Mermaid diagrams in PDF
  • Multi-path resolution - Handles nested directory structures
  • Optimized resource paths - Correctly resolves ./Builder/img/ references
  • Standalone output - Self-contained PDF documents

📦 Easy Dependency Management

  • Install all MCP dependencies with a single command
  • Automatic detection of missing packages
  • Progress notifications during installation
  • Playwright browser auto-installation for Mermaid rendering

⚙️ Seamless Integration

  • Enable/disable MCP server from settings or command palette
  • Visual status indicator in sidebar
  • Auto-install option for dependencies
  • Works with GitHub Copilot Chat

🛠️ Available Tools via MCP

When enabled, you can use these tools through GitHub Copilot Chat with @code2doce:

  • 📊 Render Mermaid Diagrams - Convert Mermaid syntax to images
  • 📄 Generate PDF Documents - Create PDFs from Markdown
  • 🔍 Analyze SCL Code - Parse and analyze Siemens SCL code
  • 📁 List Library Files - Browse SCL library structure
  • 📝 Create Documentation - Generate documentation templates

📥 Installation

From VS Code Marketplace (Recommended)

  1. Open VS Code Extensions view (Ctrl+Shift+X)
  2. Search for "Code2Doce MCP"
  3. Click Install
  4. Follow the setup wizard for initial configuration

From Command Line

code --install-extension liangxuewen.code2doce-mcp

From VSIX File

  1. Download the .vsix file from Releases
  2. Run: code --install-extension code2doce-mcp-1.1.2.vsix

🚀 Quick Start

First-Time Setup

After installation, the extension will guide you through setup:

  1. Choose Installation Mode:

    • Extension Embedded (Recommended) - Everything bundled, no external dependencies
    • Global Installation - Use existing Code2Doce installation
    • Custom Path - Specify custom location
  2. Install Dependencies (if needed)

    • Command Palette → Code2Doce: Install MCP Dependencies
    • Installs Python packages and Playwright browsers
  3. Start Using

    • Open GitHub Copilot Chat (Ctrl+Alt+I)
    • Type @code2doce to access tools

Usage

🎮 Commands

  • Code2Doce: Setup Server - Initial setup wizard for installation mode
  • Code2Doce: Configure Server Path - Change MCP server location
  • Code2Doce: Install MCP Dependencies - Install Python packages and browsers
  • Code2Doce: Enable MCP Server - Enable MCP server integration
  • Code2Doce: Disable MCP Server - Disable MCP server integration
  • Code2Doce: Check MCP Server Status - View current status and configuration

⚙️ Settings

Server Configuration:

  • code2doce.mcp.enabled - Enable/disable MCP server (default: true)
  • code2doce.mcp.serverPath - Custom MCP server path (optional)
  • code2doce.mcp.installLocation - Installation mode: extension, global, or custom

Python Environment:

  • code2doce.mcp.pythonPath - Custom Python path (default: auto-detect)
  • code2doce.mcp.autoInstall - Auto-prompt for dependency installation (default: true)

Image Path Configuration (Important for PDF Generation):

When generating PDFs, ensure your Markdown files reference images correctly:

<!-- Correct - relative path from markdown file -->
![Diagram](https://github.com/DaMccRee/Code2Doce/raw/HEAD/Builder/img/mermaid-diagram.png)

<!-- Also supported - various relative paths -->
![Image](https://github.com/DaMccRee/Code2Doce/raw/HEAD/Builder/img/image.png)
![Image](https://github.com/DaMccRee/Code2Doce/raw/HEAD/img/image.png)

The extension automatically configures Pandoc to search in multiple directories:

  • Current directory (.)
  • Builder/ subdirectory
  • Builder/img/ subdirectory

🛠️ Using with GitHub Copilot

Once enabled, use @code2doce in Copilot Chat to access these tools:

Render Mermaid Diagrams:

@code2doce 将这个 mermaid 图表渲染为图片

Generate PDF with Images:

@code2doce 生成 PDF 文档,包含所有图片

Analyze SCL Code:

@code2doce 分析 LAF_ClockGen.scl 文件

List Library Files:

@code2doce 列出 LBC 类别下的所有文件

Create Documentation:

@code2doce 为 LGF_FIFO.scl 创建文档模板

Sidebar View

The extension adds a "Code2Doce" section to your activity bar showing:

  • ✅/⚪ MCP Server status (click to toggle)
  • ✅/⚠️ Dependencies status (click to install if missing)
  • 🛠️ Available tools list

📋 Requirements

  • VS Code: 1.95.0 or higher
  • Python: 3.8+ (auto-detected or configurable)
  • For Extension Embedded Mode: No additional requirements
  • For Global/Custom Mode: Code2Doce installation with dependencies

Extension Settings

This extension contributes the following settings:

  • code2doce.mcp.enabled: Enable/disable Code2Doce MCP server
  • code2doce.mcp.serverPath: Custom MCP server path (for custom installation)
  • code2doce.mcp.installLocation: Installation mode (extension, global, custom)
  • code2doce.mcp.pythonPath: Custom Python executable path
  • code2doce.mcp.autoInstall: Automatically prompt to install missing dependencies

🐛 Troubleshooting

PDF Missing Images

If your generated PDF doesn't include images:

  1. Check image paths in Markdown are relative (e.g., ./Builder/img/image.png)
  2. Ensure images exist in the referenced location
  3. Use the extension's embedded mode for automatic path resolution

MCP Server Not Found

If the server fails to start:

  1. Run Code2Doce: Setup Server to reconfigure
  2. Check Python installation: python --version
  3. Verify dependencies: Code2Doce: Install MCP Dependencies

Copilot Not Detecting @code2doce

  1. Restart VS Code after enabling the extension
  2. Check MCP server status in sidebar
  3. Ensure code2doce.mcp.enabled is true

📝 Release Notes

1.1.2 (Latest)

🖼️ Enhanced PDF Generation:

  • ✅ Complete image support for Mermaid diagrams
  • ✅ Multi-path resource resolution
  • ✅ Fixed nested directory image references
  • ✅ Optimized Pandoc configuration

1.1.1

🔧 Improvements:

  • Enhanced PDF generation with better resource path handling
  • Improved documentation

1.1.0

🎯 Major Update - Universal Configuration:

  • ✅ No workspace dependency - works anywhere
  • ✅ Three installation modes (embedded/global/custom)
  • ✅ Embedded MCP server resources
  • ✅ One-click setup wizard
  • ✅ New commands for configuration
  • ⚠️ Breaking: Requires reconfiguration for existing users

1.0.0

🎉 Initial Release:

  • MCP server definition provider
  • One-click dependency installation
  • Configuration UI in settings and sidebar
  • Auto-detection of Python environment
  • Status monitoring

👨‍💻 For Developers

Building

cd vscode-extension
npm install
npm run compile

Testing

npm run test

Packaging

npm install -g @vscode/vsce
vsce package

This creates a .vsix file you can install with:

code --install-extension code2doce-mcp-1.1.2.vsix

Publishing

# Login to publisher account
vsce login liangxuewen

# Publish new version
vsce publish

📄 License

MIT License - see LICENSE file for details

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

🔗 Links

  • Extension Marketplace: Code2Doce MCP
  • GitHub Repository: DaMccRee/Code2Doce
  • Project Homepage: Code2Doce 项目主页
  • Issues & Support: GitHub Issues

📞 Support

如有问题或需求,请:

  • 提交 GitHub Issue
  • 访问项目主页
  • 查看快速入门指南

Made with ❤️ by liangxuewen

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft