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

@workspec/mcp-core

v0.1.0-alpha.5

Published

Shared MCP plumbing for WorkSpec Studio — assembling a low-level MCP Server from namespaced tool providers, mounting it stateless over Express, and running it over stdio. Zero domain knowledge, zero zod: tools advertise raw JSON Schema and self-validate t

Readme

@workspec/mcp-core

Shared MCP plumbing for WorkSpec Studio. This package has zero domain knowledge — it doesn't know what a decision, a catalog, or a cost is — and zero zod dependency. Its only job is wiring: turn a list of namespaced tool providers into a working MCP server, and expose that server over HTTP (mounted on an existing Express app) or stdio.

Why zod-agnostic

The MCP TypeScript SDK's high-level McpServer.registerTool API takes zod schemas and derives JSON Schema from them internally, which couples every tool's schema to whatever zod major version the SDK happens to bundle. @workspec/mcp-core avoids that by using the SDK's low-level Server class directly: tools advertise a plain JSON Schema object (Record<string, unknown>) and validate their own arguments however they like — with zod, with a hand-written check, or with a JSON Schema validator. Domain packages (@workspec/decision-studio, and future @workspec/cost-studio / @workspec/c4-studio providers) own the zod dependency and the schema-to-JSON-Schema generation; this package never sees a zod schema.

The contract

export interface McpToolDef {
  name: string; // module-local, must match /^[a-zA-Z0-9_]+$/
  title?: string;
  description: string;
  inputSchema: Record<string, unknown>; // a JSON Schema object, advertised on the wire
  handler: (args: unknown) => Promise<CallToolResult>; // self-validates its own args
}

export interface McpToolProvider {
  namespace: string;
  tools: McpToolDef[];
}

export function assembleMcpServer(
  providers: McpToolProvider[],
  info?: { name: string; version: string },
): Server;

export function mountMcpHttp(
  app: Express,
  server: Server,
  opts?: { path?: string; allowedHosts?: string[] },
): void;

export async function runMcpStdio(server: Server): Promise<void>;

Usage

import { assembleMcpServer, mountMcpHttp, runMcpStdio } from '@workspec/mcp-core';
import { createDecisionMcpProvider } from '@workspec/decision-studio';

const server = assembleMcpServer([createDecisionMcpProvider(repo)]);

// Mounted on an existing Express app, stateless, localhost-only:
mountMcpHttp(app, server);

// Or over stdio, for agents that spawn the CLI directly:
await runMcpStdio(server);

Every tool is registered under the wire name ${namespace}_${name} (e.g. decisions_read_catalog). Assembly throws immediately on an invalid name or a duplicate wire name — a naming collision is a programming error in how providers were composed, not something callers should have to handle at call time. A handler that throws unexpectedly is converted to an isError CallToolResult; it never crashes the server, and only Error#message is surfaced (never a stack trace).

HTTP transport notes

mountMcpHttp runs the MCP StreamableHTTPServerTransport in stateless mode (sessionIdGenerator: undefined) with DNS-rebinding protection enabled and allowedHosts defaulted to 127.0.0.1 / localhost. The SDK's low-level Server only supports one connected transport at a time, so requests to the mounted path are serialized: each request's transport is connected, handled, and closed before the next one connects. For the single-user, localhost-bound hosts this targets, that is not a meaningful limitation.