@tokensize/mcp 0.3.0-beta.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 TokenSize
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.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # `@tokensize/mcp`
2
+
3
+ Stdio MCP server used by the TokenSize Codex plugin. It exposes `tokensize_status`, `tokensize_connect`, `tokensize_route`, `tokensize_execute`, and `tokensize_feedback` over the standard MCP JSON-RPC transport and delegates all behavior to `@tokensize/agent-client`.
4
+
5
+ The package never receives provider credentials. It reads the owner-only TokenSize credential store locally and sends metadata-only routing requests unless the user explicitly asks to share a prompt.
@@ -0,0 +1,243 @@
1
+ type JsonRpcRequest = {
2
+ jsonrpc?: string;
3
+ id?: string | number | null;
4
+ method?: string;
5
+ params?: Record<string, unknown>;
6
+ };
7
+ type JsonRpcResponse = {
8
+ jsonrpc: "2.0";
9
+ id: string | number | null;
10
+ result?: unknown;
11
+ error?: {
12
+ code: number;
13
+ message: string;
14
+ data?: unknown;
15
+ };
16
+ };
17
+ declare const tools: ({
18
+ name: string;
19
+ description: string;
20
+ inputSchema: {
21
+ type: string;
22
+ properties: {
23
+ refresh: {
24
+ type: string;
25
+ };
26
+ verbose: {
27
+ type: string;
28
+ };
29
+ task?: undefined;
30
+ role?: undefined;
31
+ permission?: undefined;
32
+ objective?: undefined;
33
+ sharePrompt?: undefined;
34
+ receiptId?: undefined;
35
+ rating?: undefined;
36
+ modelChoice?: undefined;
37
+ wouldUseAgain?: undefined;
38
+ runId?: undefined;
39
+ limit?: undefined;
40
+ };
41
+ additionalProperties: boolean;
42
+ required?: undefined;
43
+ };
44
+ annotations: {
45
+ readOnlyHint: boolean;
46
+ destructiveHint: boolean;
47
+ openWorldHint: boolean;
48
+ };
49
+ } | {
50
+ name: string;
51
+ description: string;
52
+ inputSchema: {
53
+ type: string;
54
+ properties: {
55
+ refresh?: undefined;
56
+ verbose?: undefined;
57
+ task?: undefined;
58
+ role?: undefined;
59
+ permission?: undefined;
60
+ objective?: undefined;
61
+ sharePrompt?: undefined;
62
+ receiptId?: undefined;
63
+ rating?: undefined;
64
+ modelChoice?: undefined;
65
+ wouldUseAgain?: undefined;
66
+ runId?: undefined;
67
+ limit?: undefined;
68
+ };
69
+ additionalProperties: boolean;
70
+ required?: undefined;
71
+ };
72
+ annotations: {
73
+ readOnlyHint: boolean;
74
+ destructiveHint: boolean;
75
+ openWorldHint: boolean;
76
+ };
77
+ } | {
78
+ name: string;
79
+ description: string;
80
+ inputSchema: {
81
+ type: string;
82
+ required: string[];
83
+ properties: {
84
+ task: {
85
+ type: string;
86
+ minLength: number;
87
+ maxLength: number;
88
+ };
89
+ role: {
90
+ type: string;
91
+ enum: string[];
92
+ };
93
+ permission: {
94
+ type: string;
95
+ enum: string[];
96
+ };
97
+ objective: {
98
+ type: string;
99
+ enum: string[];
100
+ };
101
+ sharePrompt: {
102
+ type: string;
103
+ };
104
+ refresh: {
105
+ type: string;
106
+ };
107
+ verbose?: undefined;
108
+ receiptId?: undefined;
109
+ rating?: undefined;
110
+ modelChoice?: undefined;
111
+ wouldUseAgain?: undefined;
112
+ runId?: undefined;
113
+ limit?: undefined;
114
+ };
115
+ additionalProperties: boolean;
116
+ };
117
+ annotations: {
118
+ readOnlyHint: boolean;
119
+ destructiveHint: boolean;
120
+ openWorldHint: boolean;
121
+ };
122
+ } | {
123
+ name: string;
124
+ description: string;
125
+ inputSchema: {
126
+ type: string;
127
+ required: string[];
128
+ properties: {
129
+ receiptId: {
130
+ type: string;
131
+ minLength: number;
132
+ maxLength: number;
133
+ };
134
+ task: {
135
+ type: string;
136
+ minLength: number;
137
+ maxLength: number;
138
+ };
139
+ refresh?: undefined;
140
+ verbose?: undefined;
141
+ role?: undefined;
142
+ permission?: undefined;
143
+ objective?: undefined;
144
+ sharePrompt?: undefined;
145
+ rating?: undefined;
146
+ modelChoice?: undefined;
147
+ wouldUseAgain?: undefined;
148
+ runId?: undefined;
149
+ limit?: undefined;
150
+ };
151
+ additionalProperties: boolean;
152
+ };
153
+ annotations: {
154
+ readOnlyHint: boolean;
155
+ destructiveHint: boolean;
156
+ openWorldHint: boolean;
157
+ };
158
+ } | {
159
+ name: string;
160
+ description: string;
161
+ inputSchema: {
162
+ type: string;
163
+ required: string[];
164
+ properties: {
165
+ receiptId: {
166
+ type: string;
167
+ minLength: number;
168
+ maxLength: number;
169
+ };
170
+ rating: {
171
+ type: string;
172
+ minimum: number;
173
+ maximum: number;
174
+ };
175
+ modelChoice: {
176
+ type: string;
177
+ enum: string[];
178
+ };
179
+ wouldUseAgain: {
180
+ type: string;
181
+ };
182
+ task: {
183
+ type: string;
184
+ maxLength: number;
185
+ minLength?: undefined;
186
+ };
187
+ refresh?: undefined;
188
+ verbose?: undefined;
189
+ role?: undefined;
190
+ permission?: undefined;
191
+ objective?: undefined;
192
+ sharePrompt?: undefined;
193
+ runId?: undefined;
194
+ limit?: undefined;
195
+ };
196
+ additionalProperties: boolean;
197
+ };
198
+ annotations: {
199
+ readOnlyHint: boolean;
200
+ destructiveHint: boolean;
201
+ openWorldHint: boolean;
202
+ };
203
+ } | {
204
+ name: string;
205
+ description: string;
206
+ inputSchema: {
207
+ type: string;
208
+ properties: {
209
+ runId: {
210
+ type: string;
211
+ minLength: number;
212
+ maxLength: number;
213
+ };
214
+ limit: {
215
+ type: string;
216
+ minimum: number;
217
+ maximum: number;
218
+ };
219
+ refresh?: undefined;
220
+ verbose?: undefined;
221
+ task?: undefined;
222
+ role?: undefined;
223
+ permission?: undefined;
224
+ objective?: undefined;
225
+ sharePrompt?: undefined;
226
+ receiptId?: undefined;
227
+ rating?: undefined;
228
+ modelChoice?: undefined;
229
+ wouldUseAgain?: undefined;
230
+ };
231
+ additionalProperties: boolean;
232
+ required?: undefined;
233
+ };
234
+ annotations: {
235
+ readOnlyHint: boolean;
236
+ destructiveHint: boolean;
237
+ openWorldHint: boolean;
238
+ };
239
+ })[];
240
+ declare function callTool(name: string, args: Record<string, unknown>): Promise<unknown>;
241
+ declare function handleRequest(request: JsonRpcRequest): Promise<JsonRpcResponse | null>;
242
+
243
+ export { type JsonRpcRequest, type JsonRpcResponse, callTool, handleRequest, tools };
package/dist/index.js ADDED
@@ -0,0 +1,85 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/index.ts
4
+ import readline from "readline";
5
+ import { pathToFileURL } from "url";
6
+ import { TokenSizeClient } from "@tokensize/agent-client";
7
+ var client = new TokenSizeClient({ clientSurface: "codex-plugin", rootHarness: "codex", rootActive: true });
8
+ var tools = [
9
+ { name: "tokensize_status", description: "Inspect locally discovered coding harnesses, models, normalized allowances, and cache freshness.", inputSchema: { type: "object", properties: { refresh: { type: "boolean" }, verbose: { type: "boolean" } }, additionalProperties: false }, annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false } },
10
+ { name: "tokensize_connect", description: "Open the TokenSize browser authorization flow and save the approved credential locally.", inputSchema: { type: "object", properties: {}, additionalProperties: false }, annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true } },
11
+ { name: "tokensize_route", description: "Preview a privacy-safe TokenSize route. Prompts are not shared by default.", inputSchema: { type: "object", required: ["task"], properties: { task: { type: "string", minLength: 1, maxLength: 12e3 }, role: { type: "string", enum: ["inspect", "plan", "implement", "review", "test"] }, permission: { type: "string", enum: ["inspect", "edit", "test", "network"] }, objective: { type: "string", enum: ["quality", "balanced", "tokens", "latency"] }, sharePrompt: { type: "boolean" }, refresh: { type: "boolean" } }, additionalProperties: false }, annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true } },
12
+ { name: "tokensize_execute", description: "Execute an approved local route receipt for the exact task it was created for.", inputSchema: { type: "object", required: ["receiptId", "task"], properties: { receiptId: { type: "string", minLength: 36, maxLength: 36 }, task: { type: "string", minLength: 1, maxLength: 12e3 } }, additionalProperties: false }, annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true } },
13
+ { name: "tokensize_feedback", description: "Send content-free feedback for a recent TokenSize route receipt.", inputSchema: { type: "object", required: ["receiptId", "rating", "modelChoice", "wouldUseAgain"], properties: { receiptId: { type: "string", minLength: 36, maxLength: 36 }, rating: { type: "integer", minimum: 1, maximum: 5 }, modelChoice: { type: "string", enum: ["right", "acceptable", "wrong"] }, wouldUseAgain: { type: "boolean" }, task: { type: "string", maxLength: 12e3 } }, additionalProperties: false }, annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true } },
14
+ { name: "tokensize_run_status", description: "Read the Run document for a delegation \u2014 its live status, event timeline, approvals, and dashboard URL \u2014 or list recent runs. Report the runId and dashboard link instead of pasting route JSON into chat.", inputSchema: { type: "object", properties: { runId: { type: "string", minLength: 36, maxLength: 36 }, limit: { type: "integer", minimum: 1, maximum: 100 } }, additionalProperties: false }, annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true } }
15
+ ];
16
+ function dashboardUrl(runId) {
17
+ return `https://tokensize.dev/runs/${runId}`;
18
+ }
19
+ function response(id, result) {
20
+ return { jsonrpc: "2.0", id, result };
21
+ }
22
+ function error(id, code, message) {
23
+ return { jsonrpc: "2.0", id, error: { code, message } };
24
+ }
25
+ function write(value) {
26
+ process.stdout.write(`${JSON.stringify(value)}
27
+ `);
28
+ }
29
+ function textResult(value) {
30
+ return { content: [{ type: "text", text: JSON.stringify(value, null, 2) }], structuredContent: value };
31
+ }
32
+ async function callTool(name, args) {
33
+ if (name === "tokensize_status") return textResult(await client.status({ refresh: args.refresh === true, verbose: args.verbose === true }));
34
+ if (name === "tokensize_connect") {
35
+ await client.connect("codex-plugin");
36
+ return textResult({ connected: true, message: "TokenSize connected. Credentials remain local." });
37
+ }
38
+ if (name === "tokensize_route") return textResult(await client.route({ task: String(args.task ?? ""), role: args.role, permission: args.permission, objective: args.objective, sharePrompt: args.sharePrompt === true, refresh: args.refresh === true }));
39
+ if (name === "tokensize_execute") return textResult(await client.execute({ receiptId: String(args.receiptId ?? ""), task: String(args.task ?? "") }));
40
+ if (name === "tokensize_feedback") return textResult(await client.feedback({ receiptId: String(args.receiptId ?? ""), rating: Number(args.rating), modelChoice: args.modelChoice, wouldUseAgain: args.wouldUseAgain === true, task: typeof args.task === "string" ? args.task : void 0 }));
41
+ if (name === "tokensize_run_status") {
42
+ if (typeof args.runId === "string") {
43
+ const document = await client.runDocument(args.runId);
44
+ return textResult({ ...document, dashboard: dashboardUrl(args.runId) });
45
+ }
46
+ return textResult(await client.runs({ limit: typeof args.limit === "number" ? args.limit : void 0 }));
47
+ }
48
+ throw new Error(`unknown tool: ${name}`);
49
+ }
50
+ async function handleRequest(request) {
51
+ const id = request.id ?? null;
52
+ if (request.method === "notifications/initialized" || request.method === "notifications/cancelled") return null;
53
+ if (request.method === "initialize") return response(id, { protocolVersion: "2025-06-18", capabilities: { tools: { listChanged: false } }, serverInfo: { name: "tokensize", version: "0.3.0-beta.0" } });
54
+ if (request.method === "tools/list") return response(id, { tools });
55
+ if (request.method === "tools/call") {
56
+ const name = String(request.params?.name ?? "");
57
+ try {
58
+ return response(id, await callTool(name, request.params?.arguments ?? {}));
59
+ } catch (cause) {
60
+ return error(id, -32e3, cause instanceof Error ? cause.message : String(cause));
61
+ }
62
+ }
63
+ return error(id, -32601, `Method not found: ${request.method ?? ""}`);
64
+ }
65
+ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
66
+ const input = readline.createInterface({ input: process.stdin, crlfDelay: Infinity });
67
+ input.on("line", (line) => {
68
+ let request;
69
+ try {
70
+ request = JSON.parse(line);
71
+ } catch {
72
+ write(error(null, -32700, "Invalid JSON"));
73
+ return;
74
+ }
75
+ void handleRequest(request).then((result) => {
76
+ if (result) write(result);
77
+ });
78
+ });
79
+ }
80
+ export {
81
+ callTool,
82
+ handleRequest,
83
+ tools
84
+ };
85
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import readline from \"node:readline\";\nimport { pathToFileURL } from \"node:url\";\nimport { TokenSizeClient } from \"@tokensize/agent-client\";\n\nexport type JsonRpcRequest = { jsonrpc?: string; id?: string | number | null; method?: string; params?: Record<string, unknown> };\nexport type JsonRpcResponse = { jsonrpc: \"2.0\"; id: string | number | null; result?: unknown; error?: { code: number; message: string; data?: unknown } };\n\nconst client = new TokenSizeClient({ clientSurface: \"codex-plugin\", rootHarness: \"codex\", rootActive: true });\n\nexport const tools = [\n\t{ name: \"tokensize_status\", description: \"Inspect locally discovered coding harnesses, models, normalized allowances, and cache freshness.\", inputSchema: { type: \"object\", properties: { refresh: { type: \"boolean\" }, verbose: { type: \"boolean\" } }, additionalProperties: false }, annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false } },\n\t{ name: \"tokensize_connect\", description: \"Open the TokenSize browser authorization flow and save the approved credential locally.\", inputSchema: { type: \"object\", properties: {}, additionalProperties: false }, annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true } },\n\t{ name: \"tokensize_route\", description: \"Preview a privacy-safe TokenSize route. Prompts are not shared by default.\", inputSchema: { type: \"object\", required: [\"task\"], properties: { task: { type: \"string\", minLength: 1, maxLength: 12000 }, role: { type: \"string\", enum: [\"inspect\", \"plan\", \"implement\", \"review\", \"test\"] }, permission: { type: \"string\", enum: [\"inspect\", \"edit\", \"test\", \"network\"] }, objective: { type: \"string\", enum: [\"quality\", \"balanced\", \"tokens\", \"latency\"] }, sharePrompt: { type: \"boolean\" }, refresh: { type: \"boolean\" } }, additionalProperties: false }, annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true } },\n\t{ name: \"tokensize_execute\", description: \"Execute an approved local route receipt for the exact task it was created for.\", inputSchema: { type: \"object\", required: [\"receiptId\", \"task\"], properties: { receiptId: { type: \"string\", minLength: 36, maxLength: 36 }, task: { type: \"string\", minLength: 1, maxLength: 12000 } }, additionalProperties: false }, annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true } },\n\t{ name: \"tokensize_feedback\", description: \"Send content-free feedback for a recent TokenSize route receipt.\", inputSchema: { type: \"object\", required: [\"receiptId\", \"rating\", \"modelChoice\", \"wouldUseAgain\"], properties: { receiptId: { type: \"string\", minLength: 36, maxLength: 36 }, rating: { type: \"integer\", minimum: 1, maximum: 5 }, modelChoice: { type: \"string\", enum: [\"right\", \"acceptable\", \"wrong\"] }, wouldUseAgain: { type: \"boolean\" }, task: { type: \"string\", maxLength: 12000 } }, additionalProperties: false }, annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true } },\n\t{ name: \"tokensize_run_status\", description: \"Read the Run document for a delegation — its live status, event timeline, approvals, and dashboard URL — or list recent runs. Report the runId and dashboard link instead of pasting route JSON into chat.\", inputSchema: { type: \"object\", properties: { runId: { type: \"string\", minLength: 36, maxLength: 36 }, limit: { type: \"integer\", minimum: 1, maximum: 100 } }, additionalProperties: false }, annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: true } },\n];\n\nfunction dashboardUrl(runId: string): string { return `https://tokensize.dev/runs/${runId}`; }\n\nfunction response(id: JsonRpcResponse[\"id\"], result: unknown): JsonRpcResponse { return { jsonrpc: \"2.0\", id, result }; }\nfunction error(id: JsonRpcResponse[\"id\"], code: number, message: string): JsonRpcResponse { return { jsonrpc: \"2.0\", id, error: { code, message } }; }\nfunction write(value: JsonRpcResponse): void { process.stdout.write(`${JSON.stringify(value)}\\n`); }\nfunction textResult(value: unknown): unknown { return { content: [{ type: \"text\", text: JSON.stringify(value, null, 2) }], structuredContent: value }; }\n\nexport async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {\n\tif (name === \"tokensize_status\") return textResult(await client.status({ refresh: args.refresh === true, verbose: args.verbose === true }));\n\tif (name === \"tokensize_connect\") { await client.connect(\"codex-plugin\"); return textResult({ connected: true, message: \"TokenSize connected. Credentials remain local.\" }); }\n\tif (name === \"tokensize_route\") return textResult(await client.route({ task: String(args.task ?? \"\"), role: args.role as never, permission: args.permission as never, objective: args.objective as never, sharePrompt: args.sharePrompt === true, refresh: args.refresh === true }));\n\tif (name === \"tokensize_execute\") return textResult(await client.execute({ receiptId: String(args.receiptId ?? \"\"), task: String(args.task ?? \"\") }));\n\tif (name === \"tokensize_feedback\") return textResult(await client.feedback({ receiptId: String(args.receiptId ?? \"\"), rating: Number(args.rating) as 1 | 2 | 3 | 4 | 5, modelChoice: args.modelChoice as \"right\" | \"acceptable\" | \"wrong\", wouldUseAgain: args.wouldUseAgain === true, task: typeof args.task === \"string\" ? args.task : undefined }));\n\tif (name === \"tokensize_run_status\") {\n\t\tif (typeof args.runId === \"string\") {\n\t\t\tconst document = await client.runDocument(args.runId);\n\t\t\treturn textResult({ ...document, dashboard: dashboardUrl(args.runId) });\n\t\t}\n\t\treturn textResult(await client.runs({ limit: typeof args.limit === \"number\" ? args.limit : undefined }));\n\t}\n\tthrow new Error(`unknown tool: ${name}`);\n}\n\nexport async function handleRequest(request: JsonRpcRequest): Promise<JsonRpcResponse | null> {\n\tconst id = request.id ?? null;\n\tif (request.method === \"notifications/initialized\" || request.method === \"notifications/cancelled\") return null;\n\tif (request.method === \"initialize\") return response(id, { protocolVersion: \"2025-06-18\", capabilities: { tools: { listChanged: false } }, serverInfo: { name: \"tokensize\", version: \"0.3.0-beta.0\" } });\n\tif (request.method === \"tools/list\") return response(id, { tools });\n\tif (request.method === \"tools/call\") {\n\t\tconst name = String(request.params?.name ?? \"\");\n\t\ttry { return response(id, await callTool(name, (request.params?.arguments ?? {}) as Record<string, unknown>)); }\n\t\tcatch (cause) { return error(id, -32000, cause instanceof Error ? cause.message : String(cause)); }\n\t}\n\treturn error(id, -32601, `Method not found: ${request.method ?? \"\"}`);\n}\n\nif (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {\n\tconst input = readline.createInterface({ input: process.stdin, crlfDelay: Infinity });\n\tinput.on(\"line\", (line) => {\n\t\tlet request: JsonRpcRequest;\n\t\ttry { request = JSON.parse(line) as JsonRpcRequest; }\n\t\tcatch { write(error(null, -32700, \"Invalid JSON\")); return; }\n\t\tvoid handleRequest(request).then((result) => { if (result) write(result); });\n\t});\n}\n"],"mappings":";;;AAAA,OAAO,cAAc;AACrB,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAKhC,IAAM,SAAS,IAAI,gBAAgB,EAAE,eAAe,gBAAgB,aAAa,SAAS,YAAY,KAAK,CAAC;AAErG,IAAM,QAAQ;AAAA,EACpB,EAAE,MAAM,oBAAoB,aAAa,oGAAoG,aAAa,EAAE,MAAM,UAAU,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,GAAG,SAAS,EAAE,MAAM,UAAU,EAAE,GAAG,sBAAsB,MAAM,GAAG,aAAa,EAAE,cAAc,MAAM,iBAAiB,OAAO,eAAe,MAAM,EAAE;AAAA,EACzW,EAAE,MAAM,qBAAqB,aAAa,2FAA2F,aAAa,EAAE,MAAM,UAAU,YAAY,CAAC,GAAG,sBAAsB,MAAM,GAAG,aAAa,EAAE,cAAc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AAS,IAAI,EAAE,MAAM,CAAC;AAClE,MAAI,QAAQ,WAAW,cAAc;AACpC,UAAM,OAAO,OAAO,QAAQ,QAAQ,QAAQ,EAAE;AAC9C,QAAI;AAAE,aAAO,SAAS,IAAI,MAAM,SAAS,MAAO,QAAQ,QAAQ,aAAa,CAAC,CAA6B,CAAC;AAAA,IAAG,SACxG,OAAO;AAAE,aAAO,MAAM,IAAI,OAAQ,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC;AAAA,IAAG;AAAA,EACnG;AACA,SAAO,MAAM,IAAI,QAAQ,qBAAqB,QAAQ,UAAU,EAAE,EAAE;AACrE;AAEA,IAAI,QAAQ,KAAK,CAAC,KAAK,YAAY,QAAQ,cAAc,QAAQ,KAAK,CAAC,CAAC,EAAE,MAAM;AAC/E,QAAM,QAAQ,SAAS,gBAAgB,EAAE,OAAO,QAAQ,OAAO,WAAW,SAAS,CAAC;AACpF,QAAM,GAAG,QAAQ,CAAC,SAAS;AAC1B,QAAI;AACJ,QAAI;AAAE,gBAAU,KAAK,MAAM,IAAI;AAAA,IAAqB,QAC9C;AAAE,YAAM,MAAM,MAAM,QAAQ,cAAc,CAAC;AAAG;AAAA,IAAQ;AAC5D,SAAK,cAAc,OAAO,EAAE,KAAK,CAAC,WAAW;AAAE,UAAI,OAAQ,OAAM,MAAM;AAAA,IAAG,CAAC;AAAA,EAC5E,CAAC;AACF;","names":[]}
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@tokensize/mcp",
3
+ "version": "0.3.0-beta.0",
4
+ "description": "TokenSize MCP server for Codex and other local agent hosts",
5
+ "type": "module",
6
+ "bin": { "tokensize-mcp": "dist/index.js" },
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } },
10
+ "files": ["dist", "README.md", "LICENSE"],
11
+ "repository": { "type": "git", "url": "git+https://github.com/tokensize/tokensize.git", "directory": "packages/mcp" },
12
+ "homepage": "https://tokensize.dev",
13
+ "publishConfig": { "access": "public", "provenance": true, "tag": "beta" },
14
+ "engines": { "node": ">=20" },
15
+ "scripts": { "prebuild": "npm --prefix ../.. run build --workspace @tokensize/agent-client", "build": "tsup", "typecheck": "tsc --noEmit", "test": "vitest run", "prepack": "npm run build", "prepublishOnly": "npm run typecheck && npm test" },
16
+ "dependencies": { "@tokensize/agent-client": "0.3.0-beta.0" },
17
+ "devDependencies": { "@types/node": "^26.1.1", "tsup": "^8.5.0", "typescript": "^5.5.2", "vitest": "^4.1.10" },
18
+ "license": "MIT"
19
+ }