Monad MCP Server (@unsorted-ai/mcp)

April 22, 2025 · View on GitHub

A Model Context Protocol (MCP) server for interacting with the Monad blockchain via Alchemy's API.
It exposes tools (e.g. get_portfolio) that LLM‑powered agents (Cursor, Claude) can call directly.


Table of Contents

  1. Prerequisites
  2. Installation & Configuration
  3. Local Development
  4. Tools Provided
  5. Scripts
  6. Contributing
  7. License

Prerequisites


Installation & Configuration

  1. Create or edit ~/.cursor/mcp.json in your home directory:

    {
      "mcpServers": {
        "monad-tools": {
          "command": "npx",
          "args": ["-y", "@unsorted-ai/mcp@latest"],
          "env": {
            "ALCHEMY_API_KEY": "YOUR_ALCHEMY_API_KEY",
          },
        },
      },
    }
    
  2. Restart or reload your Cursor workspace.

  3. In chat, ask something like:

    Get the portfolio for wallet addresses 0xABC... and 0xDEF...

    Cursor will automatically invoke the get_portfolio tool.

Project-Level Configuration

  1. Add this package to your project:

    npm install --save @unsorted-ai/mcp
    # or
    bun add @unsorted-ai/mcp
    
  2. In your project root, create (or open) .cursor/mcp.json:

    {
      "mcpServers": {
        "monad-tools": {
          "command": "node",
          "args": ["./node_modules/@unsorted-ai/mcp/dist/main.js"],
          "env": {
            "ALCHEMY_API_KEY": "YOUR_ALCHEMY_API_KEY",
          },
        },
      },
    }
    
  3. Restart or reload your Cursor workspace.

  4. In chat, ask something like:

    Get the portfolio for wallet addresses 0xABC... and 0xDEF...

    Cursor will automatically invoke the get_portfolio tool.

For more on Cursor's MCP setup, see "Configuring MCP Servers" in the Cursor docs.


Claude for Desktop

  1. Open Settings → Developer → Edit Config in Claude for Desktop.

  2. In claude_desktop_config.json, add:

    {
      "mcpServers": {
        "monad-tools": {
          "command": "npx",
          "args": ["-y", "@unsorted-ai/mcp@latest"],
          "env": {
            "ALCHEMY_API_KEY": "YOUR_ALCHEMY_API_KEY",
          },
        },
      },
    }
    
  3. Restart Claude. Click the 🔨 icon to see and run your tools.

For a step‑by‑step Claude guide, see the MCP quickstart for Claude Desktop users.


Local Development

Prerequisites

  • Bun v1+
  • (Optional) npm for some scripts

Environment Variables

Copy and configure your Alchemy key:

cp .env.example .env

Edit .env:

ALCHEMY_API_KEY=your-alchemy-api-key-here

MCP Configuration (.cursor/mcp.json)

For local testing:

{
  "mcpServers": {
    "monad-tools": {
      "command": "bun",
      "args": ["dist/main.js"],
    },
  },
}

Building & Running

Install dependencies:

bun install

Build the project:

bun run build

Start the development server:

bun start

Development Scripts

CommandDescription
bun run buildCompile src/main.tsdist/main.js
bun startRun the development server
bun testRun tests
bun run lintLint source via Biome
bun run formatFormat source via Biome
bun run checkRun Biome checks
bun run cleanRemove build artifacts

Tools Provided

  • get_portfolio

    • Description: Fetch on‑chain token balances for up to 2 wallet addresses. Modifies alchemy portfolio response to suit LLM use.

    • Input schema:

      {
        "walletAddresses": ["0x123...", "0x456..."]
      }
      

Scripts

CommandDescription
bun run buildCompile src/main.tsdist/main.js
bun startRun the built server
bun testRun tests
bun run lintLint source via Biome
npm run formatFormat source via Biome

Contributing

  1. Fork this repo
  2. git checkout -b feature/foo
  3. Make changes & git commit -m "Add foo"
  4. git push origin feature/foo
  5. Open a pull request

License

MIT © Unsorted AI