Chat with Claude & NEAR MCP & HoS Contract

Agent:

Hello. How can I help you?

How does the AI Governance Agent work?

This application integrates Anthropic's Claude AI with the NEAR blockchain through a custom Multi-Contract Provider (MCP). It's designed to make decentralized governance more accessible and intuitive.

Architecture Overview:
  • Frontend: Built with Next.js and connected to a NEAR wallet using Wallet Selector (MyNearWallet).
  • AI Agent: Claude Sonnet model, connected via SDK and enriched through a Glama-hosted MCP.
  • Blockchain Access: The MCP queries NEAR smart contracts and feeds structured data to Claude at runtime.

What the agent can do today:
  • List active proposals from the governance contract.
  • Summarize proposal details, options, and voting status.
  • Generate a valid JSON payload to vote on a proposal.
  • Detect and suggest if quorum is reached or action is required.
  • Explain NEAR-specific terms like staking, veNEAR, delegation, etc.
  • Guide users through governance workflows in natural language.

How it works:
  1. You type a question (e.g. “How do I vote on proposal #2?”).
  2. The message is routed through the MCP, which queries NEAR contracts and attaches the data.
  3. Claude uses that data to generate a contextual, intelligent response.
  4. If a structured payload is returned, the frontend detects it and lets you confirm the action with your wallet.

Security model:
  • Claude has read-only access to smart contract data via the MCP.
  • All transactions are signed by the user using their own NEAR wallet.
  • No private keys are exposed or handled by the AI or backend.

This agent is modular and extensible. While it currently supports testnet contracts for proposals and voting, it can be extended to handle:
  • Delegation workflows (e.g. stake, unstake, delegate to validators)
  • Token-related actions (view balances, metadata, etc.)
  • Governance simulations, summaries, and multi-language support