Skip to content

Commit fe96211

Browse files
authored
Merge pull request #264 from CoplayDev/feat/telemetry
Added optional telemetry
2 parents 9d17061 + 283597d commit fe96211

27 files changed

+1994
-170
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,18 @@ Help make MCP for Unity better!
292292
293293
---
294294
295+
## 📊 Telemetry & Privacy
296+
297+
Unity MCP includes **privacy-focused, anonymous telemetry** to help us improve the product. We collect usage analytics and performance data, but **never** your code, project names, or personal information.
298+
299+
- **🔒 Anonymous**: Random UUIDs only, no personal data
300+
- **🚫 Easy opt-out**: Set `DISABLE_TELEMETRY=true` environment variable
301+
- **📖 Transparent**: See [TELEMETRY.md](TELEMETRY.md) for full details
302+
303+
Your privacy matters to us. All telemetry is optional and designed to respect your workflow.
304+
305+
---
306+
295307
## Troubleshooting ❓
296308
297309
<details>

TELEMETRY.md

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# Unity MCP Telemetry
2+
3+
Unity MCP includes privacy-focused, anonymous telemetry to help us improve the product. This document explains what data is collected, how to opt out, and our privacy practices.
4+
5+
## 🔒 Privacy First
6+
7+
- **Anonymous**: We use randomly generated UUIDs - no personal information
8+
- **Non-blocking**: Telemetry never interferes with your Unity workflow
9+
- **Easy opt-out**: Simple environment variable or Unity Editor setting
10+
- **Transparent**: All collected data types are documented here
11+
12+
## 📊 What We Collect
13+
14+
### Usage Analytics
15+
- **Tool Usage**: Which MCP tools you use (manage_script, manage_scene, etc.)
16+
- **Performance**: Execution times and success/failure rates
17+
- **System Info**: Unity version, platform (Windows/Mac/Linux), MCP version
18+
- **Milestones**: First-time usage events (first script creation, first tool use, etc.)
19+
20+
### Technical Diagnostics
21+
- **Connection Events**: Bridge startup/connection success/failures
22+
- **Error Reports**: Anonymized error messages (truncated to 200 chars)
23+
- **Server Health**: Startup time, connection latency
24+
25+
### What We **DON'T** Collect
26+
- ❌ Your code or script contents
27+
- ❌ Project names, file names, or paths
28+
- ❌ Personal information or identifiers
29+
- ❌ Sensitive project data
30+
- ❌ IP addresses (beyond what's needed for HTTP requests)
31+
32+
## 🚫 How to Opt Out
33+
34+
### Method 1: Environment Variable (Recommended)
35+
Set any of these environment variables to `true`:
36+
37+
```bash
38+
# Disable all telemetry
39+
export DISABLE_TELEMETRY=true
40+
41+
# Unity MCP specific
42+
export UNITY_MCP_DISABLE_TELEMETRY=true
43+
44+
# MCP protocol wide
45+
export MCP_DISABLE_TELEMETRY=true
46+
```
47+
48+
### Method 2: Unity Editor (Coming Soon)
49+
In Unity Editor: `Window > MCP for Unity > Settings > Disable Telemetry`
50+
51+
### Method 3: Manual Config
52+
Add to your MCP client config:
53+
```json
54+
{
55+
"env": {
56+
"DISABLE_TELEMETRY": "true"
57+
}
58+
}
59+
```
60+
61+
## 🔧 Technical Implementation
62+
63+
### Architecture
64+
- **Python Server**: Core telemetry collection and transmission
65+
- **Unity Bridge**: Local event collection from Unity Editor
66+
- **Anonymous UUIDs**: Generated per-installation for aggregate analytics
67+
- **Thread-safe**: Non-blocking background transmission
68+
- **Fail-safe**: Errors never interrupt your workflow
69+
70+
### Data Storage
71+
Telemetry data is stored locally in:
72+
- **Windows**: `%APPDATA%\UnityMCP\`
73+
- **macOS**: `~/Library/Application Support/UnityMCP/`
74+
- **Linux**: `~/.local/share/UnityMCP/`
75+
76+
Files created:
77+
- `customer_uuid.txt`: Anonymous identifier
78+
- `milestones.json`: One-time events tracker
79+
80+
### Data Transmission
81+
- **Endpoint**: `https://api-prod.coplay.dev/telemetry/events`
82+
- **Method**: HTTPS POST with JSON payload
83+
- **Retry**: Background thread with graceful failure
84+
- **Timeout**: 10 second timeout, no retries on failure
85+
86+
## 📈 How We Use This Data
87+
88+
### Product Improvement
89+
- **Feature Usage**: Understand which tools are most/least used
90+
- **Performance**: Identify slow operations to optimize
91+
- **Reliability**: Track error rates and connection issues
92+
- **Compatibility**: Ensure Unity version compatibility
93+
94+
### Development Priorities
95+
- **Roadmap**: Focus development on most-used features
96+
- **Bug Fixes**: Prioritize fixes based on error frequency
97+
- **Platform Support**: Allocate resources based on platform usage
98+
- **Documentation**: Improve docs for commonly problematic areas
99+
100+
### What We Don't Do
101+
- ❌ Sell data to third parties
102+
- ❌ Use data for advertising/marketing
103+
- ❌ Track individual developers
104+
- ❌ Store sensitive project information
105+
106+
## 🛠️ For Developers
107+
108+
### Testing Telemetry
109+
```bash
110+
cd UnityMcpBridge/UnityMcpServer~/src
111+
python test_telemetry.py
112+
```
113+
114+
### Custom Telemetry Events
115+
```python
116+
from telemetry import record_telemetry, RecordType
117+
118+
record_telemetry(RecordType.USAGE, {
119+
"custom_event": "my_feature_used",
120+
"metadata": "optional_data"
121+
})
122+
```
123+
124+
### Telemetry Status Check
125+
```python
126+
from telemetry import is_telemetry_enabled
127+
128+
if is_telemetry_enabled():
129+
print("Telemetry is active")
130+
else:
131+
print("Telemetry is disabled")
132+
```
133+
134+
## 📋 Data Retention Policy
135+
136+
- **Aggregated Data**: Retained indefinitely for product insights
137+
- **Raw Events**: Automatically purged after 90 days
138+
- **Personal Data**: None collected, so none to purge
139+
- **Opt-out**: Immediate - no data sent after opting out
140+
141+
## 🤝 Contact & Transparency
142+
143+
- **Questions**: [Discord Community](https://discord.gg/y4p8KfzrN4)
144+
- **Issues**: [GitHub Issues](https://github.com/CoplayDev/unity-mcp/issues)
145+
- **Privacy Concerns**: Create a GitHub issue with "Privacy" label
146+
- **Source Code**: All telemetry code is open source in this repository
147+
148+
## 📊 Example Telemetry Event
149+
150+
Here's what a typical telemetry event looks like:
151+
152+
```json
153+
{
154+
"record": "tool_execution",
155+
"timestamp": 1704067200,
156+
"customer_uuid": "550e8400-e29b-41d4-a716-446655440000",
157+
"session_id": "abc123-def456-ghi789",
158+
"version": "3.0.2",
159+
"platform": "posix",
160+
"data": {
161+
"tool_name": "manage_script",
162+
"success": true,
163+
"duration_ms": 42.5
164+
}
165+
}
166+
```
167+
168+
Notice:
169+
- ✅ Anonymous UUID (randomly generated)
170+
- ✅ Tool performance metrics
171+
- ✅ Success/failure tracking
172+
- ❌ No code content
173+
- ❌ No project information
174+
- ❌ No personal data
175+
176+
---
177+
178+
*Unity MCP Telemetry is designed to respect your privacy while helping us build a better tool. Thank you for helping improve Unity MCP!*

0 commit comments

Comments
 (0)