Monad Magma MCP

by 0xjaywins

259 downloads
Not rated
GitHub

About

A simple Model Context Protocol (MCP) server for staking and withdrawing MON tokens on the Magma platform (magmastaking.xyz) on the Monad Testnet

Details

Author
0xjaywins
Downloads
259
Categories
Other

- Stake MON tokens to receive gMON.
- Withdraw MON by burning gMON.
- Integrates with Monad Testnet.
- Displays transaction hash and explorer link.
- Configurable via .env and MCP client settings.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Monad Magma MCP
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, install dependencies, configure a .env file with your Monad Testnet private key, then build and run the project. Configure your MCP client (e.g., Claude) with the path to the compiled dist/index.js file. On Windows, adjust file paths accordingly and use the provided Claude configuration example.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "monad magma mcp": {
            "magma-mcp": {
                "command": "node",
                "args": [
                    "dist/index.js"
                ]
            }
        }
    }
}

McpServers

{
    "magma-mcp": {
        "command": "node",
        "args": [
            "dist/index.js"
        ]
    }
}

Monad Magma MCP

Features

- Stake MON: Stake MON tokens to receive gMON. - Withdraw MON: Burn gMON to withdraw MON.

Prerequisites

- Node.js (18.x or later) - Git - Monad Testnet wallet with MON tokens - MCP-compatible client (e.g., Claude)

Setup Commands

Clone Repository

git clone https://github.com/0xjaywins/magma-mcp.git
cd monad-mcp-staking

Install Dependencies

npm install
npm install --save-dev @types/node

Configure .env

1. Create .env:
   code .env
   
2. Add:
   PRIVATE_KEY=0xYourPrivateKey
   
Replace 0xYourPrivateKey with your Monad Testnet private key. 3. Update src/index.ts with .env path (e.g., /home/yourusername/monad-mcp-staking/.env for Unix, C:\Users\windows\Desktop\monad-mcp-staking\.env for Windows).

Build Project

npm run build

Run Script

node dist/index.js

Windows Setup Tips

- Use Windows paths (e.g., C:\Program Files\nodejs\node.exe, C:\Users\lenovo\Desktop\magma-mcp\dist\index.js). - Claude config for Windows:
  {
    "mcpServers": {
      "monad-mcp": {
        "command": "C:\\Program Files\\nodejs\\node.exe",
        "args": ["C:\\Users\\lenovo\\Desktop\\magma-mcp\\dist\\index.js"]
      }
    }
  }
  

Testing with MCP Inspector

1. Install:
   npm install @modelcontextprotocol/inspector@0.10.2
   
2. Get paths:
   which node  # /home/yourUsername/.nvm/versions/node/v23.11.0/bin/node
   pwd  # /home/yourUsername/monad-mcp-staking
   
Windows: Use C:\Program Files\nodejs\node.exe, C:\Users\lenovo\Desktop\monad-mcp-staking\dist\index.js. 3. Run:
   npx @modelcontextprotocol/inspector /home/yourUsername/.nvm/versions/node/v23.11.0/bin/node /home/yourUsername/monad-mcp-staking/dist/index.js
   

Configuring Claude

- Use paths from above. - Example claude.json:
  {
    "mcpServers": {
      "monad-mcp": {
        "command": "node",
        "args": ["/home/yourUsername/.nvm/versions/node/v23.11.0/bin/node", "/home/yourUsername/monad-mcp-staking/dist/index.js"]
      }
    }
  }
  

Expected Output

- Successful Stake:
  Successfully staked 0.2 MON on Magma.
  gMON minted: 0.2 gMON
  Your gMON balance: 0.2 gMON
  Transaction: 0x...
  Explorer: https://testnet.monadexplorer.com/tx/0x...
  
- MCP Inspector: Displays tool status and transaction logs. - Claude: Shows JSON responses with transaction details.

Troubleshooting

- Invalid .env: Ensure PRIVATE_KEY is correct. - Insufficient Funds: Fund wallet with MON/gMON on Monad Testnet. - Network Error: Verify RPC (https://testnet-rpc.monad.xyz). - Path Issues: Update paths in src/index.ts and Claude config.
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.