@finchagentic/mcp 4.7.0 → 4.7.2
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/dist/cli.js +2 -2
- package/dist/finch-status.js +35 -3
- package/dist/index.js +1 -1
- package/dist/server.js +2 -1
- package/dist/tools/memory.js +15 -2
- package/dist/tools/miroshark.js +1 -1
- package/dist/tools/os.js +2 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -64,7 +64,7 @@ const CORE_TOOL_COUNT = (() => {
|
|
|
64
64
|
process.env.FINCH_TOOLS = prev;
|
|
65
65
|
}
|
|
66
66
|
})();
|
|
67
|
-
const CONVEX_SITE = process.env.FINCH_CONVEX_URL ?? "https://
|
|
67
|
+
const CONVEX_SITE = process.env.FINCH_CONVEX_URL ?? "https://valuable-fish-533.convex.site";
|
|
68
68
|
const PKG_VERSION = (() => {
|
|
69
69
|
try {
|
|
70
70
|
const raw = fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8");
|
|
@@ -896,7 +896,7 @@ async function doctorFlow() {
|
|
|
896
896
|
checks.push({
|
|
897
897
|
name: "Backend reachable", status: "✗",
|
|
898
898
|
detail: `${CONVEX_SITE} → ${err.message}`,
|
|
899
|
-
fix: `Network issue or wrong URL. Default: https://
|
|
899
|
+
fix: `Network issue or wrong URL. Default: https://valuable-fish-533.convex.site`,
|
|
900
900
|
});
|
|
901
901
|
}
|
|
902
902
|
// 3. Auth state
|
package/dist/finch-status.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const config_js_1 = require("./config.js");
|
|
3
|
+
const convex_js_1 = require("./convex.js");
|
|
3
4
|
exports.FINCH_STATUS_TOOL = {
|
|
4
5
|
name: "finch_status",
|
|
5
6
|
description: "Check Finch MCP is working - no sign-in needed. Returns the version, how many tools are available, whether the session token is configured, and a ready-to-paste MCP client config snippet. Run this FIRST if anything feels off: it tells you instantly whether the problem is auth (missing token), network (backend unreachable), or the tool itself.",
|
|
@@ -7,13 +8,35 @@ exports.FINCH_STATUS_TOOL = {
|
|
|
7
8
|
annotations: { title: "Finch status", readOnlyHint: true, openWorldHint: false },
|
|
8
9
|
};
|
|
9
10
|
|
|
10
|
-
// `finch_status` handler -
|
|
11
|
+
// `finch_status` handler - never throws on auth; when a token is configured
|
|
12
|
+
// it makes ONE cheap authed call (/memory/profile) and reports the REAL
|
|
13
|
+
// auth state instead of a fake-healthy dashboard (the old Promise.allSettled
|
|
14
|
+
// version swallowed 401s and showed empty-but-healthy, which hid expired
|
|
15
|
+
// credentials entirely).
|
|
11
16
|
exports.handleFinchStatus = async function handleFinchStatus() {
|
|
12
17
|
const pkg = require("./../package.json");
|
|
13
18
|
let tokenSet = false;
|
|
19
|
+
let authState = "none";
|
|
20
|
+
let authDetail = "";
|
|
14
21
|
try {
|
|
15
22
|
tokenSet = Boolean((0, config_js_1.getSavedToken)());
|
|
16
23
|
} catch { tokenSet = false; }
|
|
24
|
+
if (tokenSet) {
|
|
25
|
+
try {
|
|
26
|
+
const data = await (0, convex_js_1.callConvex)("/memory/profile", "GET", undefined, "finch_status", 8000, true);
|
|
27
|
+
authState = (data?.status === "ok") ? "valid" : "rejected";
|
|
28
|
+
if (authState === "rejected") authDetail = "the session token was rejected by the backend - re-copy it from app.finchagentic.com";
|
|
29
|
+
} catch (err) {
|
|
30
|
+
const msg = String(err?.message ?? err);
|
|
31
|
+
if (msg.includes("Authentication required")) {
|
|
32
|
+
authState = "invalid";
|
|
33
|
+
authDetail = "the backend rejected the token as expired or invalid - re-copy it from app.finchagentic.com";
|
|
34
|
+
} else {
|
|
35
|
+
authState = "unreachable";
|
|
36
|
+
authDetail = msg.slice(0, 120);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
17
40
|
const configJson = JSON.stringify({
|
|
18
41
|
mcpServers: {
|
|
19
42
|
finch: {
|
|
@@ -23,16 +46,25 @@ exports.handleFinchStatus = async function handleFinchStatus() {
|
|
|
23
46
|
},
|
|
24
47
|
},
|
|
25
48
|
}, null, 2);
|
|
26
|
-
const lines = tokenSet
|
|
49
|
+
const lines = tokenSet && authState === "valid"
|
|
27
50
|
? [
|
|
28
51
|
"**Finch MCP v" + pkg.version + "** - runtime layer for agentic AI", "",
|
|
29
|
-
"- Session token: \u2705
|
|
52
|
+
"- Session token: \u2705 valid (verified against the backend)",
|
|
30
53
|
"- Tools: **116** registered (surface depends on FINCH_TOOLS filter)",
|
|
31
54
|
"- Resources: finch://vault/<key> - Prompts: crypto-thesis and friends",
|
|
32
55
|
"- Tool presets: FINCH_PRESET=core|defi|research|memory (default core) - FINCH_TOOLS=all for everything",
|
|
33
56
|
"",
|
|
34
57
|
"All set. Good first calls: `memory_add` (persist a note instantly), `get_market` (live prices), `deep_research` (multi-step reports, streaming progress).",
|
|
35
58
|
]
|
|
59
|
+
: tokenSet
|
|
60
|
+
? [
|
|
61
|
+
"**Finch MCP v" + pkg.version + "** - runtime layer for agentic AI", "",
|
|
62
|
+
`- Session token: \u26a0\ufe0f configured but **${authState}**`,
|
|
63
|
+
authDetail ? `- ${authDetail}` : "",
|
|
64
|
+
"- Tools are registered, but every backend-backed call will fail until the token is replaced.",
|
|
65
|
+
"",
|
|
66
|
+
"**Fix:** re-copy a fresh token from app.finchagentic.com, update FINCH_SESSION_TOKEN in your MCP config, restart the client.",
|
|
67
|
+
]
|
|
36
68
|
: [
|
|
37
69
|
"**Finch MCP v" + pkg.version + "** - runtime layer for agentic AI", "",
|
|
38
70
|
"- Session token: \u274c not set", "",
|
package/dist/index.js
CHANGED
|
@@ -54,7 +54,7 @@ const PKG_VERSION = (() => {
|
|
|
54
54
|
return "unknown";
|
|
55
55
|
}
|
|
56
56
|
})();
|
|
57
|
-
const CONVEX_SITE = process.env.FINCH_CONVEX_URL ?? "https://
|
|
57
|
+
const CONVEX_SITE = process.env.FINCH_CONVEX_URL ?? "https://valuable-fish-533.convex.site";
|
|
58
58
|
// ── ANSI helpers ──────────────────────────────────────────────────────────────
|
|
59
59
|
const C = {
|
|
60
60
|
cyan: "\x1b[36m",
|
package/dist/server.js
CHANGED
|
@@ -132,7 +132,8 @@ exports.ALL_TOOLS = [
|
|
|
132
132
|
...rh_orders_js_1.RH_ORDER_TOOLS, // 5 - rh_dca_create, rh_bracket_create, rh_orders_list, rh_order_cancel, rh_orders_tick (RH automated DCA/TP/SL)
|
|
133
133
|
...rh_bridge_js_1.BRIDGE_TOOLS, // 1 - rh_stock_bridge (tokenized stock vs real equity)
|
|
134
134
|
...memory_js_1.MEMORY_TOOLS, // 9 - memory_add, memory_search, memory_context, memory_profile, memory_list, memory_delete, memory_insight, memory_extract, memory_consolidate. memory_publish removed - promised a "Memory Marketplace" that doesn't exist at any layer (no browse route, no query, no UI), see tools/memory.ts
|
|
135
|
-
...os_js_1.OS_TOOLS
|
|
135
|
+
...os_js_1.OS_TOOLS.filter((t) => t.name !== "finch_status"), // finch_status lives in finch-status.js (dedup)
|
|
136
|
+
// 2 - finch_diagnostics, finch_shell_chat
|
|
136
137
|
...research_js_1.RESEARCH_TOOLS, // 2 - web_scrape, web_search
|
|
137
138
|
...deep_research_js_1.DEEP_RESEARCH_TOOLS, // 1 - deep_research (search → scrape → rank → cited evidence pack; caller synthesises)
|
|
138
139
|
...research_compare_js_1.RESEARCH_COMPARE_TOOLS, // 1 - research_compare (diff two reports across time)
|
package/dist/tools/memory.js
CHANGED
|
@@ -192,6 +192,15 @@ async function syncToSupermemory(content, metadata, sourceUrl) {
|
|
|
192
192
|
console.error(`[memory] sync_failed: ${errMsg} | preview: "${preview}"`);
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
+
// A real auth failure must never be reported as "0 results found" - that
|
|
196
|
+
// reads as "your account genuinely has nothing saved" when the actual
|
|
197
|
+
// problem is the token/key was rejected. Only genuinely transient errors
|
|
198
|
+
// (network hiccup, the other RRF side still succeeding) degrade silently
|
|
199
|
+
// to an empty contribution - an auth failure is rethrown so it reaches the
|
|
200
|
+
// user instead of being swallowed.
|
|
201
|
+
function isAuthFailure(err) {
|
|
202
|
+
return err instanceof Error && /Authentication required/i.test(err.message);
|
|
203
|
+
}
|
|
195
204
|
async function searchSupermemory(query, limit = 10) {
|
|
196
205
|
try {
|
|
197
206
|
const local = (0, local_memory_js_1.getLocalMemoryConfig)();
|
|
@@ -200,7 +209,9 @@ async function searchSupermemory(query, limit = 10) {
|
|
|
200
209
|
const data = await (0, convex_js_1.callConvex)("/memory/search", "POST", { q: query, n: limit }, "memory_search");
|
|
201
210
|
return data?.results ?? [];
|
|
202
211
|
}
|
|
203
|
-
catch {
|
|
212
|
+
catch (err) {
|
|
213
|
+
if (isAuthFailure(err))
|
|
214
|
+
throw err;
|
|
204
215
|
return [];
|
|
205
216
|
}
|
|
206
217
|
}
|
|
@@ -218,7 +229,9 @@ async function lexicalSearch(query, limit = 30) {
|
|
|
218
229
|
rank: typeof r.rank === "number" ? r.rank : idx,
|
|
219
230
|
}));
|
|
220
231
|
}
|
|
221
|
-
catch {
|
|
232
|
+
catch (err) {
|
|
233
|
+
if (isAuthFailure(err))
|
|
234
|
+
throw err;
|
|
222
235
|
return [];
|
|
223
236
|
}
|
|
224
237
|
}
|
package/dist/tools/miroshark.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MIROSHARK_TOOLS = void 0;
|
|
4
4
|
exports.handleMirosharkTool = handleMirosharkTool;
|
|
5
5
|
const config_js_1 = require("../config.js");
|
|
6
|
-
const CONVEX_SITE = process.env.FINCH_CONVEX_URL ?? "https://
|
|
6
|
+
const CONVEX_SITE = process.env.FINCH_CONVEX_URL ?? "https://valuable-fish-533.convex.site";
|
|
7
7
|
exports.MIROSHARK_TOOLS = [
|
|
8
8
|
{
|
|
9
9
|
name: "miroshark_simulate",
|
package/dist/tools/os.js
CHANGED
|
@@ -7,7 +7,7 @@ const token_gate_js_1 = require("../token-gate.js");
|
|
|
7
7
|
const wallet_js_1 = require("../wallet.js");
|
|
8
8
|
const local_memory_js_1 = require("../local-memory.js");
|
|
9
9
|
const config_js_1 = require("../config.js");
|
|
10
|
-
const CONVEX_SITE = process.env.FINCH_CONVEX_URL ?? "https://
|
|
10
|
+
const CONVEX_SITE = process.env.FINCH_CONVEX_URL ?? "https://valuable-fish-533.convex.site";
|
|
11
11
|
exports.OS_TOOLS = [
|
|
12
12
|
{
|
|
13
13
|
name: "finch_status",
|
|
@@ -114,7 +114,7 @@ async function handleOsTool(name, args) {
|
|
|
114
114
|
return { content: [{ type: "text", text: lines.join("\n") }] };
|
|
115
115
|
}
|
|
116
116
|
case "finch_diagnostics": {
|
|
117
|
-
const CONVEX_URL = process.env.FINCH_CONVEX_URL ?? "https://
|
|
117
|
+
const CONVEX_URL = process.env.FINCH_CONVEX_URL ?? "https://valuable-fish-533.convex.site";
|
|
118
118
|
// Ping root of each service — any non-5xx means the host is up
|
|
119
119
|
const FC_URL = "https://api.firecrawl.dev";
|
|
120
120
|
const SM_URL = "https://api.supermemory.ai";
|
package/package.json
CHANGED