tokrepo-mcp-server 2.3.0 → 2.5.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 +7 -11
- package/bin/server.js +82 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,29 +35,26 @@ gemini settings mcp add tokrepo -- npx -y tokrepo-mcp-server
|
|
|
35
35
|
|
|
36
36
|
Once connected, your AI assistant can:
|
|
37
37
|
|
|
38
|
-
- **Search** 200+ curated AI assets by keyword or category
|
|
38
|
+
- **Search** 200+ curated AI assets by keyword or category with Codex-first `agent_fit` ranking
|
|
39
39
|
- **Browse** trending assets, filter by type (MCP, Skill, Prompt, Agent, Script)
|
|
40
40
|
- **Get details** — full documentation, install instructions, and metadata
|
|
41
41
|
- **Plan before install** — get install plan v2 with policy decisions, rollback, and verification
|
|
42
42
|
- **Safe Codex install** — dry-run by default; risky assets must be staged or explicitly approved
|
|
43
|
-
- **Lifecycle control** — list
|
|
44
|
-
- **Agent eval** — run TokRepo's agent-native search/plan/install/rollback contract checks
|
|
43
|
+
- **Lifecycle control** — list, update, uninstall, and roll back managed Codex installs
|
|
45
44
|
|
|
46
45
|
## Available Tools
|
|
47
46
|
|
|
48
47
|
| Tool | Description |
|
|
49
48
|
|------|-------------|
|
|
50
|
-
| `tokrepo_search` | Search assets by keyword
|
|
49
|
+
| `tokrepo_search` | Search assets by keyword/tag with `agent_fit` ranking |
|
|
51
50
|
| `tokrepo_detail` | Get full asset details by UUID |
|
|
52
51
|
| `tokrepo_install_plan` | Get agent-native install plan v2 |
|
|
53
52
|
| `tokrepo_codex_install` | Dry-run, stage, or install a Codex skill safely |
|
|
54
|
-
| `tokrepo_clone_plan` | Bulk profile clone dry-run plan |
|
|
55
53
|
| `tokrepo_installed` | List TokRepo-managed Codex installs |
|
|
54
|
+
| `tokrepo_update` | Dry-run or update managed Codex installs |
|
|
56
55
|
| `tokrepo_uninstall` | Dry-run or remove a managed Codex install |
|
|
57
56
|
| `tokrepo_rollback` | Dry-run or roll back a prior Codex install session |
|
|
58
|
-
| `
|
|
59
|
-
| `tokrepo_install` | Get raw installable content |
|
|
60
|
-
| `tokrepo_trending` | Browse popular/latest assets |
|
|
57
|
+
| `tokrepo_push` | Push one explicit asset to TokRepo after user confirmation |
|
|
61
58
|
|
|
62
59
|
## Example Conversations
|
|
63
60
|
|
|
@@ -65,14 +62,13 @@ Once connected, your AI assistant can:
|
|
|
65
62
|
You: "Find me a good MCP server for databases"
|
|
66
63
|
AI: [calls tokrepo_search] → Shows DBHub, Supabase MCP, PostgreSQL MCP with install commands
|
|
67
64
|
|
|
68
|
-
You: "What
|
|
69
|
-
AI: [calls
|
|
65
|
+
You: "What video assets should I install?"
|
|
66
|
+
AI: [calls tokrepo_search] → Ranks native Codex assets by `agent_fit`
|
|
70
67
|
|
|
71
68
|
You: "Install that cursor rules asset"
|
|
72
69
|
AI: [calls tokrepo_install_plan] → Reviews policy and actions
|
|
73
70
|
AI: [calls tokrepo_codex_install with dry_run=false, confirm=true] → Writes only after explicit confirmation
|
|
74
71
|
AI: [calls tokrepo_rollback with dry_run=true] → Shows exactly what would be removed before rollback
|
|
75
|
-
AI: [calls tokrepo_eval_agent] → Verifies TokRepo's agent-facing flow end to end
|
|
76
72
|
```
|
|
77
73
|
|
|
78
74
|
## Why TokRepo?
|
package/bin/server.js
CHANGED
|
@@ -19,7 +19,7 @@ const API_BASE = process.env.TOKREPO_API || 'https://api.tokrepo.com';
|
|
|
19
19
|
const TOKREPO_URL = 'https://tokrepo.com';
|
|
20
20
|
const TOKREPO_TOKEN = process.env.TOKREPO_TOKEN || '';
|
|
21
21
|
const TOKREPO_CLI = process.env.TOKREPO_CLI || '';
|
|
22
|
-
const SERVER_VERSION = '2.
|
|
22
|
+
const SERVER_VERSION = '2.5.0';
|
|
23
23
|
|
|
24
24
|
// ─── MCP Protocol (JSON-RPC over stdio) ───
|
|
25
25
|
|
|
@@ -55,8 +55,9 @@ const TOOLS = [
|
|
|
55
55
|
},
|
|
56
56
|
target: {
|
|
57
57
|
type: 'string',
|
|
58
|
-
description: '
|
|
58
|
+
description: 'Agent target filter. Defaults to codex so results include agent_fit ranking for installable Codex assets.',
|
|
59
59
|
enum: ['codex'],
|
|
60
|
+
default: 'codex',
|
|
60
61
|
},
|
|
61
62
|
kind: {
|
|
62
63
|
type: 'string',
|
|
@@ -183,6 +184,35 @@ const TOOLS = [
|
|
|
183
184
|
properties: {},
|
|
184
185
|
},
|
|
185
186
|
},
|
|
187
|
+
{
|
|
188
|
+
name: 'tokrepo_update',
|
|
189
|
+
description: 'Check or update TokRepo-managed Codex assets from the local manifest. Defaults to dry_run=true. To write updates, set dry_run=false and confirm=true.',
|
|
190
|
+
inputSchema: {
|
|
191
|
+
type: 'object',
|
|
192
|
+
properties: {
|
|
193
|
+
dry_run: {
|
|
194
|
+
type: 'boolean',
|
|
195
|
+
description: 'When true, check for updates and return the plan without writing files. Default true.',
|
|
196
|
+
default: true,
|
|
197
|
+
},
|
|
198
|
+
confirm: {
|
|
199
|
+
type: 'boolean',
|
|
200
|
+
description: 'Required when dry_run=false to prevent accidental writes.',
|
|
201
|
+
default: false,
|
|
202
|
+
},
|
|
203
|
+
stage: {
|
|
204
|
+
type: 'boolean',
|
|
205
|
+
description: 'Stage risky updates under ~/.codex/tokrepo/staged instead of activating them.',
|
|
206
|
+
default: false,
|
|
207
|
+
},
|
|
208
|
+
approve_risk: {
|
|
209
|
+
type: 'boolean',
|
|
210
|
+
description: 'Allow updates whose install policy requires explicit risk approval.',
|
|
211
|
+
default: false,
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
},
|
|
186
216
|
{
|
|
187
217
|
name: 'tokrepo_uninstall',
|
|
188
218
|
description: 'Safely uninstall a TokRepo-managed Codex asset. Defaults to dry_run=true. To remove files, set dry_run=false and confirm=true. Local changes are blocked unless force=true.',
|
|
@@ -366,6 +396,20 @@ const TOOLS = [
|
|
|
366
396
|
},
|
|
367
397
|
];
|
|
368
398
|
|
|
399
|
+
const EXPOSED_TOOL_NAMES = new Set([
|
|
400
|
+
'tokrepo_search',
|
|
401
|
+
'tokrepo_detail',
|
|
402
|
+
'tokrepo_install_plan',
|
|
403
|
+
'tokrepo_codex_install',
|
|
404
|
+
'tokrepo_installed',
|
|
405
|
+
'tokrepo_update',
|
|
406
|
+
'tokrepo_uninstall',
|
|
407
|
+
'tokrepo_rollback',
|
|
408
|
+
'tokrepo_push',
|
|
409
|
+
]);
|
|
410
|
+
|
|
411
|
+
const EXPOSED_TOOLS = TOOLS.filter((tool) => EXPOSED_TOOL_NAMES.has(tool.name));
|
|
412
|
+
|
|
369
413
|
// ─── HTTP Helper ───
|
|
370
414
|
|
|
371
415
|
function apiGet(path) {
|
|
@@ -536,7 +580,7 @@ function jsonText(title, data) {
|
|
|
536
580
|
// ─── Tool Handlers ───
|
|
537
581
|
|
|
538
582
|
async function handleSearch(args) {
|
|
539
|
-
const { query, tag, limit = 10, target = '', kind = '', policy = '' } = args;
|
|
583
|
+
const { query, tag, limit = 10, target = 'codex', kind = '', policy = '' } = args;
|
|
540
584
|
if (target || kind || policy) {
|
|
541
585
|
const cliArgs = ['search', query, '--json', '--page-size', String(Math.min(limit, 20))];
|
|
542
586
|
if (target) cliArgs.push('--target', target);
|
|
@@ -756,6 +800,39 @@ async function handleInstalled() {
|
|
|
756
800
|
return { content: [{ type: 'text', text: jsonText('TokRepo Codex installed assets', data) }] };
|
|
757
801
|
}
|
|
758
802
|
|
|
803
|
+
async function handleUpdate(args) {
|
|
804
|
+
const { dry_run = true, confirm = false, stage = false, approve_risk = false } = args || {};
|
|
805
|
+
const cliArgs = ['sync-installed', '--target', 'codex', '--json'];
|
|
806
|
+
if (dry_run !== false) cliArgs.push('--dry-run');
|
|
807
|
+
if (stage) cliArgs.push('--stage');
|
|
808
|
+
if (approve_risk) cliArgs.push('--approve-mcp');
|
|
809
|
+
|
|
810
|
+
if (dry_run === false && !confirm) {
|
|
811
|
+
cliArgs.push('--dry-run');
|
|
812
|
+
const { stdout, stderr } = await runTokrepoCli(cliArgs);
|
|
813
|
+
let data;
|
|
814
|
+
try {
|
|
815
|
+
data = JSON.parse(stdout);
|
|
816
|
+
} catch {
|
|
817
|
+
data = { stdout, stderr };
|
|
818
|
+
}
|
|
819
|
+
return {
|
|
820
|
+
isError: true,
|
|
821
|
+
content: [{ type: 'text', text: jsonText('Refused to update because confirm=true was not provided. Dry-run plan follows.', data) }],
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
if (dry_run === false) cliArgs.push('--update');
|
|
826
|
+
const { stdout, stderr } = await runTokrepoCli(cliArgs);
|
|
827
|
+
let data;
|
|
828
|
+
try {
|
|
829
|
+
data = JSON.parse(stdout);
|
|
830
|
+
} catch {
|
|
831
|
+
data = { stdout, stderr };
|
|
832
|
+
}
|
|
833
|
+
return { content: [{ type: 'text', text: jsonText(dry_run === false ? 'TokRepo Codex update result' : 'TokRepo Codex update dry-run', data) }] };
|
|
834
|
+
}
|
|
835
|
+
|
|
759
836
|
async function handleUninstall(args) {
|
|
760
837
|
const { uuid, dry_run = true, confirm = false, force = false } = args;
|
|
761
838
|
const cliArgs = ['uninstall', uuid, '--target', 'codex', '--json'];
|
|
@@ -973,7 +1050,7 @@ async function handleRequest(msg) {
|
|
|
973
1050
|
return null; // no response for notifications
|
|
974
1051
|
|
|
975
1052
|
case 'tools/list':
|
|
976
|
-
return { jsonrpc: '2.0', id, result: { tools:
|
|
1053
|
+
return { jsonrpc: '2.0', id, result: { tools: EXPOSED_TOOLS } };
|
|
977
1054
|
|
|
978
1055
|
case 'tools/call': {
|
|
979
1056
|
const { name, arguments: args } = params || {};
|
|
@@ -987,6 +1064,7 @@ async function handleRequest(msg) {
|
|
|
987
1064
|
case 'tokrepo_codex_install': result = await handleCodexInstall(args || {}); break;
|
|
988
1065
|
case 'tokrepo_clone_plan': result = await handleClonePlan(args || {}); break;
|
|
989
1066
|
case 'tokrepo_installed': result = await handleInstalled(args || {}); break;
|
|
1067
|
+
case 'tokrepo_update': result = await handleUpdate(args || {}); break;
|
|
990
1068
|
case 'tokrepo_uninstall': result = await handleUninstall(args || {}); break;
|
|
991
1069
|
case 'tokrepo_rollback': result = await handleRollback(args || {}); break;
|
|
992
1070
|
case 'tokrepo_eval_agent': result = await handleEvalAgent(args || {}); break;
|
package/package.json
CHANGED