
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
@mastractl/server
Advanced tools
mastractl server runtime — Hono API, agent registry, heartbeat engine, channel adapters.
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.
# 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 stringBETTER_AUTH_SECRET — 32-byte hex secret (generate with openssl rand -hex 32)ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY, etc.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.
| Package | Description |
|---|---|
@mastractl/server | This package — server runtime |
@mastractl/client | TypeScript SDK for talking to the server |
@mastractl/agent | AgentSpec types + custom agent adapter |
@mastractl/shared | Shared error types |
mastractl | CLI (mastractl dev, mastractl run, mastractl init, ...) |
create-mastractl | Project scaffolder |
Apache-2.0 — see LICENSE.
FAQs
mastractl server runtime — Hono API, agent registry, heartbeat engine, channel adapters.
We found that @mastractl/server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.