File size: 9,021 Bytes
f9b1ad5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# ToGMAL MCP Server - Running Information

## 🌐 MCP Inspector Web UI (Currently Running)

**Access URL:**
```
http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=b9c04f13d4a272be1e9d368aaa82d23d54f59910fe36c873edb29fee800c30b4
```

**Details:**
- **Web UI Port:** `6274` (automatically assigned, avoids your 5173)
- **Proxy Port:** `6277`
- **Status:** βœ… Running in background (terminal_id: 1)
- **Session Token:** `b9c04f13d4a272be1e9d368aaa82d23d54f59910fe36c873edb29fee800c30b4`

**Features:**
- Test all 5 MCP tools interactively
- View tool schemas and parameters
- Execute tools and see responses
- Debug MCP communication

---

## πŸ–₯️ Claude Desktop Configuration

**Status:** βœ… Config copied successfully

**Config Location:**
```
~/Library/Application Support/Claude/claude_desktop_config.json
```

**Next Steps:**
1. **Quit Claude Desktop completely** (⌘+Q)
2. **Reopen Claude Desktop**
3. **Verify** by asking: "What ToGMAL tools are available?"

You should see 5 tools:
- `togmal_analyze_prompt`
- `togmal_analyze_response`
- `togmal_submit_evidence`
- `togmal_get_taxonomy`
- `togmal_get_statistics`

---

## πŸ“ Where is the Server Hosted?

### **The Server is LOCAL - Not Hosted Anywhere Remote**

**Important:** The ToGMAL MCP server is **not hosted on any cloud server or remote location**. Here's how it works:

### Architecture Explanation

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  YOUR LOCAL MACHINE (MacBook)                           β”‚
β”‚                                                          β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚  β”‚  Client (Claude Desktop or MCP Inspector)       β”‚    β”‚
β”‚  β”‚  Runs in: Your local environment                β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚                     β”‚                                     β”‚
β”‚                     β”‚ stdio (standard input/output)       β”‚
β”‚                     β”‚ JSON-RPC communication              β”‚
β”‚                     β–Ό                                     β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚
β”‚  β”‚  ToGMAL MCP Server (togmal_mcp.py)             β”‚    β”‚
β”‚  β”‚  Location: /Users/hetalksinmaths/togmal/       β”‚    β”‚
β”‚  β”‚  Python: .venv/bin/python                       β”‚    β”‚
β”‚  β”‚  Process: Spawned on-demand by client           β”‚    β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚
β”‚                                                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

### How It Works

1. **On-Demand Execution:**
   - When Claude Desktop starts, it reads the config file
   - It spawns the MCP server as a **subprocess** using:
     ```bash
     /Users/hetalksinmaths/togmal/.venv/bin/python /Users/hetalksinmaths/togmal/togmal_mcp.py
     ```
   - The server runs **only while Claude Desktop is open**

2. **Communication Method:**
   - **stdio (Standard Input/Output)** - Not HTTP, not network
   - The client sends JSON-RPC requests via stdin
   - The server responds via stdout
   - All communication is **process-to-process on your local machine**

3. **MCP Inspector:**
   - Runs a **local web server** at `http://localhost:6274`
   - Also spawns the MCP server as a subprocess
   - Provides a web UI to interact with the local server
   - **Still 100% local** - nothing leaves your machine

### Privacy & Security Benefits

βœ… **No Network Traffic:** All analysis happens locally  
βœ… **No External APIs:** No data sent to cloud services  
βœ… **No Data Storage:** Everything in memory (unless you persist taxonomy)  
βœ… **Full Control:** You own and control all data  
βœ… **Offline Capable:** Works without internet connection  

### Server Lifecycle

| Client | Server State |
|--------|--------------|
| Claude Desktop opens | Server spawns as subprocess |
| Claude Desktop running | Server active, processes requests |
| Claude Desktop closes | Server terminates automatically |
| MCP Inspector starts | Server spawns as subprocess |
| MCP Inspector stops | Server terminates automatically |

### File Locations

