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

petri-labs-mcp

v0.1.1

Published

MCP server exposing the petri-labs emergent-systems simulations (origin, swarm, morph, market, social) as agent-callable, reproducible, statistically-tested experiments.

Downloads

46

Readme

petri-labs-mcp

A local Model Context Protocol server that lets an LLM agent run reproducible, statistically-tested experiments on the petri-labs emergent-systems simulations — the same engines and statistics the in-browser Hypothesis Labs use, exposed as agent-callable tools.

An agent states a hypothesis, maps it to a control vs treatment, calls run_experiment, and gets back a comparison with Wilcoxon / Mann-Whitney tests, Holm-Bonferroni correction, effect sizes (Cliff's delta / rank-biserial) and confidence intervals — deterministically. No account, no network, no GPU.

Models

| id | domain | what emerges | |----|--------|--------------| | origin | artificial life | neural-net organisms evolve, hunt, speciate | | swarm | collective intelligence | flocking / order from three local boid rules | | morph | pattern formation | Gray-Scott reaction-diffusion (spots, stripes, mazes) | | market | emergent economics | order-book agents → bubbles, crashes, fat tails | | social | opinion dynamics | consensus, polarization, echo chambers on networks |

Tools

  • list_models() — the available simulations.
  • describe_model({ model }) — tunable params (ranges + defaults), output metrics, valid primaryMetric values, presets, and run limits.
  • list_presets({ model }) — curated named regimes with their config.
  • run_simulation({ model, seed?, ticks?, sampleEvery?, config?, preset? }) — one deterministic trajectory: a sampled metric series + final aggregate metrics.
  • run_experiment({ model, control, treatment, primaryMetric, replicates?, ticks?, seedBase? }) — a replicated control-vs-treatment comparison with a full statistical report.

The server is pure and deterministic: the calling agent designs the experiment (control/treatment configs); the server runs it and reports the statistics. The same seedBase reproduces the same result.

Use it with an agent

Add it to your MCP client config (Claude Desktop, Claude Code, Cursor, …).

After it is published to npm:

{
  "mcpServers": {
    "petri-labs": { "command": "npx", "args": ["-y", "petri-labs-mcp"] }
  }
}

From a local checkout of the monorepo (build first: npm run build -w packages/mcp):

{
  "mcpServers": {
    "petri-labs": { "command": "node", "args": ["/abs/path/petri-labs/packages/mcp/dist/cli.js"] }
  }
}

Try it standalone with the MCP Inspector:

npm run build -w packages/mcp
npx @modelcontextprotocol/inspector node packages/mcp/dist/cli.js

Example agent flow

  1. describe_model({ model: "market" }) → learn the params (chartFrac, fundFrac, …) and metrics (volatility, kurtosis, maxDrawdown, …).
  2. Map a hypothesis ("more chartists → fatter tails") to a contrast.
  3. run_experiment({ model: "market", control: { chartFrac: 0.1 }, treatment: { chartFrac: 0.5 }, primaryMetric: "kurtosis", replicates: 20 }).
  4. Read the returned report: per-metric means + CIs, the test p-value, the Holm-corrected p, the effect size, and a plain-language verdict.

Notes

  • A statistical-significance caveat worth respecting: with simulations you can make the replicate count arbitrarily large, so p-values get cheap — read the effect size and its confidence interval, not just the p-value.
  • Part of petri-labs. Built by Baris Sozudogru. MIT.