@fidesbuild/mcp-server 0.11.0 → 0.11.1
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/server.js +6 -6
- package/package.json +2 -2
package/dist/server.js
CHANGED
|
@@ -621,17 +621,17 @@ export function createFidesMcpServer(cfg) {
|
|
|
621
621
|
return json;
|
|
622
622
|
}
|
|
623
623
|
/** Sends a plan's bundles: through the hosted relayer, or paid by the agent key with FIDES_RELAY=self. */
|
|
624
|
-
// The hosted relayer
|
|
624
|
+
// The hosted relayer sends one bundle a day per FIDES Account for free. Past it, a bundle that carries the relay fee in $FIDES
|
|
625
625
|
// is still relayed, if the FIDES allows paying it. What was paid is kept for the tool's answer.
|
|
626
626
|
let lastRelayFee = null;
|
|
627
627
|
async function withRelayFee(fides, actions, bundles) {
|
|
628
628
|
if (!cfg.api)
|
|
629
629
|
return null;
|
|
630
|
-
const fees = await RelayFees.get(cfg.api).catch(() => null);
|
|
631
|
-
if (!fees
|
|
630
|
+
const fees = await RelayFees.get(cfg.api, fides.account).catch(() => null);
|
|
631
|
+
if (!fees || !RelayFees.needed(fees, Math.max(1, bundles)))
|
|
632
632
|
return null;
|
|
633
633
|
if (!RelayFees.allows(fides, fees))
|
|
634
|
-
return '
|
|
634
|
+
return 'This FIDES Account has used its free relayed bundle for today, and this FIDES does not allow paying the relay fee in $FIDES. Try again after 00:00 UTC, or the user signs a FIDES that allows it (fides_setup with relay_fees).';
|
|
635
635
|
const fee = RelayFees.action(fees, Math.max(1, bundles));
|
|
636
636
|
lastRelayFee = fee.label ?? null;
|
|
637
637
|
return [...actions.filter((a) => a.id !== 'relay-fee'), fee];
|
|
@@ -1223,7 +1223,7 @@ export function createFidesMcpServer(cfg) {
|
|
|
1223
1223
|
result: r.status === 'EXECUTED' ? 'executed' : 'not executed',
|
|
1224
1224
|
transactions: r.txHash || r.error ? [{ status: r.status.toLowerCase(), transaction: txLink(r.txHash), ...(r.error ? { reason: failure(r.error) } : {}) }] : [],
|
|
1225
1225
|
blocked_and_not_sent: longEntry.plan.plan.rejected.map((a) => `${a.label}: ${REASONS[a.reason ?? ''] ?? a.reason}`),
|
|
1226
|
-
...(lastRelayFee ? { relay_fee: `${lastRelayFee}, because the free
|
|
1226
|
+
...(lastRelayFee ? { relay_fee: `${lastRelayFee}, because the free relayed bundle for today is used` } : {}),
|
|
1227
1227
|
...(sw && r.status === 'EXECUTED' ? { best_execution: { quoted: `${formatUnits(sw.quote.quotedOut, sw.outDecimals)} ${sw.outSymbol}`, received: `${formatUnits(received, sw.outDecimals)} ${sw.outSymbol}`, route: describeRoute(sw.quote) } } : {}),
|
|
1228
1228
|
...(st ? { this_period: { spent: `${formatUnits(st.thisPeriod[0].spent, t.decimals)} ${t.symbol}`, left: `${formatUnits(st.thisPeriod[0].remaining, t.decimals)} ${t.symbol}`, resets_at: new Date(Number(st.resetsAt) * 1000).toISOString() }, total_left: `${formatUnits(st.total[0].remaining, t.decimals)} of ${formatUnits(st.total[0].limit, t.decimals)} ${t.symbol}` } : {}),
|
|
1229
1229
|
});
|
|
@@ -1249,7 +1249,7 @@ export function createFidesMcpServer(cfg) {
|
|
|
1249
1249
|
result: executed === bundles.length ? 'executed' : executed ? 'partly executed' : 'not executed',
|
|
1250
1250
|
transactions: bundles.map((b) => ({ status: b.status.toLowerCase(), transaction: txLink(b.txHash), ...(b.error ? { reason: failure(b.error) } : {}) })),
|
|
1251
1251
|
blocked_and_not_sent: plan.rejected().map((a) => `${a.label}: ${REASONS[a.reason ?? ''] ?? a.reason}`),
|
|
1252
|
-
...(lastRelayFee ? { relay_fee: `${lastRelayFee}, because the free
|
|
1252
|
+
...(lastRelayFee ? { relay_fee: `${lastRelayFee}, because the free relayed bundle for today is used` } : {}),
|
|
1253
1253
|
...(swap && executed === bundles.length ? { best_execution: {
|
|
1254
1254
|
quoted: `${formatUnits(swap.quote.quotedOut, swap.outDecimals)} ${swap.outSymbol}`,
|
|
1255
1255
|
received: `${formatUnits(received, swap.outDecimals)} ${swap.outSymbol}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fidesbuild/mcp-server",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "FIDES as tools for Claude and any MCP client: plan and execute actions inside a signed FIDES, gas paid by the hosted relayer.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fides",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
39
|
-
"@fidesbuild/sdk": "0.2.
|
|
39
|
+
"@fidesbuild/sdk": "0.2.7",
|
|
40
40
|
"viem": "^2.21.0",
|
|
41
41
|
"zod": "^4.6.5",
|
|
42
42
|
"@fidesbuild/x402": "0.2.0",
|