mcp-jev 1.0.0
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.
- package/README.md +190 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +322 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -0
package/README.md
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# mcp-jev
|
|
2
|
+
|
|
3
|
+
MCP server cho [TypeSafe Jev](https://typesafe.ai) — System One Model.
|
|
4
|
+
|
|
5
|
+
Gửi state + typed questions → nhận calibrated probabilities. Không sinh text.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Khi nào dùng |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
| `jev_decide` | Classify, route, check, score bất kỳ nội dung nào |
|
|
12
|
+
| `jev_list_models` | Xem model IDs / aliases có sẵn trên API key của bạn |
|
|
13
|
+
|
|
14
|
+
### `jev_decide`
|
|
15
|
+
|
|
16
|
+
Đánh giá một hoặc nhiều câu hỏi trên cùng một `state` trong một request duy nhất.
|
|
17
|
+
|
|
18
|
+
**3 loại câu hỏi (primitives):**
|
|
19
|
+
|
|
20
|
+
| Type | Hỏi gì | Output |
|
|
21
|
+
|------|--------|--------|
|
|
22
|
+
| `noul` | Điều này có đúng không? | `noul`: probability 0–1 |
|
|
23
|
+
| `choice` | Chọn 1 trong N options? | `choice` + `probabilities` + `confidence` |
|
|
24
|
+
| `score` | Rate trên rubric này? | `score` (có thể là 1.04/3) + `probabilities` + `confidence` |
|
|
25
|
+
|
|
26
|
+
**Ví dụ — triage support ticket:**
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"state": {
|
|
31
|
+
"message": "Payout của tôi bị fail 3 ngày rồi, tôi cần xử lý gấp!"
|
|
32
|
+
},
|
|
33
|
+
"questions": [
|
|
34
|
+
{
|
|
35
|
+
"id": "is_urgent",
|
|
36
|
+
"type": "noul",
|
|
37
|
+
"instructions": "Người dùng trong `message` có cần hỗ trợ khẩn cấp không?"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"id": "department",
|
|
41
|
+
"type": "choice",
|
|
42
|
+
"instructions": "Bộ phận nào nên xử lý `message`?",
|
|
43
|
+
"criteria": {
|
|
44
|
+
"billing": "Thanh toán, hoàn tiền, hóa đơn",
|
|
45
|
+
"technical": "Lỗi kỹ thuật, tích hợp API",
|
|
46
|
+
"general": "Câu hỏi chung không thuộc category trên"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "frustration",
|
|
51
|
+
"type": "score",
|
|
52
|
+
"instructions": "Mức độ bực bội của người dùng trong `message` là bao nhiêu?",
|
|
53
|
+
"criteria": ["Bình thường", "Hơi khó chịu", "Rất bực bội"]
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Response mẫu:**
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"answers": {
|
|
64
|
+
"is_urgent": { "noul": 0.95 },
|
|
65
|
+
"department": {
|
|
66
|
+
"choice": "billing",
|
|
67
|
+
"probabilities": { "billing": 0.82, "technical": 0.12, "general": 0.06 },
|
|
68
|
+
"confidence": 0.80
|
|
69
|
+
},
|
|
70
|
+
"frustration": {
|
|
71
|
+
"score": 2.04,
|
|
72
|
+
"legend": "Rất bực bội",
|
|
73
|
+
"probabilities": { "Bình thường": 0.05, "Hơi khó chịu": 0.18, "Rất bực bội": 0.77 },
|
|
74
|
+
"confidence": 0.77
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"model": "jev-1.13.0",
|
|
78
|
+
"usage": { "input_tokens": 312, "output_tokens": 0 }
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Tips:**
|
|
83
|
+
- Chỉ gửi state fields mà questions cần — context dư làm giảm độ chính xác
|
|
84
|
+
- Reference fields bằng backtick: `` `message` ``, `` `order.id` ``
|
|
85
|
+
- `choice.criteria` null = "no extra detail" (dùng cho bucket `other`)
|
|
86
|
+
- `score.criteria` cần 2–10 levels, ordered thấp → cao
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
### `jev_list_models`
|
|
91
|
+
|
|
92
|
+
Trả về danh sách model IDs và aliases.
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
[
|
|
96
|
+
{ "id": "jev-1.13.0", "aliases": ["jev-latest"] }
|
|
97
|
+
]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Dùng khi muốn pin versioned ID thay vì `jev-latest` để tránh behavior thay đổi sau update.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Cài đặt & cấu hình
|
|
105
|
+
|
|
106
|
+
### Prerequisites
|
|
107
|
+
|
|
108
|
+
- Node.js ≥ 20
|
|
109
|
+
- TypeSafe API key — đăng ký waitlist tại [typesafe.ai](https://typesafe.ai)
|
|
110
|
+
|
|
111
|
+
### Build
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
cd mcp-jev
|
|
115
|
+
npm install
|
|
116
|
+
npm run build
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Kiro (`.kiro/settings/mcp.json`)
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"mcpServers": {
|
|
124
|
+
"jev": {
|
|
125
|
+
"command": "node",
|
|
126
|
+
"args": ["d:/github/crhead/mcp-jev/dist/index.js"],
|
|
127
|
+
"env": {
|
|
128
|
+
"TYPESAFE_API_KEY": "your_key_here"
|
|
129
|
+
},
|
|
130
|
+
"disabled": false
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Claude Desktop (`claude_desktop_config.json`)
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"mcpServers": {
|
|
141
|
+
"jev": {
|
|
142
|
+
"command": "node",
|
|
143
|
+
"args": ["/absolute/path/to/mcp-jev/dist/index.js"],
|
|
144
|
+
"env": {
|
|
145
|
+
"TYPESAFE_API_KEY": "your_key_here"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Dev mode (không cần build)
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
TYPESAFE_API_KEY=your_key npx tsx src/index.ts
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Biến môi trường
|
|
161
|
+
|
|
162
|
+
| Biến | Bắt buộc | Mặc định | Mô tả |
|
|
163
|
+
|------|----------|----------|-------|
|
|
164
|
+
| `TYPESAFE_API_KEY` | ✅ | — | API key từ console.typesafe.ai |
|
|
165
|
+
| `TYPESAFE_BASE_URL` | ❌ | `https://api.typesafe.ai` | Override URL (staging, proxy) |
|
|
166
|
+
|
|
167
|
+
Server exit với code 1 ngay khi start nếu `TYPESAFE_API_KEY` không được set.
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Error handling
|
|
172
|
+
|
|
173
|
+
| HTTP code | Ý nghĩa | Behavior |
|
|
174
|
+
|-----------|---------|----------|
|
|
175
|
+
| 401 | API key sai / thiếu | Trả về `isError: true` ngay |
|
|
176
|
+
| 422 | Request body invalid | Trả về `isError: true` ngay + message chi tiết |
|
|
177
|
+
| 429 | Rate limit | Retry tối đa 3 lần, exponential backoff |
|
|
178
|
+
| 529 | Service overloaded | Retry tối đa 3 lần, exponential backoff |
|
|
179
|
+
|
|
180
|
+
Rate limits hiện tại: 250,000 tokens/s · 1,200 requests/min.
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Giới hạn Jev
|
|
185
|
+
|
|
186
|
+
- Chỉ nhận text (string, JSON object, JSON array) — không hỗ trợ image/audio/video
|
|
187
|
+
- Context budget: ~64,000 tokens cho toàn bộ state + questions
|
|
188
|
+
- Choice tối đa 255 options; Score 2–10 levels
|
|
189
|
+
- Không thể dùng cho System 2 tasks (lập luận đa bước, sinh code, giải thích)
|
|
190
|
+
- Model hiện tại: `jev-1.13.0` / alias `jev-latest`
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MCP server for TypeSafe Jev — System One Model
|
|
4
|
+
*
|
|
5
|
+
* Tools:
|
|
6
|
+
* jev_decide — evaluate typed questions against a state using Jev
|
|
7
|
+
* jev_list_models — list available Jev model aliases
|
|
8
|
+
*
|
|
9
|
+
* Env:
|
|
10
|
+
* TYPESAFE_API_KEY (required)
|
|
11
|
+
* TYPESAFE_BASE_URL (optional, default: https://api.typesafe.ai)
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MCP server for TypeSafe Jev — System One Model
|
|
4
|
+
*
|
|
5
|
+
* Tools:
|
|
6
|
+
* jev_decide — evaluate typed questions against a state using Jev
|
|
7
|
+
* jev_list_models — list available Jev model aliases
|
|
8
|
+
*
|
|
9
|
+
* Env:
|
|
10
|
+
* TYPESAFE_API_KEY (required)
|
|
11
|
+
* TYPESAFE_BASE_URL (optional, default: https://api.typesafe.ai)
|
|
12
|
+
*/
|
|
13
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
14
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
// ─── Config ─────────────────────────────────────────────────────────────────
|
|
17
|
+
const API_KEY = process.env.TYPESAFE_API_KEY;
|
|
18
|
+
const BASE_URL = process.env.TYPESAFE_BASE_URL?.replace(/\/$/, "") ??
|
|
19
|
+
"https://api.typesafe.ai";
|
|
20
|
+
if (!API_KEY) {
|
|
21
|
+
process.stderr.write("[mcp-jev] FATAL: TYPESAFE_API_KEY environment variable is not set.\n");
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
// ─── Retry helper ───────────────────────────────────────────────────────────
|
|
25
|
+
/**
|
|
26
|
+
* Fetch with exponential back-off for 429 / 529.
|
|
27
|
+
* Max 3 attempts, starting at 1s, doubling each retry.
|
|
28
|
+
*/
|
|
29
|
+
async function fetchWithRetry(url, init, attempts = 3, delayMs = 1000) {
|
|
30
|
+
if (attempts < 1)
|
|
31
|
+
throw new Error("fetchWithRetry: attempts must be >= 1");
|
|
32
|
+
let lastError;
|
|
33
|
+
for (let attempt = 1; attempt <= attempts; attempt++) {
|
|
34
|
+
const resp = await fetch(url, init);
|
|
35
|
+
if (resp.status !== 429 && resp.status !== 529) {
|
|
36
|
+
return resp; // success or non-retryable error
|
|
37
|
+
}
|
|
38
|
+
// Respect Retry-After header if present (guard against NaN/negative)
|
|
39
|
+
const retryAfter = resp.headers.get("Retry-After");
|
|
40
|
+
const parsed = retryAfter ? parseInt(retryAfter, 10) : NaN;
|
|
41
|
+
const waitMs = !isNaN(parsed) && parsed > 0
|
|
42
|
+
? parsed * 1000
|
|
43
|
+
: delayMs * Math.pow(2, attempt - 1); // true exponential: 1s, 2s, 4s
|
|
44
|
+
// Read body for error context before discarding the response
|
|
45
|
+
const body = await resp.text().catch(() => "");
|
|
46
|
+
if (attempt < attempts) {
|
|
47
|
+
await new Promise((r) => setTimeout(r, waitMs));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
lastError = new Error(`HTTP ${resp.status} after ${attempts} attempts — rate limited or overloaded. Response: ${body}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
throw lastError ?? new Error("fetchWithRetry: unexpected loop exit");
|
|
54
|
+
}
|
|
55
|
+
// ─── Jev API helpers ────────────────────────────────────────────────────────
|
|
56
|
+
async function callSystemOne(body) {
|
|
57
|
+
const resp = await fetchWithRetry(`${BASE_URL}/v1/systemone`, {
|
|
58
|
+
method: "POST",
|
|
59
|
+
headers: {
|
|
60
|
+
Authorization: `Bearer ${API_KEY}`,
|
|
61
|
+
"Content-Type": "application/json",
|
|
62
|
+
},
|
|
63
|
+
body: JSON.stringify(body),
|
|
64
|
+
});
|
|
65
|
+
if (!resp.ok) {
|
|
66
|
+
const text = await resp.text().catch(() => "");
|
|
67
|
+
throw new Error(`Jev API error ${resp.status}: ${text}`);
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
return await resp.json();
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
throw new Error(`Failed to parse Jev API response as JSON: ${e instanceof Error ? e.message : String(e)}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async function listModels() {
|
|
77
|
+
const resp = await fetchWithRetry(`${BASE_URL}/v1/models`, {
|
|
78
|
+
method: "GET",
|
|
79
|
+
headers: { Authorization: `Bearer ${API_KEY}` },
|
|
80
|
+
});
|
|
81
|
+
if (!resp.ok) {
|
|
82
|
+
const text = await resp.text().catch(() => "");
|
|
83
|
+
throw new Error(`Jev API error ${resp.status}: ${text}`);
|
|
84
|
+
}
|
|
85
|
+
// Official docs: response has a "models" array (not "data")
|
|
86
|
+
// Each entry has: id, description, release_date (for aliases)
|
|
87
|
+
let raw;
|
|
88
|
+
try {
|
|
89
|
+
raw = await resp.json();
|
|
90
|
+
}
|
|
91
|
+
catch (e) {
|
|
92
|
+
throw new Error(`Failed to parse Jev models response as JSON: ${e instanceof Error ? e.message : String(e)}`);
|
|
93
|
+
}
|
|
94
|
+
const entries = raw.models ?? raw.data ?? [];
|
|
95
|
+
if (!Array.isArray(entries)) {
|
|
96
|
+
throw new Error("Unexpected Jev models response shape — expected array");
|
|
97
|
+
}
|
|
98
|
+
return entries.map((m) => ({
|
|
99
|
+
id: m.id,
|
|
100
|
+
...(m.description ? { description: m.description } : {}),
|
|
101
|
+
...(m.release_date ? { release_date: m.release_date } : {}),
|
|
102
|
+
...(m.aliases ? { aliases: m.aliases } : {}),
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
105
|
+
// ─── MCP server ─────────────────────────────────────────────────────────────
|
|
106
|
+
const server = new McpServer({
|
|
107
|
+
name: "mcp-jev",
|
|
108
|
+
version: "1.0.0",
|
|
109
|
+
});
|
|
110
|
+
// ── Tool 1: jev_decide ──────────────────────────────────────────────────────
|
|
111
|
+
/**
|
|
112
|
+
* QuestionSchema covers all three Jev primitives: noul, choice, score.
|
|
113
|
+
*
|
|
114
|
+
* Per official TypeSafe docs:
|
|
115
|
+
* - instructions: string | object | array
|
|
116
|
+
* - choice criteria values: string | object | array | null (max 255 options)
|
|
117
|
+
* - score criteria levels: string | object | array per level (2–10 levels)
|
|
118
|
+
* - noul criteria: string (optional clarification only)
|
|
119
|
+
*/
|
|
120
|
+
const InstructionsSchema = z
|
|
121
|
+
.union([z.string(), z.record(z.unknown()), z.array(z.unknown())])
|
|
122
|
+
.describe([
|
|
123
|
+
"What the model should decide. Can be:",
|
|
124
|
+
" - A plain string: \"Is `message` urgent?\"",
|
|
125
|
+
" - An object: split the question and supporting data into named fields",
|
|
126
|
+
" - An array: ordered list of instruction parts",
|
|
127
|
+
"Reference state fields with backtick paths, e.g. `message` or `order.id`.",
|
|
128
|
+
].join("\n"));
|
|
129
|
+
/** Value for a single Choice option or Score level — string, object, array, or null */
|
|
130
|
+
const CriteriaValueSchema = z
|
|
131
|
+
.union([z.string(), z.record(z.unknown()), z.array(z.unknown()), z.null()])
|
|
132
|
+
.describe("Description for this option/level. Use null for options that need no extra detail.");
|
|
133
|
+
const QuestionSchema = z.discriminatedUnion("type", [
|
|
134
|
+
z.object({
|
|
135
|
+
id: z
|
|
136
|
+
.string()
|
|
137
|
+
.min(1)
|
|
138
|
+
.describe("Unique key for this question. Used to look up the answer in the response."),
|
|
139
|
+
type: z.literal("noul").describe("True/false probability question."),
|
|
140
|
+
instructions: InstructionsSchema,
|
|
141
|
+
criteria: z
|
|
142
|
+
.string()
|
|
143
|
+
.optional()
|
|
144
|
+
.describe("Optional extra clarification string for the model."),
|
|
145
|
+
}),
|
|
146
|
+
z.object({
|
|
147
|
+
id: z
|
|
148
|
+
.string()
|
|
149
|
+
.min(1)
|
|
150
|
+
.describe("Unique key for this question. Used to look up the answer in the response."),
|
|
151
|
+
type: z.literal("choice").describe("Pick one from a named list of options."),
|
|
152
|
+
instructions: InstructionsSchema,
|
|
153
|
+
criteria: z
|
|
154
|
+
.record(CriteriaValueSchema)
|
|
155
|
+
.refine((obj) => Object.keys(obj).length <= 255, {
|
|
156
|
+
message: "Choice criteria cannot exceed 255 options",
|
|
157
|
+
})
|
|
158
|
+
.describe([
|
|
159
|
+
"Map of option key → description (max 255 options).",
|
|
160
|
+
"Each value can be: string, object (for multi-part guidance), array, or null.",
|
|
161
|
+
'Use null for options that need no extra detail, e.g. {"other": null}.',
|
|
162
|
+
].join("\n")),
|
|
163
|
+
}),
|
|
164
|
+
z.object({
|
|
165
|
+
id: z
|
|
166
|
+
.string()
|
|
167
|
+
.min(1)
|
|
168
|
+
.describe("Unique key for this question. Used to look up the answer in the response."),
|
|
169
|
+
type: z.literal("score").describe("Rate on an ordered scale of 2–10 levels."),
|
|
170
|
+
instructions: InstructionsSchema,
|
|
171
|
+
criteria: z
|
|
172
|
+
.array(CriteriaValueSchema)
|
|
173
|
+
.min(2)
|
|
174
|
+
.max(10)
|
|
175
|
+
.describe([
|
|
176
|
+
"Ordered list of level descriptions from lowest to highest (2–10 levels).",
|
|
177
|
+
"Each level can be: string, object (for multi-part guidance), or array.",
|
|
178
|
+
'e.g. ["calm", "frustrated", "very angry"] or [{label:"calm", examples:[...]}]',
|
|
179
|
+
].join("\n")),
|
|
180
|
+
}),
|
|
181
|
+
]);
|
|
182
|
+
server.tool("jev_decide", [
|
|
183
|
+
"Evaluate one or more typed questions against a state using TypeSafe Jev.",
|
|
184
|
+
"",
|
|
185
|
+
"All questions share the same state and are evaluated in parallel in a single API call.",
|
|
186
|
+
"Returns calibrated probabilities for each answer — not generated text.",
|
|
187
|
+
"",
|
|
188
|
+
"When to call:",
|
|
189
|
+
" - Classify or route text (intent, category, department)",
|
|
190
|
+
" - Check a true/false condition with calibrated confidence (is_urgent, is_spam)",
|
|
191
|
+
" - Rate content on a rubric (severity, quality, sentiment)",
|
|
192
|
+
" - Run multiple of the above on the same content in one call",
|
|
193
|
+
"",
|
|
194
|
+
"Question types:",
|
|
195
|
+
" - noul: yes/no probability (0–1). instructions = string|object|array.",
|
|
196
|
+
" - choice: pick one of N options. instructions + criteria values = string|object|array|null.",
|
|
197
|
+
" - score: rate on ordered rubric. instructions + each level = string|object|array.",
|
|
198
|
+
"",
|
|
199
|
+
"instructions can be a plain string, an object (split question + supporting data), or an array.",
|
|
200
|
+
"criteria values can be a string, an object (multi-part guidance), an array, or null.",
|
|
201
|
+
"",
|
|
202
|
+
"Tip: send only the state fields each question needs. Extra context degrades accuracy.",
|
|
203
|
+
].join("\n"), {
|
|
204
|
+
state: z
|
|
205
|
+
.union([
|
|
206
|
+
z.string(),
|
|
207
|
+
z.record(z.unknown()),
|
|
208
|
+
z.array(z.unknown()),
|
|
209
|
+
])
|
|
210
|
+
.describe([
|
|
211
|
+
"The content Jev evaluates. Can be:",
|
|
212
|
+
" - A plain string: \"My card was charged twice.\"",
|
|
213
|
+
" - An object with named fields: {\"message\": \"...\", \"order_id\": \"A-104\"}",
|
|
214
|
+
" - An array of records (for batches or conversation turns)",
|
|
215
|
+
"Include only what the questions need — extra content lowers accuracy.",
|
|
216
|
+
].join("\n")),
|
|
217
|
+
questions: z
|
|
218
|
+
.array(QuestionSchema)
|
|
219
|
+
.min(1)
|
|
220
|
+
.describe([
|
|
221
|
+
"List of questions to evaluate. Each has:",
|
|
222
|
+
" id — key used in the response answers map",
|
|
223
|
+
" type — \"noul\" | \"choice\" | \"score\"",
|
|
224
|
+
" instructions — full question text, may reference state fields in backticks",
|
|
225
|
+
" criteria — required for choice (object) and score (array); optional for noul",
|
|
226
|
+
].join("\n")),
|
|
227
|
+
model: z
|
|
228
|
+
.string()
|
|
229
|
+
.default("jev-latest")
|
|
230
|
+
.describe("Model alias or versioned ID. Use \"jev-latest\" for stable, \"jev-preview\" for cutting edge. Call jev_list_models to see available IDs."),
|
|
231
|
+
}, async ({ state, questions, model }) => {
|
|
232
|
+
// Build the questions object (Record<id, JevQuestion>) from the array
|
|
233
|
+
const questionsMap = {};
|
|
234
|
+
for (const q of questions) {
|
|
235
|
+
if (q.id in questionsMap) {
|
|
236
|
+
return {
|
|
237
|
+
content: [{ type: "text", text: `Error: duplicate question id '${q.id}' — each question must have a unique id` }],
|
|
238
|
+
isError: true,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
if (q.type === "noul") {
|
|
242
|
+
questionsMap[q.id] = {
|
|
243
|
+
type: "noul",
|
|
244
|
+
instructions: q.instructions,
|
|
245
|
+
...(q.criteria ? { criteria: q.criteria } : {}),
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
else if (q.type === "choice") {
|
|
249
|
+
questionsMap[q.id] = {
|
|
250
|
+
type: "choice",
|
|
251
|
+
instructions: q.instructions,
|
|
252
|
+
criteria: q.criteria,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
// score
|
|
257
|
+
questionsMap[q.id] = {
|
|
258
|
+
type: "score",
|
|
259
|
+
instructions: q.instructions,
|
|
260
|
+
criteria: q.criteria,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
try {
|
|
265
|
+
const result = await callSystemOne({
|
|
266
|
+
model,
|
|
267
|
+
state,
|
|
268
|
+
questions: questionsMap,
|
|
269
|
+
});
|
|
270
|
+
return {
|
|
271
|
+
content: [
|
|
272
|
+
{
|
|
273
|
+
type: "text",
|
|
274
|
+
text: JSON.stringify({
|
|
275
|
+
answers: result.answers,
|
|
276
|
+
model: result.model,
|
|
277
|
+
usage: result.usage,
|
|
278
|
+
}, null, 2),
|
|
279
|
+
},
|
|
280
|
+
],
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
catch (e) {
|
|
284
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
285
|
+
return {
|
|
286
|
+
content: [{ type: "text", text: `Error calling Jev API: ${message}` }],
|
|
287
|
+
isError: true,
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
// ── Tool 2: jev_list_models ─────────────────────────────────────────────────
|
|
292
|
+
server.tool("jev_list_models", [
|
|
293
|
+
"List the Jev model IDs and aliases available on this API key.",
|
|
294
|
+
"",
|
|
295
|
+
"When to call:",
|
|
296
|
+
" - Before pinning a versioned model ID (e.g. jev-1.13.0) in jev_decide",
|
|
297
|
+
" - To check whether jev-preview is available on this account",
|
|
298
|
+
" - To confirm which model version is currently behind jev-latest",
|
|
299
|
+
].join("\n"), {}, async () => {
|
|
300
|
+
try {
|
|
301
|
+
const models = await listModels();
|
|
302
|
+
return {
|
|
303
|
+
content: [
|
|
304
|
+
{
|
|
305
|
+
type: "text",
|
|
306
|
+
text: JSON.stringify(models, null, 2),
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
catch (e) {
|
|
312
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
313
|
+
return {
|
|
314
|
+
content: [{ type: "text", text: `Error fetching models: ${message}` }],
|
|
315
|
+
isError: true,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
// ─── Start ───────────────────────────────────────────────────────────────────
|
|
320
|
+
const transport = new StdioServerTransport();
|
|
321
|
+
await server.connect(transport);
|
|
322
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+EAA+E;AAE/E,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;AAC7C,MAAM,QAAQ,GACZ,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;IACjD,yBAAyB,CAAC;AAE5B,IAAI,CAAC,OAAO,EAAE,CAAC;IACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,sEAAsE,CACvE,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AA6DD,+EAA+E;AAE/E;;;GAGG;AACH,KAAK,UAAU,cAAc,CAC3B,GAAW,EACX,IAAiB,EACjB,QAAQ,GAAG,CAAC,EACZ,OAAO,GAAG,IAAI;IAEd,IAAI,QAAQ,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3E,IAAI,SAA4B,CAAC;IAEjC,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC;QACrD,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAEpC,IAAI,IAAI,CAAC,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC/C,OAAO,IAAI,CAAC,CAAC,iCAAiC;QAChD,CAAC;QAED,qEAAqE;Q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,CAAC,IAAI,CAAC,EACZ,EAAE,EACF,KAAK,IAAI,EAAE;IACT,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,EAAE,CAAC;QAClC,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;iBACtC;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,OAAO,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC3D,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,OAAO,EAAE,EAAE,CAAC;YACtE,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,gFAAgF;AAEhF,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mcp-jev",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for TypeSafe Jev — System One Model. Two tools: jev_decide (noul/choice/score) and jev_list_models.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"mcp-jev": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsx src/index.ts",
|
|
13
|
+
"typecheck": "tsc --noEmit",
|
|
14
|
+
"start": "node dist/index.js",
|
|
15
|
+
"prepare": "tsc"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"keywords": [
|
|
22
|
+
"mcp",
|
|
23
|
+
"model-context-protocol",
|
|
24
|
+
"typesafe",
|
|
25
|
+
"jev",
|
|
26
|
+
"system-one",
|
|
27
|
+
"ai",
|
|
28
|
+
"decision-model",
|
|
29
|
+
"classification",
|
|
30
|
+
"routing"
|
|
31
|
+
],
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/your-username/mcp-jev"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/your-username/mcp-jev#readme",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@modelcontextprotocol/sdk": "^1.16.0",
|
|
40
|
+
"zod": "^3.23.8"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^22.9.0",
|
|
44
|
+
"tsx": "^4.19.0",
|
|
45
|
+
"typescript": "^5.6.3"
|
|
46
|
+
},
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=20"
|
|
49
|
+
}
|
|
50
|
+
}
|