@finchagentic/mcp 4.0.0 → 4.2.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 +1 -1
- package/README.md +96 -249
- package/dist/agent-loop.js +139 -69
- package/dist/annotations.js +14 -13
- package/dist/cli.js +78 -21
- package/dist/config.js +16 -16
- package/dist/convex.js +15 -18
- package/dist/index.js +4 -5
- package/dist/llm.js +24 -49
- package/dist/local-memory-file.js +147 -0
- package/dist/local-memory.js +42 -9
- package/dist/output-schemas.js +71 -17
- package/dist/resources.js +8 -13
- package/dist/server.js +27 -13
- package/dist/token-gate.js +2 -2
- package/dist/tool-filter.js +13 -4
- package/dist/tools/agents.js +66 -394
- package/dist/tools/base-mcp.js +7 -19
- package/dist/tools/base.js +34 -20
- package/dist/tools/chronicle.js +4 -4
- package/dist/tools/deep-research.js +10 -5
- package/dist/tools/defi.js +36 -35
- package/dist/tools/equity.js +9 -1
- package/dist/tools/insight.js +25 -29
- package/dist/tools/memory.js +76 -108
- package/dist/tools/monitor.js +7 -7
- package/dist/tools/os.js +10 -6
- package/dist/tools/packets.js +5 -5
- package/dist/tools/research.js +2 -2
- package/dist/tools/rh-mcp.js +25 -2
- package/dist/tools/rh-orders.js +201 -123
- package/dist/tools/scanner.js +30 -0
- package/dist/tools/stake.js +329 -0
- package/dist/tools/vault.js +122 -42
- package/dist/wallet.js +212 -24
- package/package.json +9 -21
- package/dist/tools/framework.js +0 -150
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finchagentic/mcp",
|
|
3
|
-
"version": "4.
|
|
4
|
-
"description": "The runtime layer for Agentic AI.
|
|
3
|
+
"version": "4.2.0",
|
|
4
|
+
"description": "The runtime layer for Agentic AI. Persistent memory, autonomous agents, and workflows that survive every session.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"finch": "dist/cli.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"preferGlobal": true,
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "tsc",
|
|
12
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
|
|
13
13
|
"dev": "ts-node src/index.ts",
|
|
14
14
|
"start": "node dist/index.js",
|
|
15
15
|
"test": "vitest run",
|
|
@@ -23,35 +23,23 @@
|
|
|
23
23
|
},
|
|
24
24
|
"keywords": [
|
|
25
25
|
"mcp",
|
|
26
|
-
"mcp-server",
|
|
27
26
|
"model-context-protocol",
|
|
28
27
|
"ai-agent",
|
|
29
|
-
"
|
|
28
|
+
"agentic",
|
|
30
29
|
"persistent-memory",
|
|
31
|
-
"
|
|
30
|
+
"autonomous-agents",
|
|
31
|
+
"workflows",
|
|
32
32
|
"vault",
|
|
33
|
-
"agentic",
|
|
34
|
-
"workflow-automation",
|
|
35
|
-
"claude-code",
|
|
36
|
-
"cursor",
|
|
37
|
-
"windsurf",
|
|
38
33
|
"finch",
|
|
39
34
|
"finchagentic",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"defi",
|
|
43
|
-
"base-chain",
|
|
44
|
-
"tool-calling",
|
|
45
|
-
"finch-terminal",
|
|
46
|
-
"ai-terminal",
|
|
47
|
-
"knowledge-graph",
|
|
48
|
-
"semantic-search"
|
|
35
|
+
"claude-code",
|
|
36
|
+
"cursor"
|
|
49
37
|
],
|
|
50
38
|
"repository": {
|
|
51
39
|
"type": "git",
|
|
52
40
|
"url": "git+https://github.com/finchagentic/mcp.git"
|
|
53
41
|
},
|
|
54
|
-
"homepage": "https://
|
|
42
|
+
"homepage": "https://docs.finch.com",
|
|
55
43
|
"bugs": {
|
|
56
44
|
"url": "https://github.com/finchagentic/mcp/issues"
|
|
57
45
|
},
|
package/dist/tools/framework.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FRAMEWORK_TOOLS = void 0;
|
|
4
|
-
exports.handleFrameworkTool = handleFrameworkTool;
|
|
5
|
-
const convex_js_1 = require("../convex.js");
|
|
6
|
-
exports.FRAMEWORK_TOOLS = [
|
|
7
|
-
{
|
|
8
|
-
name: "list_playbooks",
|
|
9
|
-
description: "List available Noel Framework playbooks - predefined multi-step workflows. " +
|
|
10
|
-
"Includes 4 system playbooks (Daily Market Scan, DCA Setup, Portfolio Rebalance Check, " +
|
|
11
|
-
"Research Sweep) plus any you've created. Each step is Sentinel-gated.",
|
|
12
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: "run_playbook",
|
|
16
|
-
description: "Execute a Noel Framework playbook. Each step runs through Sentinel before the " +
|
|
17
|
-
"matching tool executes it. Steps map directly to finch tools (market, vault, agent, " +
|
|
18
|
-
"memory, automation). Playbook halts immediately if Sentinel blocks a step.",
|
|
19
|
-
inputSchema: {
|
|
20
|
-
type: "object",
|
|
21
|
-
properties: {
|
|
22
|
-
playbook_name: {
|
|
23
|
-
type: "string",
|
|
24
|
-
description: "Exact name of the playbook. Use list_playbooks to see available ones.",
|
|
25
|
-
},
|
|
26
|
-
task_description: {
|
|
27
|
-
type: "string",
|
|
28
|
-
description: "Optional context passed as overrideParams to the playbook run.",
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
required: ["playbook_name"],
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: "get_finch_ledger",
|
|
36
|
-
description: "Get the Noel Framework audit trail - every Sentinel gate decision " +
|
|
37
|
-
"(approved / blocked / warned), which checks ran, duration, and reason. " +
|
|
38
|
-
"Full transparency on what agents are and aren't allowed to do.",
|
|
39
|
-
inputSchema: { type: "object", properties: {}, required: [] },
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
async function handleFrameworkTool(name, args) {
|
|
43
|
-
const a = (args ?? {});
|
|
44
|
-
switch (name) {
|
|
45
|
-
// ── list_playbooks ──────────────────────────────────────────────────────
|
|
46
|
-
case "list_playbooks": {
|
|
47
|
-
const result = await (0, convex_js_1.callConvex)("/framework/playbooks", "GET", undefined, "list_playbooks");
|
|
48
|
-
const pbs = result.playbooks ?? [];
|
|
49
|
-
if (pbs.length === 0) {
|
|
50
|
-
return { content: [{ type: "text", text: "No playbooks found." }] };
|
|
51
|
-
}
|
|
52
|
-
const list = pbs
|
|
53
|
-
.map((p) => {
|
|
54
|
-
const steps = (() => {
|
|
55
|
-
try {
|
|
56
|
-
return JSON.parse(p.steps).length;
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
return "?";
|
|
60
|
-
}
|
|
61
|
-
})();
|
|
62
|
-
return `• **${p.name}**${p.isPublic ? " 🌐" : " 👤"} - ${steps} steps\n ${p.description}\n Used ${p.usageCount} times`;
|
|
63
|
-
})
|
|
64
|
-
.join("\n\n");
|
|
65
|
-
return { content: [{ type: "text", text: `**Available Playbooks**\n\n${list}` }] };
|
|
66
|
-
}
|
|
67
|
-
// ── run_playbook ────────────────────────────────────────────────────────
|
|
68
|
-
case "run_playbook": {
|
|
69
|
-
if (!a.playbook_name) {
|
|
70
|
-
return { content: [{ type: "text", text: "playbook_name is required" }], isError: true };
|
|
71
|
-
}
|
|
72
|
-
// Resolve playbook ID by name
|
|
73
|
-
const pbList = await (0, convex_js_1.callConvex)("/framework/playbooks", "GET", undefined, "run_playbook");
|
|
74
|
-
const playbook = (pbList.playbooks ?? []).find((p) => p.name.toLowerCase() === String(a.playbook_name).toLowerCase());
|
|
75
|
-
if (!playbook) {
|
|
76
|
-
return {
|
|
77
|
-
content: [{
|
|
78
|
-
type: "text",
|
|
79
|
-
text: `Playbook "${a.playbook_name}" not found. Use list_playbooks to see available ones.`,
|
|
80
|
-
}],
|
|
81
|
-
isError: true,
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
const result = await (0, convex_js_1.callConvex)("/framework/playbook/run", "POST", {
|
|
85
|
-
playbookId: playbook._id,
|
|
86
|
-
overrideParams: a.task_description,
|
|
87
|
-
}, "run_playbook");
|
|
88
|
-
if (result.error) {
|
|
89
|
-
return { content: [{ type: "text", text: `Run failed: ${result.error}` }], isError: true };
|
|
90
|
-
}
|
|
91
|
-
if (result.blocked) {
|
|
92
|
-
return {
|
|
93
|
-
content: [{
|
|
94
|
-
type: "text",
|
|
95
|
-
text: [
|
|
96
|
-
`🛡️ **Sentinel blocked playbook at step ${result.step}**`,
|
|
97
|
-
``,
|
|
98
|
-
`**Tool:** ${result.tool}`,
|
|
99
|
-
`**Reason:** ${result.reason}`,
|
|
100
|
-
``,
|
|
101
|
-
`This is a mechanical safety gate. The action violates the agent's permission boundary.`,
|
|
102
|
-
`Completed steps before block: ${result.results?.length ?? 0}`,
|
|
103
|
-
].join("\n"),
|
|
104
|
-
}],
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
const steps = result.results ?? [];
|
|
108
|
-
const succeeded = steps.filter(r => r.success).length;
|
|
109
|
-
const stepLines = steps.map((r) => `${r.success ? "✅" : "❌"} Step ${r.step} [${r.role}]: ${r.tool}${r.error ? ` - ${r.error}` : ""}`);
|
|
110
|
-
return {
|
|
111
|
-
content: [{
|
|
112
|
-
type: "text",
|
|
113
|
-
text: [
|
|
114
|
-
`✅ **Playbook "${a.playbook_name}" completed**`,
|
|
115
|
-
``,
|
|
116
|
-
`${succeeded}/${steps.length} steps successful`,
|
|
117
|
-
`Run ID: \`${result.runId}\``,
|
|
118
|
-
``,
|
|
119
|
-
...stepLines,
|
|
120
|
-
].join("\n"),
|
|
121
|
-
}],
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
// ── get_finch_ledger ─────────────────────────────────────────────────────
|
|
125
|
-
case "get_finch_ledger": {
|
|
126
|
-
const result = await (0, convex_js_1.callConvex)("/swarm/ledger", "GET", undefined, "get_finch_ledger");
|
|
127
|
-
const entries = result.entries ?? [];
|
|
128
|
-
if (entries.length === 0) {
|
|
129
|
-
return {
|
|
130
|
-
content: [{
|
|
131
|
-
type: "text",
|
|
132
|
-
text: "No ledger entries yet. Run a playbook to see Sentinel decisions.",
|
|
133
|
-
}],
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
const lines = entries.map((e) => {
|
|
137
|
-
const icon = e.decision === "approved" ? "✅" : e.decision === "blocked" ? "🚫" : "⚠️";
|
|
138
|
-
return `${icon} **${e.agentId}** → \`${e.action}\`\n ${e.reason} (${e.durationMs}ms)`;
|
|
139
|
-
});
|
|
140
|
-
return {
|
|
141
|
-
content: [{
|
|
142
|
-
type: "text",
|
|
143
|
-
text: `**Noel Ledger** (last ${entries.length} decisions)\n\n${lines.join("\n\n")}`,
|
|
144
|
-
}],
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
default:
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
}
|