nearblocks-mcp

nearblocks-mcp

Read-only MCP server for NEAR blockchain wallet data, providing account summaries, transaction history, token transfers, and activity reports via the NearBlocks API.

Category
访问服务器

README

nearblocks-mcp

A small, remote MCP server that exposes read-only NEAR on-chain wallet data by wrapping the public NearBlocks API. It speaks MCP over Streamable HTTP, so it has a plain https://…/mcp URL — which is exactly what the Agents Market connector model ("Private MCP servers") expects.

Why this exists: NEAR RPC (and RPC-based tools like near-mcp) only expose an account's current state, never its transaction history — history lives in an indexer. NearBlocks is that indexer. This server makes it available to marketplace agents (e.g. wallet-activity-lookup) as a proper HTTPS connector, converting raw chain units to human values and stripping the bulky base64 token icons before anything reaches the model.

Tools

All tools take accountId (e.g. alice.near, a .tg name, or a 64-char implicit address) and an optional network (mainnet default, or testnet). All are read-only.

Tool What it returns
near_account_summary Current NEAR balance, staked amount, creation date/age, deletion status.
near_account_transactions Paginated tx history (hash, ISO time, from/to, success, actions + NEAR deposits).
near_account_activities Balance-change feed: direction (in/out), counterparty, cause, time.
near_account_ft_transfers Fungible-token transfers: symbol, human amount, direction, counterparty, time.
near_account_inventory Current holdings: FT balances + NFT contracts held now.
near_wallet_activity_summary One-shot report — fetches state + a bounded window of txns/FT transfers/holdings and returns an aggregated, unit-converted summary (balance, in/out counts, NEAR value flow, top counterparties, top methods/contracts, token totals, holdings).

Paginated tools accept perPage (1–50, default 25), cursor (from the previous response), and order (desc/asc). near_wallet_activity_summary accepts txPages (1–4, default 2). Figures in the summary cover the retrieved recent window, not the account's lifetime — the response says so explicitly.

Run locally

Requires Node ≥ 20.

npm install
npm run build
cp .env.example .env      # optionally set NEARBLOCKS_API_KEY; leave MCP_AUTH_TOKEN empty for local dev
npm start                 # POST http://localhost:8080/mcp  ·  GET /health

Environment

Var Required Purpose
PORT no (default 8080) HTTP listen port (Railway/Fly inject this).
MCP_AUTH_TOKEN in production Bearer token callers must send: Authorization: Bearer <token>. Empty = unauthenticated (dev only; logs a warning).
NEARBLOCKS_API_KEY no Raises NearBlocks rate limits. Works keyless at the free-tier limit. Server-side only.
NEAR_DEFAULT_NETWORK no (default mainnet) Network used when a tool call omits network.

Deploy

Any host that runs a container and gives you an HTTPS URL works (Railway, Fly, Render, …).

docker build -t nearblocks-mcp .
docker run -p 8080:8080 -e MCP_AUTH_TOKEN=$(openssl rand -hex 32) nearblocks-mcp

Set MCP_AUTH_TOKEN (and optionally NEARBLOCKS_API_KEY) as service secrets. Your MCP URL is https://<your-host>/mcp.

Wire it into the Agents Market

  1. Deploy this server and copy its https://<host>/mcp URL and the MCP_AUTH_TOKEN.

  2. On the platform, Building → Connectors → add a server:

    • url: https://<host>/mcp
    • auth: static_token, header empty (⇒ Authorization: Bearer), token = your MCP_AUTH_TOKEN
  3. In an agent's agent.yaml, tick it under private_mcp_servers:

    private_mcp_servers:
      - name: nearblocks
        url: https://<host>/mcp
        auth: static_token
        description: NearBlocks MCP — read-only NEAR wallet state, history, transfers, holdings.
    

The wallet-activity-lookup agent is the intended first consumer: it can call near_wallet_activity_summary in a single tool round instead of hitting the REST API by hand.

MCP details

  • Transport: Streamable HTTP, stateless (a fresh server + transport per request — no session state to lose, ideal for a horizontally-scaled connector).
  • Endpoint: POST /mcp. GET/DELETE /mcp return 405 (no server-initiated streams in stateless mode). GET /health and GET / are unauthenticated.

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选