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

@opencommerceprotocol/bridge-mcp

v1.0.0

Published

Open Commerce Protocol — MCP (Model Context Protocol) server bridge

Downloads

68

Readme

@opencommerceprotocol/bridge-mcp

MCP (Model Context Protocol) server bridge for the Open Commerce Protocol. Exposes all OCP tools as MCP tools — compatible with Claude Desktop, Cursor, and any MCP-enabled agent.

Installation

npm install @opencommerceprotocol/bridge-mcp

Quick Start

import { createMCPServer } from '@opencommerceprotocol/bridge-mcp';

const { server, start } = await createMCPServer({
  ocpManifest: 'https://mystore.com/.well-known/ocp.json',
  transport: 'stdio',
});

await start();  // connects via stdio (for Claude Desktop / Cursor)

createMCPServer(config)

Returns Promise<{ server: Server; start: () => Promise<void> }>.

MCPBridgeConfig

| Option | Type | Required | Description | |--------|------|----------|-------------| | ocpManifest | OCPManifest \| string | Yes | Manifest object or URL | | handlers | Partial<OCPHandlers> | No | Custom tool handler implementations | | transport | 'stdio' \| 'sse' | No | Transport type (default: 'stdio') | | name | string | No | Server name (default: derived from manifest) |

Use Cases

Catalog-only (no handlers needed)

If your store has a product feed but no cart/checkout API, the bridge automatically searches the feed:

const { start } = await createMCPServer({
  ocpManifest: 'https://mystore.com/.well-known/ocp.json',
  // No handlers needed — search_products reads from the feed URL in the manifest
});

await start();

Full store with cart and checkout

const { start } = await createMCPServer({
  ocpManifest: manifest,
  handlers: {
    search_products: async ({ query, category, limit }) => {
      const res = await fetch(`/api/products?q=${query}&category=${category}&limit=${limit}`);
      return res.json();
    },
    get_product: async ({ id }) => {
      const res = await fetch(`/api/products/${id}`);
      return res.json();
    },
    add_to_cart: async ({ product_id, quantity }) => {
      const res = await fetch('/api/cart', {
        method: 'POST',
        body: JSON.stringify({ product_id, quantity }),
      });
      return res.json();
    },
    begin_checkout: async ({ prefill }) => {
      const res = await fetch('/api/checkout', {
        method: 'POST',
        body: JSON.stringify(prefill),
      });
      return res.json();
    },
  },
});

await start();

Load manifest from file

import { readFileSync } from 'fs';
import type { OCPManifest } from '@opencommerceprotocol/spec';

const manifest = JSON.parse(readFileSync('.well-known/ocp.json', 'utf-8')) as OCPManifest;

const { start } = await createMCPServer({ ocpManifest: manifest });
await start();

Tool Schemas

The bridge maps all 11 OCP tools to MCP tool definitions with matching input schemas:

| OCP Tool | MCP Input Parameters | |----------|---------------------| | search_products | query, category, min_price, max_price, in_stock, limit | | get_product | id (required) | | get_product_qa | id (required), question | | compare_products | ids[] (required, min 2), attributes[] | | add_to_cart | product_id (required), quantity (required), variant_id, agent_context | | get_cart | (no params) | | update_cart | items[] with product_id, quantity | | begin_checkout | prefill, callback_url, agent_context | | check_availability | id (required), location, quantity | | check_checkout_status | session_id (required) | | get_promotions | product_id, category |

Only tools listed in manifest.interact.tools are exposed. If interact.tools is not set, all 11 tools are exposed.

Claude Desktop Configuration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "mystore": {
      "command": "node",
      "args": ["/path/to/mcp-bridge.js"]
    }
  }
}

mcp-bridge.js:

import { createMCPServer } from '@opencommerceprotocol/bridge-mcp';
const { start } = await createMCPServer({
  ocpManifest: 'https://mystore.com/.well-known/ocp.json',
});
await start();

CLI Alternative

Generate and run the bridge without writing code:

npx @opencommerceprotocol/cli bridge --protocol mcp --manifest .well-known/ocp.json