Commerce Layer

Commerce Layer

Interact with Commerce Layer Metrics API.

0
Stars
0
Forks
0
Releases

Overview

Commerce Layer Metrics MCP Server is a local MCP server implementation that provides tools to interact with the Commerce Layer Metrics API for data analysis. It enables extraction and aggregation of metrics from orders, carts and returns within your organization. The server supports four query types—breakdown, date breakdown, stats, and search— across three resources (orders, carts, returns). Breakdowns return computed metrics or statistics on a chosen field, grouped by another field; date breakdowns show date-by-date values over a time interval with an operator applied to a selected field; stats perform numeric computations on a field; searches return actual records with sorting, filtering, and pagination. The repository also describes a library of ready-to-use tools for common business scenarios such as identifying best-selling products by market, customers who bought a specific product, frequently bought together items, and other orders and returns insights. Deployment options include building from source with pnpm, generating a dist folder for a local server, and packaging as a Claude Desktop extension for easy installation and integration with AI agents.

Details

Owner
commercelayer
Language
TypeScript
License
Updated
2025-12-07

Features

Breakdown queries across orders, carts and returns

Aggregations that summarize data as metrics (or statistics) on a field, with the result returned aggregated by a second field.

Date breakdown queries

Time-based aggregations that show the frequency of a date value over a time interval, applying an operator to a selected field.

Stats queries

Numeric computations performed on a specific field of a resource, returning the computed value.

Search queries

Retrieves actual matching records with sorting, filtering and pagination; not an aggregation.

Multi-resource support

Queries operate across the three resources—orders, carts and returns—using the four query types.

Ready-made use-case toolkit

Library of common metrics scenarios such as best-selling products by market, customers who bought a specific product, and frequently bought together items.

Local deployment and packaging

Build from source with pnpm, generate the dist folder, and deploy a local MCP server for use with AI agents.

Claude Desktop extension packaging

Package as a Claude Desktop extension (mcpb) and install by uploading the bundle, then connect using client_id and client_secret.

Audience

Data analystsAnalyze orders, carts and returns metrics using the Metrics API via the MCP server.
Developers integrating with AI agentsConnect the local MCP server to Claude Desktop or other AI agents to query metrics data.
Business stakeholders / product teamsLeverage ready-made use cases to gain insights and support decision making.

Tags

Commerce LayerMetrics APIMCP Serverorderscartsreturnsdata analysisAI agent integration