Skip to main content

Add your description here

Project description

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

开发者

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_moralis-0.2.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file mcp_moralis-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mcp_moralis-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for mcp_moralis-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86551ff6ee575b16397bb354100cdbe6af6a985887e34f8d1c2cbf06de82b1cb
MD5 4748987f3a6997d0d59d2e42d3404ae8
BLAKE2b-256 9745e69c2d9c0ff833abbe6f6186d1858d4c0c22948df54e09f783469a24f027

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page