skurzyp/uml2code-mcp-server
If you are the rightful owner of uml2code-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The UML2Code MCP Server is a tool designed to convert PlantUML diagrams into Java code using a Model Code Prompting server backed by OpenAI's GPT models.
🌐 UML2Code MCP Server
Convert PlantUML diagrams into Java code using an MCP (Model Code Prompting) server backed by OpenAI's GPT models.
🚀 Prerequisites & Setup
1. Clone the Repository
git clone https://github.com/skurzyp/uml2code-mcp-server
cd uml2code-mcp-server
2. Requirements
- Node.js v23.3
- pnpm
- OpenAI API Key (with access to
gpt-4o-mini)
Get your key from: https://openai.com/api
3. Configure Environment
cp .env.example .env
# Paste your OpenAI API key into the .env file
4. Install Dependencies
pnpm install
🧪 Running the App
Option 1: Development Mode
pnpm run dev
Option 2: Build & Run
pnpm build
pnpm start
🛠 VSCode Integration
1. Configure settings.json
Open VSCode settings and add your MCP server configuration:
{
"mcp": {
"inputs": [],
"servers": {
"mcp-server-remote": {
"type": "sse",
"url": "http://localhost:3000/mcp"
},
"mcp-server-local": {
"command": "node",
"args": [
"D:\\<PATH TO YOUR PROJECT>\\uml2code-mcp-server\\build\\index.js"
],
"env": {
"CHAT_OPENAI_API_KEY": "sk-<your-api-key-here>"
}
}
}
},
"workbench.colorTheme": "Andromeda Bordered",
"files.autoSave": "afterDelay",
"window.zoomLevel": 2,
"liveServer.settings.donotShowInfoMsg": true,
"liveServer.settings.CustomBrowser": "chrome",
"workbench.editorAssociations": {
"*.ipynb": "jupyter.notebook.ipynb"
}
}
2. Start the MCP Server
- Open the VSCode command palette and click "Start" next to your selected server.
📝 How to Use
- Create a
PlantUMLdiagram (e.g.,diagram.puml). - Attach it to a Copilot prompt like:
generate java code from this plant uml diagram. - Accept permission to execute the MCP Server Tool.
- If the diagram is valid, Java code files will be returned.
- If not, you’ll receive suggested fixes from the server.
🧪 Local Testing
Use the following PowerShell commands to test the tool:
# Test calculate_sum tool
Invoke-RestMethod -Uri http://localhost:3000/test-tool `
-Method Post `
-Headers @{ "Content-Type" = "application/json" } `
-Body '{"name":"calculate_sum","arguments":{"a":123,"b":124}}'
# Test UML to code conversion
Invoke-RestMethod -Uri http://localhost:3000/test-tool `
-Method Post `
-Headers @{ "Content-Type" = "application/json" } `
-Body '{"name":"uml2code","arguments":{"plantUml":"@startuml\nclass User {\n +name: String\n}\n@enduml"}}'
📦 Project Structure
├── build/ # Compiled output
├── src/ # Source files
├── .env.example # Environment template
├── README.md # You're here!
🧠 Notes
- The MCP server uses SSE (Server-Sent Events) for communication.
- You can run the server locally or point VSCode to a remote instance.
- Ensure your API key has access to GPT-4o Mini (
gpt-4o-mini). - This project was developed on Windows but should be easy to set up on Linux in similar manner
📄 License
This project is licensed under the MIT License.
You are free to use, modify, and distribute this software under the terms of the license.
© 2025 UML2Code MCP Server contributors. Open source, open innovation.