msty-admin-mcp 6.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. msty_admin_mcp-6.1.2/.gitignore +76 -0
  2. msty_admin_mcp-6.1.2/CHANGELOG.md +269 -0
  3. msty_admin_mcp-6.1.2/LICENSE +21 -0
  4. msty_admin_mcp-6.1.2/PKG-INFO +361 -0
  5. msty_admin_mcp-6.1.2/README.md +342 -0
  6. msty_admin_mcp-6.1.2/assets/demo.gif +0 -0
  7. msty_admin_mcp-6.1.2/assets/logo.svg +141 -0
  8. msty_admin_mcp-6.1.2/docs/BLOOM_GUIDE.md +521 -0
  9. msty_admin_mcp-6.1.2/pyproject.toml +37 -0
  10. msty_admin_mcp-6.1.2/requirements.txt +14 -0
  11. msty_admin_mcp-6.1.2/src/__init__.py +21 -0
  12. msty_admin_mcp-6.1.2/src/analytics.py +270 -0
  13. msty_admin_mcp-6.1.2/src/automation/__init__.py +2 -0
  14. msty_admin_mcp-6.1.2/src/bloom/__init__.py +15 -0
  15. msty_admin_mcp-6.1.2/src/bloom/cv_behaviors.py +74 -0
  16. msty_admin_mcp-6.1.2/src/bloom/evaluator.py +281 -0
  17. msty_admin_mcp-6.1.2/src/bloom/example_behaviors.py +3 -0
  18. msty_admin_mcp-6.1.2/src/bloom/mcp_tools.py +235 -0
  19. msty_admin_mcp-6.1.2/src/bloom/ollama_adapter.py +199 -0
  20. msty_admin_mcp-6.1.2/src/calibration/__init__.py +11 -0
  21. msty_admin_mcp-6.1.2/src/config/__init__.py +2 -0
  22. msty_admin_mcp-6.1.2/src/database/__init__.py +3 -0
  23. msty_admin_mcp-6.1.2/src/db.py +408 -0
  24. msty_admin_mcp-6.1.2/src/frontier.py +346 -0
  25. msty_admin_mcp-6.1.2/src/frontier_main.py +30 -0
  26. msty_admin_mcp-6.1.2/src/hardware/__init__.py +2 -0
  27. msty_admin_mcp-6.1.2/src/intelligence/__init__.py +12 -0
  28. msty_admin_mcp-6.1.2/src/inventory.py +272 -0
  29. msty_admin_mcp-6.1.2/src/nexus.py +62 -0
  30. msty_admin_mcp-6.1.2/src/paths.py +334 -0
  31. msty_admin_mcp-6.1.2/src/phase4_5_tools.py +370 -0
  32. msty_admin_mcp-6.1.2/src/server.py +1034 -0
  33. msty_admin_mcp-6.1.2/src/services.py +103 -0
  34. msty_admin_mcp-6.1.2/src/utils/__init__.py +2 -0
  35. msty_admin_mcp-6.1.2/tests/__init__.py +1 -0
  36. msty_admin_mcp-6.1.2/tests/test_frontier.py +203 -0
  37. msty_admin_mcp-6.1.2/tests/test_packaging.py +42 -0
  38. msty_admin_mcp-6.1.2/tests/test_server.py +519 -0
