Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@mastractl/server

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mastractl/server

mastractl server runtime — Hono API, agent registry, heartbeat engine, channel adapters.

latest
Source
npmnpm
Version
0.10.0
Version published
Maintainers
1
Created
Source

@mastractl/server

The mastractl server runtime — Hono API, agent registry, heartbeat engine, channel adapters (Telegram, Slack), and MCP control plane.

This package is published to npm so mastractl dev (the dockerless mode) can install and fork it without Docker.

Usage (dockerless)

# In your mastractl project:
npm install --save-dev @mastractl/server

# Run migrations:
node node_modules/@mastractl/server/db-migrate.mjs

# Start the server (or use `mastractl dev` which does both automatically):
node node_modules/@mastractl/server/dist/dev.js

Environment variables required:

  • DATABASE_URL — Postgres connection string
  • BETTER_AUTH_SECRET — 32-byte hex secret (generate with openssl rand -hex 32)
  • One LLM provider key: ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY, etc.

Extensibility config

Drop a mastractl.config.mjs at your project root to wire custom tools, routes, and lifecycle hooks:

/** @type {import("@mastractl/server").MastractlConfig} */
export default {
  // Inject tools into agents at boot time
  async onAgentBuild(spec, { companyId, env }) {
    if (!spec.capabilities?.includes("crm")) return {};
    // Return any Mastra-compatible tools Record
    return {};
  },

  // Mount custom Hono routes on the existing server
  onApp(app) {
    // app.route("/webhooks/stripe", stripeRoutes);
  },

  // Access the live Mastra instance after the server starts
  onReady({ mastra, logger }) {
    logger.info("server ready — wiring custom jobs");
  },
};

Pass the config path to the server via MASTRACTL_CONFIG env var (absolute path). mastractl dev detects and sets this automatically.

Packages

PackageDescription
@mastractl/serverThis package — server runtime
@mastractl/clientTypeScript SDK for talking to the server
@mastractl/agentAgentSpec types + custom agent adapter
@mastractl/sharedShared error types
mastractlCLI (mastractl dev, mastractl run, mastractl init, ...)
create-mastractlProject scaffolder

Requirements

  • Node.js >= 22.13.0
  • PostgreSQL >= 14

License

Apache-2.0 — see LICENSE.

Keywords

mastractl

FAQs

Package last updated on 19 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts