Skip to main content

Moralis MCP工具

这个项目封装了Moralis Web3 Data API为MCP (Model Context Protocol) 工具,使得AI助手可以轻松访问区块链数据。

功能特点

  • 封装了Moralis EVM API的主要功能
  • 提供了简单易用的接口,用于查询区块链数据
  • 支持钱包、代币、NFT、交易等数据的获取
  • 支持域名解析服务

安装与配置

  1. 克隆此仓库
  2. 安装依赖:
    pip install -r requirements.txt
    
  3. 创建.env文件并设置Moralis API密钥:
    MORALIS_API_KEY=your_api_key_here
    

使用方法

启动MCP服务器:

python main.py

可用工具

本MCP服务器提供以下工具:

Wallet API

  • get_wallet_history: 获取钱包历史记录
  • get_wallet_token_balances: 获取钱包代币余额
  • get_native_balance: 获取钱包原生代币余额

NFT API

  • get_wallet_nfts: 获取钱包持有的NFT
  • get_nft_metadata: 获取NFT元数据

Token API

  • get_token_price: 获取代币价格
  • get_token_metadata: 获取代币元数据

区块链API

  • get_block: 获取区块信息
  • get_transaction: 获取交易信息

域名解析API

  • resolve_domain: 将域名解析为地址
  • resolve_address: 将地址解析为域名

示例用法

以下是一些示例用法,展示如何使用AI助手调用这些工具:

# 查询钱包ETH余额
get_native_balance(address="0x1234...")

# 获取NFT元数据
get_nft_metadata(address="0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB", token_id="3931")

# 查询ENS域名
resolve_domain(domain="vitalik.eth")

许可证

MIT

开发者

如需更多信息,请联系项目开发者。

Metadata

Release files for mcp-moralis 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mcp-moralis 0.2.0
File Interpreter ABI Platform
mcp_moralis-0.2.0-py3-none-any.whl Python 3 none any Details

Release files / mcp_moralis-0.2.0-py3-none-any.whl

Download URL mcp_moralis-0.2.0-py3-none-any.whl
Size 2.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86551ff6ee575b16397bb354100cdbe6af6a985887e34f8d1c2cbf06de82b1cb
BLAKE2b-256 checksum
How to use checksums
9745e69c2d9c0ff833abbe6f6186d1858d4c0c22948df54e09f783469a24f027
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for mcp-moralis 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page