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 toolsAdding 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:
Add the tool to its categoryβs
registerXToolsfunction
// 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}` }],
};
}
);
}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 π§ͺ
Build the project after making changes:
Test your tools by selecting the local setup option for the following commands:
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