The MCP-BAMM server enables AI agents to interact with Borrow Automated Market Maker (BAMM) contracts on the Fraxtal blockchain for DeFi lending and borrowing operations.
Core Capabilities:
View Positions - Retrieve active BAMM positions across all pools using
GET_POSITIONSPool Analytics - Access statistics and metrics for all BAMM pools with
POOL_STATSLend - Deposit Fraxswap LP tokens to BAMM contracts to earn yield using
LENDBorrow - Borrow tokens against collateral from BAMM positions using
BORROWRepay - Repay borrowed tokens to BAMM positions using
REPAYAdd Collateral - Increase collateral in positions with
ADD_COLLATERALto maintain healthy loan-to-value ratiosRemove Collateral - Withdraw excess collateral from positions with
REMOVE_COLLATERALWithdraw - Redeem BAMM tokens to withdraw LP tokens using
WITHDRAW
Technical Features:
Validates Ethereum addresses using regex pattern matching (0x + 40 hex characters)
Requires wallet private key for transaction signing
Built on the Model Context Protocol (MCP) for LLM integration
Used for linting and formatting the codebase, with dedicated commands for these operations during development.
Supports storing private keys and configuration in .env files for secure management of sensitive credentials.
Runs on Node.js runtime (v18 or newer recommended) for server execution.
Used as the package manager for installation, dependency management, and running the server.
Built using TypeScript to implement the MCP server functionality with type safety.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP-BAMMshow me my active BAMM positions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
BAMM MCP Server
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: Ramp 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
Using npx (Recommended)
To use this server without installing it globally:
Build from Source
Running with an MCP Client
Add the following configuration to your MCP client settings (e.g., claude_desktop_config.json).
Minimal Configuration
Advanced Configuration (Local Build)
Configuration (Environment Variables)
Variable | Required | Description | Default |
| 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 |
| string | Yes | The address of the BAMM contract |
| string | Yes | The amount of collateral to add |
| string | The address of the collateral token | |
| string | The symbol of the collateral token (e.g., 'IQT') |
BORROW
Borrow tokens from a BAMM position
Parameter | Type | Required | Description |
| string | Yes | The address of the BAMM contract |
| string | Yes | The amount to borrow |
| string | The address of the token to borrow | |
| string | The symbol of the token to borrow (e.g., 'IQT') |
LEND
Lend Fraxswap LP tokens to a BAMM contract
Parameter | Type | Required | Description |
| string | Yes | The address of the BAMM contract |
| string | Yes | The amount of LP tokens to lend |
REMOVE_COLLATERAL
Remove collateral from your BAMM position
Parameter | Type | Required | Description |
| string | Yes | The address of the BAMM contract |
| string | Yes | The amount of collateral to remove |
| string | The address of the collateral token | |
| string | The symbol of the collateral token (e.g., 'IQT') |
REPAY
Repay borrowed tokens to a BAMM position
Parameter | Type | Required | Description |
| string | Yes | The address of the BAMM contract |
| string | Yes | The amount to repay |
| string | The address of the token to repay | |
| 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 |
| string | Yes | The address of the BAMM contract |
| string | Yes | The amount of BAMM tokens to withdraw |
Development
Build Project
Development Mode (Watch)
Linting & Formatting
Project Structure
src/tools/: Individual tool definitionssrc/services/: API client and business logicsrc/lib/: Shared utilitiessrc/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.