File size: 2,583 Bytes
99a41ea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# πŸš€ Quick Start Guide

## Getting Started in 3 Steps

### Step 1: Test Your Setup
```bash
python test_setup.py
```
This will verify all dependencies are working correctly.

### Step 2: Start the Application

**Option A: Use the batch file (Windows)**
```bash
run.bat
```

**Option B: Manual start**
```bash
# Activate virtual environment
venv\Scripts\activate  # Windows
# or
source venv/bin/activate  # Linux/Mac

# Run the app
python app.py
```

### Step 3: Access the Application
- **Web Interface**: http://127.0.0.1:7860
- **MCP Endpoint**: http://127.0.0.1:7860/gradio_api/mcp/sse

## Claude Desktop Integration

### Prerequisites
1. Install Node.js from https://nodejs.org
2. Install mcp-remote:
   ```bash
   npm install -g mcp-remote
   ```

### Configuration
1. **Find your Claude Desktop config file:**
   - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
   - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`

2. **Copy the contents of `claude_config.json` to your Claude config file**

3. **Restart Claude Desktop**

### Testing Claude Integration
In Claude Desktop, try these prompts:

```
Generate a UML diagram for this Python code:

class Vehicle:
    def __init__(self, brand):
        self.brand = brand
    
    def start(self):
        pass

class Car(Vehicle):
    def start(self):
        return "Engine started"
```

or

```
Analyze the structure of this Python code:

class Calculator:
    def add(self, a, b):
        return a + b
    
    def multiply(self, a, b):
        return a * b
```

## Troubleshooting

### Common Issues

1. **Import errors when running test_setup.py:**
   ```bash
   pip install -r requirements.txt
   ```

2. **Claude Desktop doesn't recognize the MCP server:**
   - Check Node.js installation: `node --version`
   - Check mcp-remote installation: `npx mcp-remote --version`
   - Verify the app is running: visit http://127.0.0.1:7860
   - Restart Claude Desktop after config changes

3. **No diagram generated:**
   - Ensure your Python code contains class definitions
   - Check for syntax errors in your code
   - Verify internet connection (PlantUML service)

### Debug Commands

```bash
# Check if the app is running
curl http://127.0.0.1:7860/gradio_api/mcp/schema

# Test MCP endpoint
npx mcp-remote http://127.0.0.1:7860/gradio_api/mcp/sse --transport sse-only
```

## Next Steps

1. Try the sample code in the web interface
2. Experiment with your own Python classes
3. Test the MCP integration with Claude Desktop
4. Explore the code analysis features

Happy diagramming! 🎨