system1-mcp 0.1.0__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.
- system1_mcp-0.1.0/LICENSE +21 -0
- system1_mcp-0.1.0/PKG-INFO +343 -0
- system1_mcp-0.1.0/README.md +311 -0
- system1_mcp-0.1.0/pyproject.toml +70 -0
- system1_mcp-0.1.0/setup.cfg +4 -0
- system1_mcp-0.1.0/system1_mcp/__init__.py +13 -0
- system1_mcp-0.1.0/system1_mcp/batteries.py +49 -0
- system1_mcp-0.1.0/system1_mcp/cli.py +252 -0
- system1_mcp-0.1.0/system1_mcp/client.py +162 -0
- system1_mcp-0.1.0/system1_mcp/config.py +144 -0
- system1_mcp-0.1.0/system1_mcp/errors.py +27 -0
- system1_mcp-0.1.0/system1_mcp/installer.py +315 -0
- system1_mcp-0.1.0/system1_mcp/server.py +160 -0
- system1_mcp-0.1.0/system1_mcp/tools.py +307 -0
- system1_mcp-0.1.0/system1_mcp.egg-info/PKG-INFO +343 -0
- system1_mcp-0.1.0/system1_mcp.egg-info/SOURCES.txt +23 -0
- system1_mcp-0.1.0/system1_mcp.egg-info/dependency_links.txt +1 -0
- system1_mcp-0.1.0/system1_mcp.egg-info/entry_points.txt +2 -0
- system1_mcp-0.1.0/system1_mcp.egg-info/requires.txt +7 -0
- system1_mcp-0.1.0/system1_mcp.egg-info/top_level.txt +1 -0
- system1_mcp-0.1.0/tests/test_cli.py +44 -0
- system1_mcp-0.1.0/tests/test_config.py +69 -0
- system1_mcp-0.1.0/tests/test_installer.py +93 -0
- system1_mcp-0.1.0/tests/test_integration.py +91 -0
- system1_mcp-0.1.0/tests/test_tools.py +326 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 System 1 Contributors
|
|
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.
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: system1-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Jev-powered System 1 reflex engine for AI agents via Model Context Protocol (MCP)
|
|
5
|
+
Author: System 1 Contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://typesafe.ai
|
|
8
|
+
Project-URL: Documentation, https://github.com/ericmaddox/system1-mcp#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/ericmaddox/system1-mcp
|
|
10
|
+
Project-URL: Issues, https://github.com/ericmaddox/system1-mcp/issues
|
|
11
|
+
Keywords: mcp,ai-agents,typesafe,jev,system-1,system1,guardrails,routing,reflex,claude,cursor,antigravity
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: mcp>=1.0.0
|
|
26
|
+
Requires-Dist: typesafe-sdk>=0.5.7
|
|
27
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# System 1 MCP Server
|
|
34
|
+
|
|
35
|
+
[](https://github.com/ericmaddox/system1-mcp/actions/workflows/ci.yml)
|
|
36
|
+
[](https://pypi.org/project/system1-mcp/)
|
|
37
|
+
[](https://www.python.org/downloads/)
|
|
38
|
+
[](LICENSE)
|
|
39
|
+
|
|
40
|
+
**A Jev-powered System 1 reflex engine for AI agents via Model Context Protocol (MCP).**
|
|
41
|
+
|
|
42
|
+
Modern AI agents (Claude Desktop, Cursor, Antigravity, OpenHands, Hermes) typically route every decision through a full large language model deliberation loop—even for fast binary checks such as determining if a command is destructive or selecting among known configuration paths. This introduces 1,500–3,000 ms of latency and burns unnecessary tokens per evaluation.
|
|
43
|
+
|
|
44
|
+
**System 1 MCP** provides agents with calibrated, low-latency **System 1 reflexes**. Powered by [TypeSafe](https://typesafe.ai)'s Jev model, System 1 MCP exposes 4 specialized MCP tools that return typed probabilities and discrete verdicts in approximately 50–150 ms without chain-of-thought token generation.
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
Agent (Claude / Cursor / Antigravity)
|
|
48
|
+
│
|
|
49
|
+
▼ [MCP stdio JSON-RPC]
|
|
50
|
+
System 1 MCP Server
|
|
51
|
+
│
|
|
52
|
+
▼ [Single TypeSafe API call ~50-150ms]
|
|
53
|
+
TypeSafe Jev (System One) ──► Calibrated Probabilities & Decisions
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Latency Profile and Operational Model
|
|
59
|
+
|
|
60
|
+
- **Model inference**: ~20–40 ms
|
|
61
|
+
- **Network round-trip to api.typesafe.ai**: ~30–120 ms (geography dependent)
|
|
62
|
+
- **Total end-to-end latency**: **~50–200 ms**
|
|
63
|
+
- Compared to full LLM deliberation (~1,500–3,000 ms), System 1 MCP executes **10x–20x faster** while using zero output tokens.
|
|
64
|
+
|
|
65
|
+
> **Advisory Notice**: MCP tools provide advisory assessments. System 1 MCP supplies calibrated risk probabilities and classifications; the calling agent's decision engine retains authority over final execution.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Tool Reference
|
|
70
|
+
|
|
71
|
+
### 1. `fast_guard` — Pre-Execution Command and Action Safety Check
|
|
72
|
+
|
|
73
|
+
Call prior to executing shell commands, database updates, or external API modifications to assess risk profile and blast radius.
|
|
74
|
+
|
|
75
|
+
**Input**:
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"command": "rm -rf /var/cache/*",
|
|
79
|
+
"goal": "Clean project temporary artifacts",
|
|
80
|
+
"workspace": "/repo"
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Output**:
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"action": "block",
|
|
88
|
+
"is_destructive": 0.99,
|
|
89
|
+
"is_dangerous": 0.72,
|
|
90
|
+
"is_out_of_scope": 0.85,
|
|
91
|
+
"blast_radius": {
|
|
92
|
+
"score": 2.1,
|
|
93
|
+
"legend": {
|
|
94
|
+
"0": "Isolated: Read-only check, single temporary file",
|
|
95
|
+
"1": "Workspace: Modifies local project directory",
|
|
96
|
+
"2": "System-wide: Modifies system configuration or root",
|
|
97
|
+
"3": "External: Impacts remote servers or databases"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Decision Logic**:
|
|
104
|
+
- If `max(is_destructive, is_dangerous) >= block_threshold` (default `0.80`) ➔ `"block"`
|
|
105
|
+
- Else if `max(is_destructive, is_dangerous) >= review_threshold` (default `0.40`) ➔ `"review"`
|
|
106
|
+
- Else ➔ `"pass"`
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### 2. `fast_judge` — Best-Option Selection
|
|
111
|
+
|
|
112
|
+
Select one option from a bounded set without deliberative text generation.
|
|
113
|
+
|
|
114
|
+
**Input**:
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"question": "Which configuration file handles TypeScript compiler options?",
|
|
118
|
+
"options": {
|
|
119
|
+
"tsconfig.json": "TypeScript configuration",
|
|
120
|
+
"package.json": "NPM manifest",
|
|
121
|
+
"vite.config.ts": "Bundler configuration"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Output**:
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"choice": "tsconfig.json",
|
|
130
|
+
"confidence": 0.96,
|
|
131
|
+
"probabilities": {
|
|
132
|
+
"tsconfig.json": 0.96,
|
|
133
|
+
"package.json": 0.03,
|
|
134
|
+
"vite.config.ts": 0.01
|
|
135
|
+
},
|
|
136
|
+
"is_confident": true
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
### 3. `fast_verify` — Condition and State Verification
|
|
143
|
+
|
|
144
|
+
Verify assertions against evidence, goal completion, test outputs, or status checks.
|
|
145
|
+
|
|
146
|
+
**Input**:
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"statement": "All unit tests passed without regression",
|
|
150
|
+
"evidence": "PASSED tests/test_auth.py (14/14) in 1.2s. 0 failed, 0 skipped."
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**Output**:
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"probability": 0.98,
|
|
158
|
+
"is_true": true,
|
|
159
|
+
"assessment": "high_confidence_yes"
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Assessment Classifications**:
|
|
164
|
+
- `> 0.85` ➔ `"high_confidence_yes"`
|
|
165
|
+
- `0.60–0.85` ➔ `"likely_yes"`
|
|
166
|
+
- `0.40–0.60` ➔ `"uncertain"`
|
|
167
|
+
- `0.15–0.40` ➔ `"likely_no"`
|
|
168
|
+
- `< 0.15` ➔ `"high_confidence_no"`
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### 4. `fast_score` — Multi-Level Assessment
|
|
173
|
+
|
|
174
|
+
Evaluate inputs against an ordered scale (e.g., severity, priority, or alignment).
|
|
175
|
+
|
|
176
|
+
**Input**:
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"question": "Rate the severity of this production alert",
|
|
180
|
+
"levels": [
|
|
181
|
+
"Low / Cosmetic: non-blocking visual issue",
|
|
182
|
+
"Medium: degraded feature with workaround available",
|
|
183
|
+
"High / Critical: database unavailable or data corruption risk"
|
|
184
|
+
],
|
|
185
|
+
"content": "ALERT: Primary PostgreSQL instance replication lag exceeded 15 minutes, writes failing."
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Output**:
|
|
190
|
+
```json
|
|
191
|
+
{
|
|
192
|
+
"score": 1.95,
|
|
193
|
+
"confidence": 0.91,
|
|
194
|
+
"legend": {
|
|
195
|
+
"0": "Low / Cosmetic: non-blocking visual issue",
|
|
196
|
+
"1": "Medium: degraded feature with workaround available",
|
|
197
|
+
"2": "High / Critical: database unavailable or data corruption risk"
|
|
198
|
+
},
|
|
199
|
+
"probabilities": {
|
|
200
|
+
"0": 0.01,
|
|
201
|
+
"1": 0.08,
|
|
202
|
+
"2": 0.91
|
|
203
|
+
},
|
|
204
|
+
"is_confident": true
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Resilience and Graceful Escalation
|
|
211
|
+
|
|
212
|
+
When API errors, network timeouts, or rate limits occur, System 1 MCP maintains standard MCP connection stability and does not terminate the JSON-RPC channel. Instead, it emits a structured fallback payload:
|
|
213
|
+
|
|
214
|
+
```json
|
|
215
|
+
{
|
|
216
|
+
"error": true,
|
|
217
|
+
"error_type": "api_timeout",
|
|
218
|
+
"message": "TypeSafe API request timed out after 5.0s",
|
|
219
|
+
"fallback_action": "escalate"
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
When receiving `fallback_action: "escalate"`, the host agent gracefully falls back to standard LLM deliberative reasoning.
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Installation and Setup
|
|
228
|
+
|
|
229
|
+
### Option A: Automatic Multi-IDE Installer (Recommended)
|
|
230
|
+
|
|
231
|
+
System 1 MCP includes an automated installer that detects and configures Claude Desktop, Cursor, Google Antigravity, Windsurf, Roo Code, Cline, and Zed:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# Interactive setup (prompts for API key and autodetects IDE installations)
|
|
235
|
+
uvx system1-mcp install
|
|
236
|
+
|
|
237
|
+
# Non-interactive setup with explicit key
|
|
238
|
+
uvx system1-mcp install --api-key ts_live_your_key_here
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Option B: Health Check and Diagnostics (`doctor`)
|
|
242
|
+
|
|
243
|
+
Inspect installation status, identify detected configuration paths, and measure live API latency:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
uvx system1-mcp doctor
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Sample output:
|
|
250
|
+
```
|
|
251
|
+
>> System 1 MCP Diagnostics (v0.1.0)
|
|
252
|
+
|
|
253
|
+
Environment:
|
|
254
|
+
Python: 3.11.15
|
|
255
|
+
Config File: ~/.system1/config.json (found)
|
|
256
|
+
|
|
257
|
+
API Key Status:
|
|
258
|
+
Status: [OK] Configured
|
|
259
|
+
Resolved Key: ts_...8f2a
|
|
260
|
+
Source Origin: config_file
|
|
261
|
+
|
|
262
|
+
Live TypeSafe Jev Connectivity:
|
|
263
|
+
Status: [OK] Connected to api.typesafe.ai
|
|
264
|
+
Model: jev-latest
|
|
265
|
+
Roundtrip: 64.2ms
|
|
266
|
+
Calibration: P(valid) = 0.99
|
|
267
|
+
|
|
268
|
+
Detected IDE Configurations:
|
|
269
|
+
Claude Desktop [Detected ] -> Configured [OK]
|
|
270
|
+
Cursor [Detected ] -> Configured [OK]
|
|
271
|
+
Google Antigravity [Detected ] -> Configured [OK]
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
### Option C: Manual Configuration
|
|
277
|
+
|
|
278
|
+
To manually configure an editor, add the server configuration entry:
|
|
279
|
+
|
|
280
|
+
#### Claude Desktop (`claude_desktop_config.json`) / Antigravity (`mcp_config.json`) / Cursor
|
|
281
|
+
```json
|
|
282
|
+
{
|
|
283
|
+
"mcpServers": {
|
|
284
|
+
"system1": {
|
|
285
|
+
"command": "uvx",
|
|
286
|
+
"args": ["system1-mcp"],
|
|
287
|
+
"env": {
|
|
288
|
+
"TYPESAFE_API_KEY": "your-typesafe-api-key-here"
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
> **Note**: If your key is stored in `~/.system1/config.json`, the `"env"` block is optional; the server resolves stored credentials automatically.
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Configuration Hierarchy
|
|
300
|
+
|
|
301
|
+
System 1 MCP searches for credentials using the following resolution order:
|
|
302
|
+
|
|
303
|
+
1. **Process Environment**: `TYPESAFE_API_KEY` (from environment or host IDE `env` map)
|
|
304
|
+
2. **User Configuration**: `~/.system1/config.json` (with fallback to `~/.fastpath/config.json`)
|
|
305
|
+
3. **Workspace File**: `.env` in the current working directory
|
|
306
|
+
|
|
307
|
+
To configure stored user credentials via CLI:
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
# Store API key
|
|
311
|
+
uvx system1-mcp config set-key ts_live_your_key_here
|
|
312
|
+
|
|
313
|
+
# Display current configuration status
|
|
314
|
+
uvx system1-mcp config show
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## Development and Testing
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
# Run unit test suite (27 offline unit tests)
|
|
323
|
+
pytest tests/ -v -m "not integration"
|
|
324
|
+
|
|
325
|
+
# Run integration tests against the live TypeSafe Jev API (requires TYPESAFE_API_KEY)
|
|
326
|
+
pytest tests/test_integration.py -v -m integration
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## Architectural Comparison
|
|
332
|
+
|
|
333
|
+
| Dimension | TypeSafe Agent Skill | System 1 MCP |
|
|
334
|
+
|---|---|---|
|
|
335
|
+
| **Role** | Instruction skill (`SKILL.md`) guiding LLMs to write TypeSafe code | Pre-packaged MCP server giving agents low-latency runtime reflexes |
|
|
336
|
+
| **Agent Schema Requirement** | Requires knowledge of `Noul`, `Choice`, `Score`, and state representations | Zero schema complexity; simple tool invocations (e.g. `fast_guard`) |
|
|
337
|
+
| **Target Use Case** | Generating TypeSafe application code | Real-time safety validation, option routing, and verification |
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
## License
|
|
342
|
+
|
|
343
|
+
This project is licensed under the terms of the [MIT License](LICENSE).
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
# System 1 MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://github.com/ericmaddox/system1-mcp/actions/workflows/ci.yml)
|
|
4
|
+
[](https://pypi.org/project/system1-mcp/)
|
|
5
|
+
[](https://www.python.org/downloads/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
**A Jev-powered System 1 reflex engine for AI agents via Model Context Protocol (MCP).**
|
|
9
|
+
|
|
10
|
+
Modern AI agents (Claude Desktop, Cursor, Antigravity, OpenHands, Hermes) typically route every decision through a full large language model deliberation loop—even for fast binary checks such as determining if a command is destructive or selecting among known configuration paths. This introduces 1,500–3,000 ms of latency and burns unnecessary tokens per evaluation.
|
|
11
|
+
|
|
12
|
+
**System 1 MCP** provides agents with calibrated, low-latency **System 1 reflexes**. Powered by [TypeSafe](https://typesafe.ai)'s Jev model, System 1 MCP exposes 4 specialized MCP tools that return typed probabilities and discrete verdicts in approximately 50–150 ms without chain-of-thought token generation.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
Agent (Claude / Cursor / Antigravity)
|
|
16
|
+
│
|
|
17
|
+
▼ [MCP stdio JSON-RPC]
|
|
18
|
+
System 1 MCP Server
|
|
19
|
+
│
|
|
20
|
+
▼ [Single TypeSafe API call ~50-150ms]
|
|
21
|
+
TypeSafe Jev (System One) ──► Calibrated Probabilities & Decisions
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Latency Profile and Operational Model
|
|
27
|
+
|
|
28
|
+
- **Model inference**: ~20–40 ms
|
|
29
|
+
- **Network round-trip to api.typesafe.ai**: ~30–120 ms (geography dependent)
|
|
30
|
+
- **Total end-to-end latency**: **~50–200 ms**
|
|
31
|
+
- Compared to full LLM deliberation (~1,500–3,000 ms), System 1 MCP executes **10x–20x faster** while using zero output tokens.
|
|
32
|
+
|
|
33
|
+
> **Advisory Notice**: MCP tools provide advisory assessments. System 1 MCP supplies calibrated risk probabilities and classifications; the calling agent's decision engine retains authority over final execution.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Tool Reference
|
|
38
|
+
|
|
39
|
+
### 1. `fast_guard` — Pre-Execution Command and Action Safety Check
|
|
40
|
+
|
|
41
|
+
Call prior to executing shell commands, database updates, or external API modifications to assess risk profile and blast radius.
|
|
42
|
+
|
|
43
|
+
**Input**:
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"command": "rm -rf /var/cache/*",
|
|
47
|
+
"goal": "Clean project temporary artifacts",
|
|
48
|
+
"workspace": "/repo"
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Output**:
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"action": "block",
|
|
56
|
+
"is_destructive": 0.99,
|
|
57
|
+
"is_dangerous": 0.72,
|
|
58
|
+
"is_out_of_scope": 0.85,
|
|
59
|
+
"blast_radius": {
|
|
60
|
+
"score": 2.1,
|
|
61
|
+
"legend": {
|
|
62
|
+
"0": "Isolated: Read-only check, single temporary file",
|
|
63
|
+
"1": "Workspace: Modifies local project directory",
|
|
64
|
+
"2": "System-wide: Modifies system configuration or root",
|
|
65
|
+
"3": "External: Impacts remote servers or databases"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Decision Logic**:
|
|
72
|
+
- If `max(is_destructive, is_dangerous) >= block_threshold` (default `0.80`) ➔ `"block"`
|
|
73
|
+
- Else if `max(is_destructive, is_dangerous) >= review_threshold` (default `0.40`) ➔ `"review"`
|
|
74
|
+
- Else ➔ `"pass"`
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### 2. `fast_judge` — Best-Option Selection
|
|
79
|
+
|
|
80
|
+
Select one option from a bounded set without deliberative text generation.
|
|
81
|
+
|
|
82
|
+
**Input**:
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"question": "Which configuration file handles TypeScript compiler options?",
|
|
86
|
+
"options": {
|
|
87
|
+
"tsconfig.json": "TypeScript configuration",
|
|
88
|
+
"package.json": "NPM manifest",
|
|
89
|
+
"vite.config.ts": "Bundler configuration"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Output**:
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"choice": "tsconfig.json",
|
|
98
|
+
"confidence": 0.96,
|
|
99
|
+
"probabilities": {
|
|
100
|
+
"tsconfig.json": 0.96,
|
|
101
|
+
"package.json": 0.03,
|
|
102
|
+
"vite.config.ts": 0.01
|
|
103
|
+
},
|
|
104
|
+
"is_confident": true
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### 3. `fast_verify` — Condition and State Verification
|
|
111
|
+
|
|
112
|
+
Verify assertions against evidence, goal completion, test outputs, or status checks.
|
|
113
|
+
|
|
114
|
+
**Input**:
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"statement": "All unit tests passed without regression",
|
|
118
|
+
"evidence": "PASSED tests/test_auth.py (14/14) in 1.2s. 0 failed, 0 skipped."
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**Output**:
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"probability": 0.98,
|
|
126
|
+
"is_true": true,
|
|
127
|
+
"assessment": "high_confidence_yes"
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Assessment Classifications**:
|
|
132
|
+
- `> 0.85` ➔ `"high_confidence_yes"`
|
|
133
|
+
- `0.60–0.85` ➔ `"likely_yes"`
|
|
134
|
+
- `0.40–0.60` ➔ `"uncertain"`
|
|
135
|
+
- `0.15–0.40` ➔ `"likely_no"`
|
|
136
|
+
- `< 0.15` ➔ `"high_confidence_no"`
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
### 4. `fast_score` — Multi-Level Assessment
|
|
141
|
+
|
|
142
|
+
Evaluate inputs against an ordered scale (e.g., severity, priority, or alignment).
|
|
143
|
+
|
|
144
|
+
**Input**:
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"question": "Rate the severity of this production alert",
|
|
148
|
+
"levels": [
|
|
149
|
+
"Low / Cosmetic: non-blocking visual issue",
|
|
150
|
+
"Medium: degraded feature with workaround available",
|
|
151
|
+
"High / Critical: database unavailable or data corruption risk"
|
|
152
|
+
],
|
|
153
|
+
"content": "ALERT: Primary PostgreSQL instance replication lag exceeded 15 minutes, writes failing."
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Output**:
|
|
158
|
+
```json
|
|
159
|
+
{
|
|
160
|
+
"score": 1.95,
|
|
161
|
+
"confidence": 0.91,
|
|
162
|
+
"legend": {
|
|
163
|
+
"0": "Low / Cosmetic: non-blocking visual issue",
|
|
164
|
+
"1": "Medium: degraded feature with workaround available",
|
|
165
|
+
"2": "High / Critical: database unavailable or data corruption risk"
|
|
166
|
+
},
|
|
167
|
+
"probabilities": {
|
|
168
|
+
"0": 0.01,
|
|
169
|
+
"1": 0.08,
|
|
170
|
+
"2": 0.91
|
|
171
|
+
},
|
|
172
|
+
"is_confident": true
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Resilience and Graceful Escalation
|
|
179
|
+
|
|
180
|
+
When API errors, network timeouts, or rate limits occur, System 1 MCP maintains standard MCP connection stability and does not terminate the JSON-RPC channel. Instead, it emits a structured fallback payload:
|
|
181
|
+
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"error": true,
|
|
185
|
+
"error_type": "api_timeout",
|
|
186
|
+
"message": "TypeSafe API request timed out after 5.0s",
|
|
187
|
+
"fallback_action": "escalate"
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
When receiving `fallback_action: "escalate"`, the host agent gracefully falls back to standard LLM deliberative reasoning.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Installation and Setup
|
|
196
|
+
|
|
197
|
+
### Option A: Automatic Multi-IDE Installer (Recommended)
|
|
198
|
+
|
|
199
|
+
System 1 MCP includes an automated installer that detects and configures Claude Desktop, Cursor, Google Antigravity, Windsurf, Roo Code, Cline, and Zed:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# Interactive setup (prompts for API key and autodetects IDE installations)
|
|
203
|
+
uvx system1-mcp install
|
|
204
|
+
|
|
205
|
+
# Non-interactive setup with explicit key
|
|
206
|
+
uvx system1-mcp install --api-key ts_live_your_key_here
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Option B: Health Check and Diagnostics (`doctor`)
|
|
210
|
+
|
|
211
|
+
Inspect installation status, identify detected configuration paths, and measure live API latency:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
uvx system1-mcp doctor
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Sample output:
|
|
218
|
+
```
|
|
219
|
+
>> System 1 MCP Diagnostics (v0.1.0)
|
|
220
|
+
|
|
221
|
+
Environment:
|
|
222
|
+
Python: 3.11.15
|
|
223
|
+
Config File: ~/.system1/config.json (found)
|
|
224
|
+
|
|
225
|
+
API Key Status:
|
|
226
|
+
Status: [OK] Configured
|
|
227
|
+
Resolved Key: ts_...8f2a
|
|
228
|
+
Source Origin: config_file
|
|
229
|
+
|
|
230
|
+
Live TypeSafe Jev Connectivity:
|
|
231
|
+
Status: [OK] Connected to api.typesafe.ai
|
|
232
|
+
Model: jev-latest
|
|
233
|
+
Roundtrip: 64.2ms
|
|
234
|
+
Calibration: P(valid) = 0.99
|
|
235
|
+
|
|
236
|
+
Detected IDE Configurations:
|
|
237
|
+
Claude Desktop [Detected ] -> Configured [OK]
|
|
238
|
+
Cursor [Detected ] -> Configured [OK]
|
|
239
|
+
Google Antigravity [Detected ] -> Configured [OK]
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
### Option C: Manual Configuration
|
|
245
|
+
|
|
246
|
+
To manually configure an editor, add the server configuration entry:
|
|
247
|
+
|
|
248
|
+
#### Claude Desktop (`claude_desktop_config.json`) / Antigravity (`mcp_config.json`) / Cursor
|
|
249
|
+
```json
|
|
250
|
+
{
|
|
251
|
+
"mcpServers": {
|
|
252
|
+
"system1": {
|
|
253
|
+
"command": "uvx",
|
|
254
|
+
"args": ["system1-mcp"],
|
|
255
|
+
"env": {
|
|
256
|
+
"TYPESAFE_API_KEY": "your-typesafe-api-key-here"
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
> **Note**: If your key is stored in `~/.system1/config.json`, the `"env"` block is optional; the server resolves stored credentials automatically.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Configuration Hierarchy
|
|
268
|
+
|
|
269
|
+
System 1 MCP searches for credentials using the following resolution order:
|
|
270
|
+
|
|
271
|
+
1. **Process Environment**: `TYPESAFE_API_KEY` (from environment or host IDE `env` map)
|
|
272
|
+
2. **User Configuration**: `~/.system1/config.json` (with fallback to `~/.fastpath/config.json`)
|
|
273
|
+
3. **Workspace File**: `.env` in the current working directory
|
|
274
|
+
|
|
275
|
+
To configure stored user credentials via CLI:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
# Store API key
|
|
279
|
+
uvx system1-mcp config set-key ts_live_your_key_here
|
|
280
|
+
|
|
281
|
+
# Display current configuration status
|
|
282
|
+
uvx system1-mcp config show
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Development and Testing
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
# Run unit test suite (27 offline unit tests)
|
|
291
|
+
pytest tests/ -v -m "not integration"
|
|
292
|
+
|
|
293
|
+
# Run integration tests against the live TypeSafe Jev API (requires TYPESAFE_API_KEY)
|
|
294
|
+
pytest tests/test_integration.py -v -m integration
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## Architectural Comparison
|
|
300
|
+
|
|
301
|
+
| Dimension | TypeSafe Agent Skill | System 1 MCP |
|
|
302
|
+
|---|---|---|
|
|
303
|
+
| **Role** | Instruction skill (`SKILL.md`) guiding LLMs to write TypeSafe code | Pre-packaged MCP server giving agents low-latency runtime reflexes |
|
|
304
|
+
| **Agent Schema Requirement** | Requires knowledge of `Noul`, `Choice`, `Score`, and state representations | Zero schema complexity; simple tool invocations (e.g. `fast_guard`) |
|
|
305
|
+
| **Target Use Case** | Generating TypeSafe application code | Real-time safety validation, option routing, and verification |
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## License
|
|
310
|
+
|
|
311
|
+
This project is licensed under the terms of the [MIT License](LICENSE).
|