Skip to content

Commit 3d7bb1d

Browse files
committed
chore: upgrade fastmcp to v3.32.0
Upgrade fastmcp dependency from 1.27.7 to 3.32.0 to use the latest version with improved features and bug fixes. Updated all tool implementations to be compatible with fastmcp v3 API changes: - Changed Tool type signature from Tool<undefined, ...> to Tool<FastMCPSessionAuth, ...> - Updated execute functions to accept context parameter (params, _context) - Added FastMCPSessionAuth type imports - Added changesets for this patch
1 parent 43f12a8 commit 3d7bb1d

File tree

8 files changed

+558
-178
lines changed

8 files changed

+558
-178
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@iqai/mcp-bamm": patch
3+
---
4+
5+
Upgrade fastmcp dependency to v3.32.0
6+
7+
Updated fastmcp from v1.27.7 to v3.32.0 for improved features and bug fixes. Internal tool implementations have been updated to work with the new fastmcp v3 API, but the public API and functionality of the MCP server remain unchanged.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"keywords": ["mcp", "bamm", "borrow", "automated market maker"],
3434
"dependencies": {
3535
"dedent": "^1.6.0",
36-
"fastmcp": "^1.27.7",
36+
"fastmcp": "^3.32.0",
3737
"zod": "^3.25.7",
3838
"viem": "^2.22.15"
3939
},

pnpm-lock.yaml

Lines changed: 535 additions & 162 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/tools/add-collateral.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import dedent from "dedent";
2-
import type { Tool } from "fastmcp";
2+
import type { FastMCPSessionAuth, Tool } from "fastmcp";
33
import type { Address } from "viem";
44
import { z } from "zod";
55
import formatNumber from "../lib/format-number.js";
@@ -26,13 +26,13 @@ const addCollateralToolParams = z.object({
2626
export type AddCollateralToolParams = z.infer<typeof addCollateralToolParams>;
2727

2828
export const addCollateralTool: Tool<
29-
undefined,
29+
FastMCPSessionAuth,
3030
typeof addCollateralToolParams
3131
> = {
3232
name: "ADD_COLLATERAL",
3333
description: "Add collateral to your BAMM position",
3434
parameters: addCollateralToolParams,
35-
execute: async (params) => {
35+
execute: async (params, _context) => {
3636
try {
3737
if (!params.collateralToken && !params.collateralTokenSymbol) {
3838
return "Error: Either collateralToken address or collateralTokenSymbol is required";

src/tools/borrow.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import dedent from "dedent";
2-
import type { Tool } from "fastmcp";
2+
import type { FastMCPSessionAuth, Tool } from "fastmcp";
33
import type { Address } from "viem";
44
import { z } from "zod";
55
import formatNumber from "../lib/format-number.js";
@@ -25,11 +25,11 @@ const borrowToolParams = z.object({
2525

2626
export type BorrowToolParams = z.infer<typeof borrowToolParams>;
2727

28-
export const borrowTool: Tool<undefined, typeof borrowToolParams> = {
28+
export const borrowTool: Tool<FastMCPSessionAuth, typeof borrowToolParams> = {
2929
name: "BORROW",
3030
description: "Borrow tokens from a BAMM position",
3131
parameters: borrowToolParams,
32-
execute: async (params) => {
32+
execute: async (params, _context) => {
3333
try {
3434
if (!params.borrowToken && !params.borrowTokenSymbol) {
3535
return "Error: Either borrowToken address or borrowTokenSymbol is required";

src/tools/lend.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import dedent from "dedent";
2-
import type { Tool } from "fastmcp";
2+
import type { FastMCPSessionAuth, Tool } from "fastmcp";
33
import type { Address } from "viem";
44
import { z } from "zod";
55
import formatNumber from "../lib/format-number.js";
@@ -16,11 +16,11 @@ const lendToolParams = z.object({
1616

1717
export type LendToolParams = z.infer<typeof lendToolParams>;
1818

19-
export const lendTool: Tool<undefined, typeof lendToolParams> = {
19+
export const lendTool: Tool<FastMCPSessionAuth, typeof lendToolParams> = {
2020
name: "LEND",
2121
description: "Lend Fraxswap LP tokens to a BAMM contract",
2222
parameters: lendToolParams,
23-
execute: async (params) => {
23+
execute: async (params, _context) => {
2424
try {
2525
const privateKey = process.env.WALLET_PRIVATE_KEY;
2626
if (!privateKey) {

src/tools/remove-collateral.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import dedent from "dedent";
2-
import type { Tool } from "fastmcp";
2+
import type { FastMCPSessionAuth, Tool } from "fastmcp";
33
import type { Address } from "viem";
44
import { z } from "zod";
55
import formatNumber from "../lib/format-number.js";
@@ -28,13 +28,13 @@ export type RemoveCollateralToolParams = z.infer<
2828
>;
2929

3030
export const removeCollateralTool: Tool<
31-
undefined,
31+
FastMCPSessionAuth,
3232
typeof removeCollateralToolParams
3333
> = {
3434
name: "REMOVE_COLLATERAL",
3535
description: "Remove collateral from your BAMM position",
3636
parameters: removeCollateralToolParams,
37-
execute: async (params) => {
37+
execute: async (params, _context) => {
3838
try {
3939
if (!params.collateralToken && !params.collateralTokenSymbol) {
4040
return "Error: Either collateralToken address or collateralTokenSymbol is required";

src/tools/repay.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import dedent from "dedent";
2-
import type { Tool } from "fastmcp";
2+
import type { FastMCPSessionAuth, Tool } from "fastmcp";
33
import type { Address } from "viem";
44
import { z } from "zod";
55
import formatNumber from "../lib/format-number.js";
@@ -25,11 +25,11 @@ const repayToolParams = z.object({
2525

2626
export type RepayToolParams = z.infer<typeof repayToolParams>;
2727

28-
export const repayTool: Tool<undefined, typeof repayToolParams> = {
28+
export const repayTool: Tool<FastMCPSessionAuth, typeof repayToolParams> = {
2929
name: "REPAY",
3030
description: "Repay borrowed tokens to a BAMM position",
3131
parameters: repayToolParams,
32-
execute: async (params) => {
32+
execute: async (params, _context) => {
3333
try {
3434
if (!params.borrowToken && !params.borrowTokenSymbol) {
3535
return "Error: Either borrowToken address or borrowTokenSymbol is required";

0 commit comments

Comments
 (0)