Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key

MCP Server Development

Learn how to set up local development and contribute to the Moralis MCP Server.

Development Setup

Clone Repository

git clone https://github.com/MoralisWeb3/moralis-mcp-server.git
cd moralis-mcp-server

Install Dependencies

npm install

Environment Setup

# Set your API key
export MORALIS_API_KEY="your_api_key_here"

Build Commands

Build the Server

npm run build

Development with Auto-rebuild

npm run watch

Debugging

MCP Inspector

The MCP Inspector provides a browser-based debugging interface:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

Note: Since MCP servers communicate over stdio, debugging can be challenging. The MCP Inspector is the recommended debugging tool.

Available Scripts

Based on the package.json, these are the standard development commands:

# Install dependencies
npm install

# Build the project
npm run build

# Watch for changes during development
npm run watch

# Start the MCP Inspector for debugging
npm run inspector

Project Structure

moralis-mcp-server/
├── src/ # Source code
├── dist/ # Built files
├── package.json # Project configuration
└── README.md # Documentation

Contributing

Getting Started

  1. Fork the repository
  2. Clone your fork locally
  3. Create a feature branch
  4. Make your changes
  5. Test your changes
  6. Submit a pull request

Resources

Testing Your Changes

Local Testing

# Build your changes
npm run build

# Test with your API key
export MORALIS_API_KEY="your_key"

# Run the server
npm start

Test with AI Client

Configure your AI client to use your local development version:

{
"mcpServers": {
"moralis-dev": {
"command": "node",
"args": ["/path/to/your/moralis-mcp-server/dist/index.js"],
"env": {
"MORALIS_API_KEY": "your_api_key"
}
}
}
}

Next Steps