Project Structure

The codebase is organized into modular components:

src/
β”œβ”€β”€ index.ts                # Main entry point
β”œβ”€β”€ tools/                  # All tools organized by category
β”‚   β”œβ”€β”€ common.ts           # Shared utilities and configs
β”‚   β”œβ”€β”€ index.ts            # Tool registration
β”‚   β”œβ”€β”€ accountAnalysis/    # Account analysis tools
β”‚   β”œβ”€β”€ chainData/          # Chain data tools
β”‚   β”œβ”€β”€ contractInteraction/# Contract interaction tools
β”‚   β”œβ”€β”€ crossChain/         # Cross-chain tools
β”‚   β”œβ”€β”€ development/        # Development tools
β”‚   β”œβ”€β”€ batchOperations/    # Batch operation tools
β”‚   └── stylus/             # Stylus development tools

Adding New Tools πŸ› οΈ

Arbitrum MCP Tools uses an active registration pattern – every tool is registered at runtime with server.tool(...). To add a new tool you need to:

  1. Add the tool to its category’s registerXTools function

// src/tools/myCategory/index.ts
import { z } from "zod";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";

export function registerMyCategoryTools(server: McpServer) {
  server.tool(
    "myNewTool", // unique name
    "Short description of what it does", // description
    {
      param1: z.string().describe("Example parameter"),
    },
    async ({ param1 }) => {
      // TOOL LOGIC ‡️
      return {
        content: [{ type: "text", text: `You sent ${param1}` }],
      };
    }
  );
}
  1. Hook the category into the global registry

Add (or update) the import in src/tools/index.ts and call the register function inside registerAllTools:

That’s it – when the MCP server starts, every registerXTools function runs and your new tool becomes available immediately.


Testing Your Tools πŸ§ͺ

  1. Build the project after making changes:

  1. Test your tools by selecting the local setup option for the following commands:

  1. If you're making significant changes, consider updating the setup scripts to ensure they handle your new tools correctly.

Contributing πŸ™Œ

Contributions are welcome! Please feel free to submit a Pull Request.

License πŸ“œ

This project is licensed under the MIT License - see the LICENSE file for details.

Last updated