Skip to main content
Glama

Moralis MCP Server

Official
by MoralisWeb3

铁匠徽章

🧠 概述

Moralis MCP 服务器是一个本地或云部署引擎,它将自然语言提示与真实的区块链洞察相连接——允许 AI 模型查询钱包活动、代币指标、dapp 使用情况等,而无需自定义代码或 SQL。

该服务器建立在模型上下文协议之上,使 LLM 能够轻松地以一致、可解释和可扩展的方式与 Moralis API 对话。

  • 🔗 完全可插入:交换 LLM、自定义检索逻辑或使用您自己的工具进行扩展
  • 🧱 与 OpenAI、Claude 和开源模型兼容
  • 🧠 为代理、开发者工具、机器人、仪表板等提供支持

⚙️ 常见用例

  • 🤖 人工智能代理和助手:“这个钱包的交易历史是什么?”
  • 📈 Devtools:链上 QA、测试、CLI 集成
  • 📊 仪表板:将自然语言转化为图表/数据
  • 📉 监控:代币/dapp 的警报和汇总
  • 🧠 交易机器人:以法学硕士 (LLM) 为主导的策略,具有真正的区块链基础

🔐 获取 API 密钥

要将此 MCP 服务器与 Moralis API 一起使用,您需要一个 API 密钥:

  1. 前往Moralis开发者门户
  2. 注册并登录
  3. 从主菜单导航到您的API 密钥页面
  4. 复制您的密钥并在您的配置文件中配置它(参见下一部分),或在您的环境中进行设置:
export MORALIS_API_KEY=<your_api_key>

⚠️ 注意:部分功能和端点需要 Moralis 付费套餐。如需完整访问权限和生产级性能,我们建议您注册付费套餐。

🚀 与客户端一起使用

要将 MCP 服务器连接到兼容客户端(例如 Claude Desktop、OpenAI 兼容代理、VS Code 扩展等),请将客户端配置为将服务器作为子进程启动。

大多数客户端都支持简单的配置文件 - 例如,您可以在客户端的配置目录中创建一个类似 mcp.json 的文件,内容如下:

{ "mcpServers": { "serverName": { "command": "npx @moralisweb3/api-mcp-server", "args": [], "env": { "MORALIS_API_KEY": "<YOUR_API_KEY>" } } } }

此设置可适用于任何支持 MCP 服务器的客户端。请将示例值替换为您的具体用例值。

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Moralis API 服务器:

npx -y @smithery/cli install @MoralisWeb3/moralis-mcp-server --client claude

🖥️ 用作服务器

服务器接受可选的--transport参数来指定传输类型。可用的传输类型包括:

  • stdio :通过标准输入/输出进行通信(默认)。
  • web :启动 HTTP 服务器进行通信。
  • streamable-http :启动具有可流式传输端点的 HTTP 服务器。

示例

  1. 使用默认的stdio传输
moralis-api-mcp --transport stdio
  1. 使用web传输
moralis-api-mcp --transport web

这将启动一个 HTTP 服务器。您可以使用curl或 Postman 等工具向服务器发送请求。

  1. 使用streamable-http传输
moralis-api-mcp --transport streamable-http

这将启动一个 HTTP 服务器。您可以使用curl或 Postman 等工具向服务器发送请求。

笔记

  • 确保在启动服务器之前设置所需的环境变量(例如, MORALIS_API_KEY )。
  • 对于自定义配置,您可以根据需要传递额外的参数或环境变量。
  • 有关每种传输类型的更多详细信息,请参阅文档。

🛠 开发

安装依赖项:

npm install

构建服务器:

npm run build

对于使用自动重建的开发:

npm run watch

🐞 调试

由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们推荐使用MCP Inspector ,它以包脚本的形式提供:

npm run inspector

检查器将提供一个 URL 来访问浏览器中的调试工具。

💬 示例提示

以下是您可以通过 MCP 服务器与 AI 代理一起使用的一些示例提示:

- What’s the current price of PEPE and Ethereum? - What is the current trading sentiment for TOSHI on Base — bullish or bearish? - Show me the NFTs owned by `vitalik.eth` on Base. - What tokens does wallet `0xab71...4321` hold? - When was wallet 0xabc...123 first and last seen active on Ethereum, Base, and Polygon? - Show me the complete transaction history for 0xabc...123 across Ethereum, Base, and BNB Chain. - What is the current net worth in USD of wallet 0xabc...123? - Find wallet addresses that are likely associated with Coinbase. - Analyze the current holder distribution of SPX6900 — include whales, small holders, and recent growth trends. - Show me PEPE’s daily OHLC data for the past 30 days and provide a summary of the trend — is it bullish or bearish?

这些提示使用 MCP 方法注册表进行解析并映射到结构化的 Moralis API 调用。

💡 您还可以根据任何支持的方法构建自定义提示。

📚 API 参考

Moralis MCP 服务器将用户输入的指令封装并转换为 Moralis REST API 调用。您可以在此处探索底层 API 接口:

🔗 Moralis Swagger 文档(v2.2)

本文档涵盖以下端点:

  • 代币定价
  • 钱包活动
  • NFT 元数据和所有权
  • 转账和交易
  • 以及更多
Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Moralis REST API 的 TypeScript 包装器,可通过模型上下文协议 (MCP) 与区块链数据进行交互。

  1. ⚙️ 常见用例
    1. 🔐 获取 API 密钥
      1. 🚀 与客户端一起使用
        1. 通过 Smithery 安装
      2. 🖥️ 用作服务器
        1. 示例
        2. 笔记
      3. 🛠 开发
        1. 🐞 调试
      4. 💬 示例提示
        1. 📚 API 参考

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A TypeScript-based Model Context Protocol (MCP) server enabling integration with PiAPI for media content generation using platforms like Midjourney, Flux, and others through MCP-compatible applications.
            Last updated -
            1
            54
            TypeScript
            MIT License
            • Apple
          • A
            security
            F
            license
            A
            quality
            Enables interaction with Trello boards, lists, and cards through Model Context Protocol (MCP) tools, leveraging TypeScript for type safety and asynchronous operations.
            Last updated -
            5
            1
            JavaScript
          • -
            security
            F
            license
            -
            quality
            A Model Context Protocol server that converts Solidity bytecode into functional server implementations, allowing interaction with blockchain contracts through a RESTful API.
            Last updated -
            3
            Python
          • A
            security
            F
            license
            A
            quality
            A TypeScript implementation of a Model Context Protocol server providing read-only access to Lithic banking and card services API.
            Last updated -
            2
            1
            JavaScript

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/MoralisWeb3/moralis-mcp-server'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server