New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@anakin-io/mastra

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anakin-io/mastra

Anakin web data tools for Mastra agents: scrape, crawl, map, search, agentic research, Wire site actions, monitors and browser tasks

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
3
Created
Source

@anakin-io/mastra

Anakin tools for Mastra agents: scrape pages, map and crawl sites, search the web, run multi-source research, use Wire's pre-built site actions, watch pages with monitors, compare AI answer engines, and drive a cloud browser.

Each tool is a Mastra createTool() tool with Zod input and output schemas, so any Mastra agent can call it. The 22 tools match the Anakin MCP server one to one.

This is a community package maintained by Anakin, not by the Mastra team.

Install

npm install @anakin-io/mastra

Requires Node.js 22.13 or later and, as peer dependencies, @mastra/core 1.x and zod 3.25+ or 4.x (already in any Mastra project).

Get an API key (starts with ask_) from the Anakin dashboard. There is a free tier.

export ANAKIN_API_KEY="ask_..."

Usage

import { Agent } from '@mastra/core/agent';
import { createAnakinTools } from '@anakin-io/mastra';

export const researchAgent = new Agent({
  id: 'research-agent',
  name: 'Research Agent',
  instructions: 'Answer with facts from the web. Cite the pages you used.',
  model: 'anthropic/claude-sonnet-5',
  tools: createAnakinTools(),
});

createAnakinTools() reads ANAKIN_API_KEY from the environment. To pass the key yourself:

createAnakinTools({ apiKey: process.env.MY_ANAKIN_KEY });

Read-only agents

createAnakinReadOnlyTools() returns the 15 tools that only read data. It leaves out the 7 tools marked * below, which change something on a website or in your Anakin account.

import { createAnakinReadOnlyTools } from '@anakin-io/mastra';

const tools = createAnakinReadOnlyTools();

Fewer tools

A shorter tool list means a shorter prompt. Every tool has its own factory:

import { createAnakinCrawlTool, createAnakinSearchTool, createAnakinUrlScraperTool } from '@anakin-io/mastra';

const tools = {
  search: createAnakinSearchTool(),
  scrape: createAnakinUrlScraperTool(),
  crawl: createAnakinCrawlTool(),
};

Tools

Key in createAnakinTools()Tool idWhat it does
Web data
urlScraperanakin-url-scraperOne page as markdown, HTML, or AI-extracted JSON
searchanakin-searchWeb search: URLs, titles and snippets, returned immediately
mapanakin-mapEvery URL on a site, to decide what to crawl
crawlanakin-crawlMany pages of one site as markdown
agenticSearchanakin-agentic-searchResearch across many sources, as a summary plus structured data
Wire: pre-built site actions
wireDiscoveranakin-wire-discoverFind actions for a task, e.g. "top phones on walmart"
wireCataloganakin-wire-catalogEvery supported site, or one site's actions and their parameters
wireReadActionanakin-wire-read-actionRun an action that reads data
wireWriteActionanakin-wire-write-actionRun an action that changes something on the site *
wireIdentitiesanakin-wire-identitiesYour saved site logins
wireLoginanakin-wire-loginSign in to a site and get a credential *
wireBuildanakin-wire-buildRequest actions for a site Wire doesn't cover yet *
wireBuildStatusanakin-wire-build-statusProgress of those requests
Monitors
monitorCreateanakin-monitor-createWatch a page, a site, or a Wire action on a schedule *
monitorListanakin-monitor-listYour monitors, or one monitor's settings
monitorChangesanakin-monitor-changesChanges a monitor detected
monitorControlanakin-monitor-controlPause, resume, run now, or delete a monitor *
AI visibility
aiVisibilitySearchanakin-ai-visibility-searchAsk several AI answer engines the same question and compare
aiVisibilitySourcesanakin-ai-visibility-sourcesThe answer engines available
Browser
sessionListanakin-session-listSaved browser sessions, for pages behind a login
sessionDeleteanakin-session-deleteDelete a saved browser session *
browserTaskanakin-browser-taskAn AI agent that drives a real browser through a multi-step task *

* Changes state on a website or in your Anakin account. Left out of createAnakinReadOnlyTools(). Mastra tools have no read-only or destructive annotation, so each of these says so in its description. Only give them to agents that should be able to make those changes.

Monitor responses include an alertWebhookSecret. The monitor tools redact it so it never reaches the model's context; read it from the Anakin dashboard.

Options

Every factory takes the same optional config:

OptionDefaultWhat it does
apiKeyANAKIN_API_KEYYour Anakin API key, sent as the X-API-Key header
baseUrlhttps://api.anakin.io/v1API base URL
timeout30000Per-request timeout, in ms
pollIntervalMs2000First delay between job status checks, in ms
pollMaxIntervalMs10000Cap on the exponential backoff between checks, in ms
pollTimeoutMs120000How long to wait for an async job before giving up, in ms

Scrapes, maps, crawls, agentic searches, AI visibility searches, Wire jobs and browser tasks are asynchronous on Anakin's side. The tools submit the job and poll until it finishes. A browser task can run for several minutes, so raise pollTimeoutMs for it:

import { createAnakinBrowserTaskTool } from '@anakin-io/mastra';

const browserTask = createAnakinBrowserTaskTool({ pollTimeoutMs: 360_000 });

Errors

A failed request throws an Error with the API's message (for example Invalid or inactive API key for a 401). Mastra passes the message back to the model.

StatusMeaning
400Invalid parameters
401Invalid API key
402Plan upgrade required
429Rate limit exceeded
5xxServer error, retry with backoff

Development

npm ci
npm run typecheck && npm run lint && npm test && npm run build
npm run smoke   # real @mastra/core, live API call if ANAKIN_API_KEY is set

Releases are published from GitHub Actions with npm provenance when a v* tag is pushed. See CHANGELOG.md.

License

Apache-2.0

Keywords

mastra

FAQs

Package last updated on 14 Oct 2026

Related posts