Skip to main content
Glama

BAMM MCP Server

npm version License: MIT

Overview

The BAMM MCP Server enables AI agents to interact with Borrow Automated Market Maker (BAMM) contracts on the Fraxtal blockchain. This server provides comprehensive access to BAMM positions, lending, borrowing, and collateral management operations.

By implementing the Model Context Protocol (MCP), this server allows Large Language Models (LLMs) to manage BAMM positions, borrow against LP tokens, and perform other operations related to the BAMM protocol directly through their context window.

Related MCP server: MantraChain MCP Server

Features

  • Position Management: View and manage your active BAMM positions across all pools.

  • Lending Operations: Lend Fraxswap LP tokens to BAMM contracts to earn yield.

  • Borrowing: Borrow tokens against your collateral from BAMM positions.

  • Collateral Management: Add or remove collateral from your BAMM positions.

  • Pool Analytics: Access statistics for all BAMM pools.

Installation

To use this server without installing it globally:

npx @iqai/mcp-bamm

Build from Source

git clone https://github.com/IQAIcom/mcp-bamm.git
cd mcp-bamm
pnpm install
pnpm run build

Running with an MCP Client

Add the following configuration to your MCP client settings (e.g., claude_desktop_config.json).

Minimal Configuration

{
  "mcpServers": {
    "bamm": {
      "command": "npx",
      "args": ["-y", "@iqai/mcp-bamm"],
      "env": {
        "WALLET_PRIVATE_KEY": "your_wallet_private_key_here"
      }
    }
  }
}

Advanced Configuration (Local Build)

{
  "mcpServers": {
    "bamm": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-bamm/dist/index.js"],
      "env": {
        "WALLET_PRIVATE_KEY": "your_wallet_private_key_here"
      }
    }
  }
}

Configuration (Environment Variables)

Variable

Required

Description

Default

WALLET_PRIVATE_KEY

Yes

Private key of the wallet for signing transactions

-

Security Note: Handle your private key with extreme care. Ensure it is stored securely and only provided to trusted MCP client configurations.

Usage Examples

Position Management

  • "What are my current BAMM positions?"

  • "Show me the stats for all BAMM pools."

Lending & Borrowing

  • "Lend 100 LP tokens to the BAMM at address 0x..."

  • "Borrow 50 FRAX from my BAMM position."

  • "Repay 25 FRAX to my BAMM position."

Collateral Operations

  • "Add 100 FRAX as collateral to my BAMM position."

  • "Remove 50 USDC collateral from my position."

  • "Withdraw my LP tokens from the BAMM."

MCP Tools

ADD_COLLATERAL

Add collateral to your BAMM position

Parameter

Type

Required

Description

bammAddress

string

Yes

The address of the BAMM contract

amount

string

Yes

The amount of collateral to add

collateralToken

string

The address of the collateral token

collateralTokenSymbol

string

The symbol of the collateral token (e.g., 'IQT')

BORROW

Borrow tokens from a BAMM position

Parameter

Type

Required

Description

bammAddress

string

Yes

The address of the BAMM contract

amount

string

Yes

The amount to borrow

borrowToken

string

The address of the token to borrow

borrowTokenSymbol

string

The symbol of the token to borrow (e.g., 'IQT')

LEND

Lend Fraxswap LP tokens to a BAMM contract

Parameter

Type

Required

Description

bammAddress

string

Yes

The address of the BAMM contract

amount

string

Yes

The amount of LP tokens to lend

REMOVE_COLLATERAL

Remove collateral from your BAMM position

Parameter

Type

Required

Description

bammAddress

string

Yes

The address of the BAMM contract

amount

string

Yes

The amount of collateral to remove

collateralToken

string

The address of the collateral token

collateralTokenSymbol

string

The symbol of the collateral token (e.g., 'IQT')

REPAY

Repay borrowed tokens to a BAMM position

Parameter

Type

Required

Description

bammAddress

string

Yes

The address of the BAMM contract

amount

string

Yes

The amount to repay

borrowToken

string

The address of the token to repay

borrowTokenSymbol

string

The symbol of the token to repay (e.g., 'IQT')

WITHDRAW

Withdraw LP tokens from a BAMM contract by redeeming BAMM tokens

Parameter

Type

Required

Description

bammAddress

string

Yes

The address of the BAMM contract

amount

string

Yes

The amount of BAMM tokens to withdraw

Development

Build Project

pnpm run build

Development Mode (Watch)

pnpm run watch

Linting & Formatting

pnpm run lint
pnpm run format

Project Structure

  • src/tools/: Individual tool definitions

  • src/services/: API client and business logic

  • src/lib/: Shared utilities

  • src/index.ts: Server entry point

Resources

Disclaimer

This project interacts with blockchain smart contracts and handles cryptocurrency transactions. Users should exercise caution, verify all data independently, and understand the risks involved in DeFi operations.

License

MIT

Available Tools

7 tools
ADD_COLLATERALC

Add collateral to your BAMM position

Inputs: bammAddress (required), amount (required), collateralToken, collateralTokenSymbol.

BORROWC

Borrow tokens from a BAMM position

Inputs: bammAddress (required), amount (required), borrowToken, borrowTokenSymbol.

GET_POSITIONSB

Get all your active BAMM positions

Inputs: no named parameters.

LENDB

Lend Fraxswap LP tokens to a BAMM contract

Inputs: bammAddress (required), amount (required).

POOL_STATSA

Get statistics for all BAMM pools

Inputs: no named parameters.

REMOVE_COLLATERALB

Remove collateral from your BAMM position

Inputs: bammAddress (required), amount (required), collateralToken, collateralTokenSymbol.

REPAYB

Repay borrowed tokens to a BAMM position

Inputs: bammAddress (required), amount (required), borrowToken, borrowTokenSymbol.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a clear, distinct purpose: adding/removing collateral, borrowing, repaying, lending, viewing positions, and pool statistics. No ambiguity or overlap.

    Naming Consistency5/5

    All tool names follow a consistent UPPER_SNAKE_CASE pattern with action-first verbs (ADD, REMOVE, BORROW, REPAY, LEND, GET, POOL). Highly predictable.

    Tool Count5/5

    7 tools is an appropriate scope for a DeFi protocol covering core operations—collateral management, borrowing, lending, and status queries—without being bloated.

    Completeness5/5

    The tool surface covers essential BAMM interactions: adding/removing collateral, borrowing, repaying, lending LP tokens, and querying positions and pool stats. No obvious gaps for typical usage.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables AI models to interact with the Solana blockchain, providing RPC methods, wallet management, DeFi trading capabilities, and Helius API integration for enhanced Solana development.
      5
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A server that provides tools for interacting with MantraChain blockchain through the Model Context Protocol, allowing users to manage tokens, stake assets, query balances, and execute various blockchain operations.
      18
      49 npm
      2
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server that enables AI assistants and applications to interact with decentralized exchanges (DEXs), allowing users to get quotes for token swaps and execute swap transactions.
      3
      13 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server providing comprehensive tools to access real-time market data, trading information, user positions, and analytics for the Hyperliquid perpetual futures exchange.
      5
      MIT