npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@iqai/mcp-near

v0.1.2

Published

Mcp server for Near

Readme

🌊 NEAR MCP Server

npm version License: ISC

📖 Overview

The NEAR MCP Server enables AI agents to interact with the NEAR Protocol blockchain. This server provides smart contract interaction, transaction handling, and event listening capabilities with AI-driven processing.

By implementing the Model Context Protocol (MCP), this server allows Large Language Models (LLMs) to monitor blockchain events, process them with AI intelligence, and respond back to smart contracts, bridging the gap between AI and decentralized applications.

✨ Features

  • Event Watching: Monitor NEAR smart contracts for specific events in real-time.
  • AI-Driven Processing: Automatically process blockchain events with AI and send responses back to contracts.
  • Subscription Management: Manage multiple event subscriptions with detailed statistics.
  • Flexible Configuration: Customizable polling intervals, response methods, and network settings.

📦 Installation

🚀 Using npx (Recommended)

To use this server without installing it globally:

npx @iqai/mcp-near

🔧 Build from Source

git clone https://github.com/IQAIcom/mcp-near.git
cd mcp-near
pnpm install
pnpm run build

⚡ Running with an MCP Client

Add the following configuration to your MCP client settings (e.g., claude_desktop_config.json).

📋 Minimal Configuration

{
  "mcpServers": {
    "near": {
      "command": "npx",
      "args": ["-y", "@iqai/mcp-near"],
      "env": {
        "ACCOUNT_ID": "your-account.near",
        "ACCOUNT_KEY": "ed25519:your_private_key_here"
      }
    }
  }
}

⚙️ Advanced Configuration (Local Build)

{
  "mcpServers": {
    "near": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-near/dist/index.js"],
      "env": {
        "ACCOUNT_ID": "your-account.near",
        "ACCOUNT_KEY": "ed25519:your_private_key_here",
        "NEAR_NETWORK_ID": "mainnet",
        "NEAR_NODE_URL": "https://rpc.mainnet.near.org"
      }
    }
  }
}

🔐 Configuration (Environment Variables)

| Variable | Required | Description | Default | | :--- | :--- | :--- | :--- | | ACCOUNT_ID | Yes | Your NEAR account ID for authentication | - | | ACCOUNT_KEY | Yes | Private key for your NEAR account (ed25519: or secp256k1: format) | - | | NEAR_NETWORK_ID | No | NEAR network ("mainnet", "testnet", "betanet") | mainnet | | NEAR_NODE_URL | No | Custom NEAR RPC endpoint | - | | NEAR_GAS_LIMIT | No | Gas limit for transactions | - |

💡 Usage Examples

🔔 Event Watching

  • "Watch for 'run_agent' events on contract oracle.near"
  • "Start monitoring price_request events on my-contract.testnet"
  • "Set up a listener for transfer events with 5-second polling"

📊 Subscription Management

  • "List all my active event subscriptions"
  • "Show statistics for my event watchers"
  • "Stop watching events on contract oracle.near"

🤖 AI-Driven Workflows

  • "Process incoming oracle requests and respond with AI analysis"
  • "Monitor for user queries and provide intelligent responses"

🛠️ MCP Tools

👨‍💻 Development

🏗️ Build Project

pnpm run build

👁️ Development Mode (Watch)

pnpm run watch

✅ Linting & Formatting

pnpm run lint
pnpm run format

🧪 Running Tests

pnpm test

📁 Project Structure

  • src/tools/: Individual tool definitions
  • src/services/: Event watcher, auth manager, and business logic
  • src/types.ts: TypeScript type definitions
  • src/index.ts: Server entry point

🔄 AI-Driven Event Processing Workflow

The server enables an "AI in the loop" workflow:

  1. 🔗 Smart contract transaction triggers an event and pauses execution
  2. 🤖 MCP server detects the event and requests AI processing from the client
  3. 🧠 AI client processes the event data and provides intelligent response
  4. ↩️ Server sends AI response back to blockchain via transaction
  5. ✅ Original smart contract resumes with the AI-provided data

📚 Resources

⚠️ Disclaimer

This project interacts with the NEAR blockchain and requires private keys for transaction signing. Users should exercise caution, secure their credentials, and verify all transactions independently. Blockchain operations involve risk and may incur gas fees.

📄 License

ISC