Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tool to purchase heurist credits #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tsubasakong
Copy link

Description

This PR adds support for purchasing Heurist API credits for AI model services (https://docs.heurist.ai/dev-guide/supported-models) directly on Base chain from Base MCP. Users can now use USDC, HEU, or WETH tokens on Base chain to buy Heurist AI API credits (https://www.heurist.ai/credits) using their connected wallet inside this MCP.

The implementation includes:

  • A new MCP tool (buy_heurist_credits) for Claude
  • Support for multiple tokens (USDC, HEU, WETH)
  • Safety checks for minimum purchase amounts
  • Detailed error handling and user feedback
  • Transaction validation and receipt confirmation

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Tested the integration with the Heurist contract on Base mainnet
  • Verified token approval and purchase transactions complete successfully
  • Confirmed credit allocation appears in Heurist dashboard after purchase
  • Tested error handling for insufficient balances and rejected transactions

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant