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

@act-sdk/core

v3.0.1

Published

Action registry for building MCP-ready apps.

Readme

@act-sdk/core

Action registry for building MCP-ready apps.

What is this?

The core registry that lets you define actions with type-safe inputs. Actions can be called directly in your app OR exposed as MCP tools. Your existing functions become both internal logic and AI-accessible tools.

Installation

npm install @act-sdk/core zod

Works with Zod v3.25+ and v4.

Quick Start

import { createAct, defineConfig } from '@act-sdk/core';
import { z } from 'zod';

// 1. Create action registry
export const act = createAct();

// 2. Register actions — returns the handler function
export const getDoughnuts = act.action({
  id: 'getDoughnuts',
  description: 'Get doughnuts for a user',
  input: z.object({
    userId: z.string(),
    limit: z.number().optional(),
  }),
  handler: async ({ userId, limit }) => {
    return db.doughnuts.findMany({ 
      where: { userId }, 
      take: limit ?? 10 
    });
  },
});

// 3. Use directly in your app
await getDoughnuts({ userId: '123', limit: 5 });

// 4. Export config for MCP adapters
export default defineConfig({
  name: 'my-app',
  description: 'My app MCP server',
  version: '1.0.0',
  act,
});

API

createAct()

Creates an action registry.

const act = createAct();

act.action(def)

Register an action. Returns the handler function so you can call it directly.

export const myAction = act.action({
  id: 'myAction',
  description: 'Does something',
  input: z.object({ name: z.string() }),  // optional
  handler: async ({ name }, context) => {
    // context.authInfo available when called via MCP with auth
    return `Hello, ${name}!`;
  },
});

// Call it directly
await myAction({ name: 'Alice' });

act.getRegistry()

Access the internal registry.

const registry = act.getRegistry();

registry.all();      // Get all registered actions
registry.get(id);    // Get specific action by ID
registry.has(id);    // Check if action exists
registry.size();     // Number of registered actions

defineConfig(config)

Create a config object for MCP adapters.

export default defineConfig({
  name: 'my-app',
  description: 'My app description',
  version: '1.0.0',
  act,
});

Type Safety

Full TypeScript support with automatic inference:

const calculate = act.action({
  id: 'calculate',
  input: z.object({
    amount: z.number(),
    tax: z.number(),
  }),
  handler: async ({ amount, tax }) => {
    // amount and tax are typed as number
    return amount + (amount * tax);
  },
});

Authentication Context

When actions are called via MCP adapters with auth, they receive context:

act.action({
  id: 'getProfile',
  description: 'Get user profile',
  handler: async (args, context) => {
    // context.authInfo contains auth data from adapter
    const userId = context?.authInfo?.userId;
    return db.users.findOne({ id: userId });
  },
});

Related Packages

  • @act-sdk/mcp - Convert actions to MCP server
  • @act-sdk/adapters - STDIO and Next.js adapters