@@ -0,0 +1,76 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual environments
24
+ .venv/
25
+ venv/
26
+ ENV/
27
+ env/
28
+
29
+ # IDE
30
+ .idea/
31
+ .vscode/
32
+ *.swp
33
+ *.swo
34
+ *~
35
+
36
+ # Testing
37
+ .pytest_cache/
38
+ .coverage
39
+ htmlcov/
40
+ .tox/
41
+ .nox/
42
+
43
+ # macOS
44
+ .DS_Store
45
+ .AppleDouble
46
+ .LSOverride
47
+
48
+ # Distribution / packaging
49
+ .Python
50
+ *.manifest
51
+ *.spec
52
+
53
+ # Logs
54
+ *.log
55
+ pip-log.txt
56
+ pip-delete-this-directory.txt
57
+
58
+ # Local development
59
+ .env
60
+ .env.local
61
+ *.local
62
+
63
+ # Database files (for testing)
64
+ *.db
65
+ *.sqlite
66
+ *.sqlite3
67
+
68
+ # Backup files
69
+ *.bak
70
+ *.backup
71
+
72
+ # Personal configuration exports (may contain absolute paths, emails, API keys)
73
+ # Never commit these — keep local-only. Public docs use ~/ placeholders only.
74
+ msty-import/
75
+ export/
76
+ config-backup/
@@ -0,0 +1,269 @@
1
+ # Msty Admin MCP — Changelog
2
+
3
+ ## Unreleased
4
+
5
+ ## v6.1.2 — 2026-10-14
6
+
7
+ ### Fixed
8
+
9
+ - Fresh installs work again. The MCP Python SDK 2.x renamed `FastMCP`, so a new install picked up 2.x and the server could not start. The dependency is now `mcp>=1.0.0,<2`.
10
+ - README install steps corrected (Python 3.10+, GitHub install fallback, from-source steps).
11
+
12
+ ### Added
13
+
14
+ - Packaging tests: the server modules and both console entry points must import, and the installed MCP SDK must be 1.x.
15
+
16
+ ## v6.1.1 — 2026-10-13
17
+
18
+ ### Security
19
+
20
+ - Stored API keys are now better protected in `read_msty_database`. Please update to this release.
21
+
22
+ ## v6.1.0 — 2026-10-04
23
+
24
+ ### Added
25
+
26
+ - `ask_frontier` on a one-tool server (`msty-frontier` / `python -m src.frontier_main`). A local model in Msty calls it. The tool runs `cursor-agent` in ask mode and returns the text in that Msty chat. A follow-up resumes the same Cursor chat.
27
+ - Session id stored in `~/.msty-admin/frontier-session.json` (mode `0600`).
28
+ - Optional `MSTY_FRONTIER_WORKSPACE` so the agent can read one project folder. The default folder is empty.
29
+ - `CURSOR_API_KEY` (a Cursor **user** API key) is read from the server environment. It is not stored in this repo.
30
+
31
+ ### Notes
32
+
33
+ - Ask mode does not send mail, move or delete files, or use trading tools.
34
+ - The local-model toolset should contain only the frontier server. Other toolbox servers in the same toolset will be called as well.
35
+ - The local model must emit a real tool call. A model that only writes prose never reaches Cursor. `identify_handoff_triggers` still only scores past Studio metrics. It does not send the question.
36
+ - `cursor-agent status` does not show an API-key login. Ask mode uses the key when `CURSOR_API_KEY` is set.
37
+
38
+ ## v6.0.0 — 2026-08-01
39
+
40
+ ### Major Changes
41
+
42
+ #### P0: Studio 2.9 path and database detection
43
+ - Detect `/Applications/MstyStudio.app` and read version from `Info.plist`
44
+ - Resolve workspace SQLite under Chromium File System (`…/File System/000/t/00/00000000`)
45
+ - Read service ports/model paths from `Gifnoc.nosj`
46
+ - Open Studio DB **read-only** with SELECT/WITH/PRAGMA-only query guard
47
+ - Precise API-key redaction that does not corrupt `promptTokens` / `completionTokens`
48
+
49
+ #### Phase 7: Studio entity inventory (15 tools)
50
+ - Catalogue, workspaces, personas, shadow personas, crews
51
+ - Knowledge Stacks, turnstiles, skills, live contexts, prompts
52
+ - Context Studio attachments/folders, Agent Mode plans
53
+ - `get_studio_entity`, `get_schema_migrations`, `export_workflow_pack`
54
+
55
+ #### Phase 8: Nexus bridge (4 tools)
56
+ - `detect_nexus`, `list_nexus_models`, `query_nexus`, `get_insights_usage`
57
+ - `MSTY_NEXUS_PORT` (default 11434)
58
+
59
+ #### Intelligence layer now uses live Studio data
60
+ - `get_model_performance_metrics` / insights from `insightsLanguageModelUsage`
61
+ - `optimise_knowledge_stacks` and `suggest_persona_improvements` no longer stubs
62
+ - `recommend_model` prefers 30-day insights when present
63
+ - `analyse_conversation_patterns` reads conversation + insights tables
64
+
65
+ ### Tool Summary (55 Total)
66
+ Phases 1–6 retained and rewired; Phase 7 (15) + Phase 8 (4) added.
67
+
68
+ ### Tests
69
+ - Rewrote `tests/test_server.py` for v6 contracts
70
+ - 32 unit tests covering paths, DB safety, inventory, analytics, MCP JSON tools
71
+ - Live smoke verified on Studio **2.9.2** (detection, tools, personas, 68 insight rows)
72
+
73
+ ### Breaking
74
+ - Requires Msty Studio Desktop layout used by 2.4+ / 2.9 (File System SQLite)
75
+ - `read_msty_database` default query mode is `stats` (or pass SQL / `tables`)
76
+ - `import_tool_config` no longer writes the live Studio DB by default
77
+
78
+ ---
79
+
80
+ ## v5.0.0 — 2024
81
+
82
+ ### Major Changes
83
+
84
+ #### Architecture: Msty 2.4.0+ Port-Based Service Discovery
85
+ - Replaced process-based service detection with port-based discovery
86
+ - Services now exposed via ports: Local AI (11964), MLX (11973), LLaMA.cpp (11454), Vibe CLI Proxy (8317)
87
+ - Environment variables: `MSTY_HOST`, `MSTY_AI_PORT`, `MSTY_MLX_PORT`, `MSTY_LLAMACPP_PORT`, `MSTY_VIBE_PORT`
88
+ - Fully backwards compatible with Msty 2.4.0+ installations
89
+
90
+ #### Phase 3 Expansion: New Service Backend Tools
91
+ - **MLX Integration** (2 tools):
92
+ - `list_mlx_models`: Enumerate MLX models available locally
93
+ - `chat_with_mlx_model`: Chat with MLX models
94
+ - **LLaMA.cpp Integration** (2 tools):
95
+ - `list_llamacpp_models`: Enumerate LLaMA.cpp models
96
+ - `chat_with_llamacpp_model`: Chat with LLaMA.cpp models
97
+ - **Vibe CLI Proxy** (2 tools):
98
+ - `get_vibe_proxy_status`: Check Vibe CLI proxy health
99
+ - `query_vibe_proxy`: Query Vibe proxy services
100
+
101
+ #### Phase 6: Bloom Behavioral Evaluation
102
+ - Complete Bloom integration for evaluating local LLM behaviors
103
+ - Detects: sycophancy, hallucination, overconfidence, scope-creep, task-quality-degradation, certainty-calibration, context-window-degradation, instruction-following
104
+ - Custom behavior definitions via `cv_behaviors.py`
105
+ - Quality thresholds by task category (research_analysis, data_processing, advisory_tasks, general_tasks)
106
+ - Handoff triggers for escalation to Claude
107
+ - Requires Anthropic API key for judge model (Claude Sonnet 4 recommended)
108
+ - Tools: `bloom_evaluate_model`, `bloom_check_handoff`, `bloom_get_history`, `bloom_list_behaviors`, `bloom_get_thresholds`, `bloom_validate_model`
109
+
110
+ #### Transport: Streamable HTTP
111
+ - Run MCP server as standalone HTTP endpoint
112
+ - `--transport streamable-http` flag
113
+ - Remote access to MCP tools via HTTP
114
+ - Uvicorn/Starlette backend
115
+ - Perfect for distributed Msty deployments
116
+
117
+ ### Tool Summary (36 Total)
118
+
119
+ **Phase 1: Foundational (6 tools)**
120
+ - `detect_msty_installation`: Locate Msty installation and configuration
121
+ - `read_msty_database`: Query Msty SQLite database directly
122
+ - `list_configured_tools`: List all Msty tools
123
+ - `get_model_providers`: List available model providers
124
+ - `analyse_msty_health`: Get comprehensive system health report
125
+ - `get_server_status`: Check MCP server health
126
+
127
+ **Phase 2: Configuration (4 tools)**
128
+ - `export_tool_config`: Export Msty tool configurations
129
+ - `sync_claude_preferences`: Sync Claude preferences with Msty
130
+ - `generate_persona`: Create AI personas for Msty
131
+ - `import_tool_config`: Import tool configurations
132
+
133
+ **Phase 3: Service Integration (11 tools)**
134
+ - `get_service_status`: Check all service backends
135
+ - `list_available_models`: List all available models across services
136
+ - `query_local_ai_service`: Query Local AI (Ollama) service
137
+ - `chat_with_local_model`: Chat with Local AI models
138
+ - `recommend_model`: Get model recommendations
139
+ - `list_mlx_models`: List MLX models
140
+ - `chat_with_mlx_model`: Chat with MLX models
141
+ - `list_llamacpp_models`: List LLaMA.cpp models
142
+ - `chat_with_llamacpp_model`: Chat with LLaMA.cpp models
143
+ - `get_vibe_proxy_status`: Check Vibe proxy
144
+ - `query_vibe_proxy`: Query Vibe services
145
+
146
+ **Phase 4: Intelligence Layer (5 tools)**
147
+ - `get_model_performance_metrics`: Get model performance analytics
148
+ - `analyse_conversation_patterns`: Analyze conversation data
149
+ - `compare_model_responses`: Compare outputs from different models
150
+ - `optimise_knowledge_stacks`: Suggest stack optimizations
151
+ - `suggest_persona_improvements`: Improve persona definitions
152
+
153
+ **Phase 5: Tiered AI Workflow / Calibration (4 tools)**
154
+ - `run_calibration_test`: Test model capabilities with scoring
155
+ - `evaluate_response_quality`: Evaluate response quality (0.0-1.0)
156
+ - `identify_handoff_triggers`: Identify patterns requiring escalation
157
+ - `get_calibration_history`: Get historical calibration results
158
+
159
+ **Phase 6: Bloom Behavioral Evaluation (6 tools)**
160
+ - `bloom_evaluate_model`: Run Bloom evaluation on local model
161
+ - `bloom_check_handoff`: Check if model should hand off to Claude
162
+ - `bloom_get_history`: Get past Bloom evaluation results
163
+ - `bloom_list_behaviors`: List available behaviors
164
+ - `bloom_get_thresholds`: Get quality thresholds by category
165
+ - `bloom_validate_model`: Validate model suitability
166
+
167
+ ### Bug Fixes
168
+ - Fixed `run_calibration_test` broken import referencing nonexistent `register_phase5_tools` — rewired to use `CALIBRATION_PROMPTS`, `evaluate_response_heuristic`, `init_metrics_db`, and `save_calibration_result` from `phase4_5_tools`
169
+ - Fixed `evaluate_response_quality` criteria scoring
170
+ - Fixed `import_tool_config` database transaction handling
171
+ - Fixed `generate_persona` prompt injection vulnerability
172
+ - Improved error handling for service connection timeouts
173
+ - Fixed metrics database initialization on first run
174
+
175
+ ### Known Limitations
176
+ - `chat_with_local_model`, `chat_with_mlx_model`, and `run_calibration_test` may timeout (30s) if the model is not already loaded in memory due to cold-start latency
177
+
178
+ ### Documentation
179
+ - Complete README.md rewrite with installation, usage, architecture
180
+ - 8 comprehensive use cases with examples
181
+ - Hardware recommendations and performance expectations
182
+ - FAQ with common questions
183
+ - Architecture diagram showing service components
184
+
185
+ ### Dependencies
186
+ - Python 3.10+ (strict requirement)
187
+ - MCP SDK v1.0.0+
188
+ - psutil 5.9.0+
189
+ - Optional: uvicorn, starlette (for HTTP transport)
190
+
191
+ ### Database
192
+ - SQLite metrics database at `~/.msty-admin/msty_admin_metrics.db`
193
+ - Tables: model_metrics, calibration_tests, handoff_triggers, conversation_analytics
194
+ - Automatic initialization on first run
195
+
196
+ ---
197
+
198
+ ## v4.2.0 — 2024
199
+
200
+ ### Added
201
+ - Phase 5 Calibration Tools: `run_calibration_test`, `evaluate_response_quality`, `identify_handoff_triggers`, `get_calibration_history`
202
+ - SQLite metrics database for storing calibration results and performance metrics
203
+ - Quality rubric for response evaluation
204
+ - Handoff trigger patterns for escalation
205
+
206
+ ### Improved
207
+ - Model recommendation logic with performance metrics
208
+ - Error messages for service connection issues
209
+ - Documentation for calibration workflow
210
+
211
+ ---
212
+
213
+ ## v4.1.0 — 2024
214
+
215
+ ### Added
216
+ - Phase 4 Intelligence Layer: `get_model_performance_metrics`, `analyse_conversation_patterns`, `compare_model_responses`, `optimise_knowledge_stacks`, `suggest_persona_improvements`
217
+ - Conversation analytics and pattern detection
218
+ - Model comparison capabilities
219
+
220
+ ---
221
+
222
+ ## v4.0.0 — 2024
223
+
224
+ ### Major Changes
225
+ - Phase 3 Service Integration redesigned for multiple backends
226
+ - Local AI service (Ollama) as primary backend
227
+ - Comprehensive health monitoring
228
+ - Service status and model availability endpoints
229
+
230
+ ### Added
231
+ - Phase 3 Tools (6): `get_service_status`, `list_available_models`, `query_local_ai_service`, `chat_with_local_model`, `recommend_model`
232
+ - Service health reports
233
+ - Model recommendation system
234
+
235
+ ---
236
+
237
+ ## v3.0.0 — 2024
238
+
239
+ ### Major Changes
240
+ - Phase 2 Configuration tools for Msty integration
241
+ - Tool export/import functionality
242
+ - Persona generation system
243
+
244
+ ### Added
245
+ - Phase 2 Tools (4): `export_tool_config`, `sync_claude_preferences`, `generate_persona`, `import_tool_config`
246
+ - Configuration synchronization
247
+ - Persona management
248
+
249
+ ---
250
+
251
+ ## v2.0.0 — 2024
252
+
253
+ ### Major Changes
254
+ - Phase 1 Foundational tools for Msty detection and database access
255
+ - Core infrastructure for MCP server
256
+
257
+ ### Added
258
+ - Phase 1 Tools (6): `detect_msty_installation`, `read_msty_database`, `list_configured_tools`, `get_model_providers`, `analyse_msty_health`, `get_server_status`
259
+ - Msty database query capabilities
260
+ - System health analysis
261
+
262
+ ---
263
+
264
+ ## v1.0.0 — 2024
265
+
266
+ ### Initial Release
267
+ - MCP server for Msty Studio Desktop
268
+ - Basic service integration
269
+ - Foundation for tool framework
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025–2026 M-Pineapple 🍍
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.