JSPM

@nexusai6/mcpmeter-wrapper

0.1.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 3
    • Score
      100M100P100Q41911F
    • License MIT

    MCP Meter wrapper for usage-based billing

    Package Exports

    • @nexusai6/mcpmeter-wrapper
    • @nexusai6/mcpmeter-wrapper/dist/index.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nexusai6/mcpmeter-wrapper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    @nexusai/mcpmeter-wrapper

    MCP Meter wrapper for usage-based billing of MCP servers.

    Installation

    npm install @nexusai/mcpmeter-wrapper

    Usage

    Wrap a single function

    import { withMetering } from "@nexusai/mcpmeter-wrapper";
    
    const myTool = withMetering(originalHandler, {
      apiKey: "mpk_your_api_key_here",
      serverId: "your_mcp_server_id",
    });

    Manual reporting

    import { reportCall } from "@nexusai/mcpmeter-wrapper";
    
    await reportCall(
      { apiKey: "mpk_your_api_key_here", serverId: "your_mcp_server_id" },
      "tool-name",
      150, // duration in ms
      { userId: "123" } // optional metadata
    );

    Configuration

    Option Required Default Description
    apiKey Yes - Your MCP Meter API key
    serverId Recommended - MCP Meter server ID. Required when using the default hosted endpoint.
    endpoint No https://useaimeter.com/api/servers MCP Meter API endpoint

    Features

    • Fail-safe design: If MCP Meter is down, your server keeps running
    • Zero latency impact: Async reporting, no blocking
    • Simple setup: One line of code to wrap any function