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

@codex-figma/bridge

v0.0.1

Published

Local HTTP bridge + MCP server that exposes the user's live Figma selection to Codex CLI.

Readme

Codex Figma Bridge — Local Bridge

Always-on HTTP server + MCP server that sits between the Figma plugin and Codex CLI.

Figma Plugin ──POST /selection──▶ Bridge ──MCP (POST /mcp)──▶ Codex CLI
                                  │
                                  └── caches to disk:
                                      current-selection.json
                                      nodes/<id>.json
                                      assets/<id>.{png,svg}

Run

npm install
npm start

Dev mode (hot reload):

npm run dev

HTTP endpoints

| Method + path | Purpose | |---------------|---------| | GET /health | Liveness + cache state. Returns { ok, version, capturedAt, fileKey, pageName, selectionCount, rootCount }. | | POST /selection | Receive a captured selection from the Figma plugin. Body validated against the zod schema in src/store/schema.ts. | | GET /events | Server-Sent Events stream of selection-change events. Useful for a future live-preview UI. | | POST /mcp | MCP Streamable HTTP — JSON-RPC requests (initialize, tools/call, etc.). | | GET /mcp | MCP SSE stream for server-initiated notifications (requires mcp-session-id header). | | DELETE /mcp | Close an MCP session. |

MCP tools

| Tool | Input | Output | |------|-------|--------| | get_selection | (none) | Latest selection summary. | | get_node | { nodeId, depth?, includeStyles?, includeVariables?, includeText? } | Serialized node tree. | | get_screenshot | { nodeId, format? } | PNG image content. | | get_asset | { nodeId, format? } | SVG (preferred) or PNG image content. | | list_nodes | { type?, name? } | Search hits. | | get_variables | { collectionName? } | Bound variable rows. |

Plus the MCP resource figma://selection/current.

Configuration

| Env var | Default | Notes | |---------|---------|-------| | CODEX_FIGMA_BRIDGE_PORT | 3845 | Port to listen on. | | CODEX_FIGMA_BRIDGE_HOST | 127.0.0.1 | Bind address. | | CODEX_FIGMA_BRIDGE_ROOT | OS cache dir + codex-figma-bridge | Cache directory. | | CODEX_FIGMA_BRIDGE_LOG_LEVEL | info | debug / info / warn / error. |

Architecture

The bridge is a thin Node.js http server with no external HTTP framework. State lives in three places:

  • ContextStore (src/store/context-store.ts) — in-memory mirror of the latest payload, with on-disk persistence under <root>/. The single source of truth for MCP tool reads.
  • SseBroadcaster (src/util/sse.ts) — fan-out for selection-change events.
  • McpRouteHandler (src/routes/mcp.ts) — per-session map of (sessionId → { transport, server }) for stateful MCP. The same ContextStore is shared across all sessions.

MCP transport is Streamable HTTP (stateful). Each Codex client gets one session id via the mcp-session-id header; the session lives until the client sends DELETE /mcp or the bridge restarts.

Testing

Smoke-test the bridge:

npm start &
sleep 1
curl http://localhost:3845/health
# → {"ok":true,"version":"0.1.0","capturedAt":null,...}

Inspect with the MCP Inspector:

npx @modelcontextprotocol/inspector http://localhost:3845/mcp