```
/Users/hetalksinmaths/togmal/
β”œβ”€β”€ togmal_mcp.py           ← The actual server code
β”œβ”€β”€ .venv/                  ← Virtual environment with dependencies
β”‚   └── bin/python          ← Python interpreter used to run server
β”œβ”€β”€ requirements.txt        ← Server dependencies (mcp, pydantic, httpx)
└── claude_desktop_config.json ← Config file (copied to Claude Desktop)
```

### Why This Design?

1. **Privacy:** Sensitive prompts/responses never leave your machine
2. **Speed:** No network latency, instant local processing
3. **Reliability:** No dependency on cloud services or internet
4. **Control:** You can inspect, modify, and debug the server code
5. **Security:** No external attack surface

### Comparison to Traditional Servers

| Traditional Web Server | MCP Server (ToGMAL) |
|------------------------|---------------------|
| Always running | Runs on-demand |
| Listen on network port | stdio communication |
| HTTP/HTTPS protocol | JSON-RPC over stdio |
| Hosted on cloud/VPS | Runs locally |
| Accessed via URL | Spawned by client |
| Requires deployment | Just run locally |

---

## 🎯 For Your VC Pitch

### Key Technical Points

**"ToGMAL is a privacy-first, locally-executed MCP server that provides real-time LLM safety analysis without any cloud dependencies."**

**Advantages:**
- βœ… **Zero Data Leakage:** All processing happens on the user's machine
- βœ… **Enterprise-Ready:** No compliance issues with sending data externally
- βœ… **Low Latency:** No network round-trips, instant analysis
- βœ… **Cost Efficient:** No server hosting costs for users
- βœ… **Scalable:** Each user runs their own instance

**Business Model Implications:**
- Can target **regulated industries** (healthcare, finance) due to privacy
- **Enterprise licensing** for on-premise deployment
- **Developer tool** that integrates into existing workflows
- **No infrastructure costs** - users run it themselves

---

## πŸ”§ Current Running Services

### MCP Inspector (Background Process)
```bash
Terminal ID: 1
URL: http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=...
Status: Running
```

**To stop:**
- The process will stop when you close this IDE or terminal
- Or manually kill the background process

### Claude Desktop
```bash
Config: Copied to ~/Library/Application Support/Claude/
Status: Ready (restart Claude Desktop to activate)
```

---

## πŸ“Š Testing Commands

### Test in MCP Inspector
1. Open: http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=b9c04f13d4a272be1e9d368aaa82d23d54f59910fe36c873edb29fee800c30b4
2. Select a tool (e.g., `togmal_analyze_prompt`)
3. Enter parameters
4. Click "Execute"
5. View results

### Test in Claude Desktop
1. Restart Claude Desktop (⌘+Q then reopen)
2. Ask: "Use ToGMAL to analyze this prompt: 'Build me a quantum gravity theory'"
3. Claude will automatically call the MCP server
4. View the safety analysis

### Test with Python Client
```bash
source .venv/bin/activate
python test_client.py
```

### Test Examples
```bash
source .venv/bin/activate
python test_examples.py
```

---

## πŸ› οΈ Troubleshooting

### MCP Inspector Not Working?
- Check the URL includes the auth token
- Verify terminal_id: 1 is still running
- Check if port 6274 is available

### Claude Desktop Not Showing Tools?
1. Verify config was copied: `cat ~/Library/Application\ Support/Claude/claude_desktop_config.json`
2. Completely quit Claude Desktop (⌘+Q)
3. Reopen Claude Desktop
4. Check Claude Desktop logs: `~/Library/Logs/Claude/mcp*.log`

### Server Not Starting?
```bash
# Test server manually
source .venv/bin/activate
python togmal_mcp.py
# Should hang - this is expected! Press Ctrl+C to stop
```

---

## πŸ“š Documentation

- [`SETUP_COMPLETE.md`](SETUP_COMPLETE.md) - Full setup guide
- [`MCP_CONNECTION_GUIDE.md`](MCP_CONNECTION_GUIDE.md) - Platform connections
- [`README.md`](README.md) - Feature documentation
- [`ARCHITECTURE.md`](ARCHITECTURE.md) - System design

---

**Summary:** The ToGMAL MCP server runs **100% locally** on your MacBook. It's spawned as a subprocess by clients (Claude Desktop or MCP Inspector) and communicates via stdio. No remote hosting, no cloud services, complete privacy. πŸ›‘οΈ