lp-crm-api
v0.1.1
Published
Read-only LP-CRM API client and MCP server
Maintainers
Readme
lp-crm-api
Read-only TypeScript client and MCP server for LP-CRM.
This package exposes only LP-CRM read endpoints. It is intended for AI assistants and internal tools that need to inspect orders, statuses, categories, and products without writing anything back to the CRM.
Features
- Typed LP-CRM client for form-encoded API requests.
- MCP stdio server with read-only tools.
- No write endpoints.
- Node.js 18+ and native
fetch. - Unit tests for request formatting, error handling, MCP routing, and read-only tool exposure.
Supported Endpoints
| LP-CRM endpoint | MCP tool |
| --- | --- |
| getStatuses.html | lpcrm_get_statuses |
| getOrdersIdByStatus.html | lpcrm_get_order_ids_by_status |
| getOrdersByID.html | lpcrm_get_orders_by_id |
| getCategories.html | lpcrm_get_categories |
| getProductsByCategory.html | lpcrm_get_products_by_category |
| getProduct.html | lpcrm_get_products_by_id |
| getOrdersIdByUser.html | lpcrm_get_order_ids_by_user |
Installation
Use directly with npx:
npx -y lp-crm-apiOr install globally:
npm install -g lp-crm-api
lp-crm-mcpConfiguration
| Variable | Required | Description |
| --- | --- | --- |
| LPCRM_BASE_URL | Yes | LP-CRM cabinet URL, for example https://example.lp-crm.biz |
| LPCRM_API_KEY | Yes | Outgoing/read API key |
| LPCRM_MIN_REQUEST_INTERVAL_MS | No | Minimum delay between LP-CRM requests from one MCP process; default is 1000 |
| LPCRM_MAX_RETRIES | No | Number of retries for LP-CRM HTTP 429 responses; default is 2 |
| LPCRM_RETRY_DELAY_MS | No | Retry delay when LP-CRM omits Retry-After; default is 2000 |
| LOG_LEVEL | No | debug, info, warn, or error; default is info |
The API key is sent as the LP-CRM key form parameter. Do not commit real keys into your repository.
The MCP server serializes LP-CRM requests from one process. If LP-CRM returns HTTP 429, the client retries after Retry-After when present, otherwise after LPCRM_RETRY_DELAY_MS.
MCP Configuration
With npx:
{
"mcpServers": {
"lp-crm": {
"command": "npx",
"args": ["-y", "lp-crm-api"],
"env": {
"LPCRM_BASE_URL": "https://your-account.lp-crm.biz",
"LPCRM_API_KEY": "your-read-key"
}
}
}
}With a local checkout:
{
"mcpServers": {
"lp-crm": {
"command": "node",
"args": ["/home/deniswhois/projects/lp-crm-api/dist/cli/index.js"],
"env": {
"LPCRM_BASE_URL": "https://your-account.lp-crm.biz",
"LPCRM_API_KEY": "your-read-key"
}
}
}
}Client Usage
import { createLpCrmClient } from 'lp-crm-api';
const client = createLpCrmClient({
baseUrl: process.env.LPCRM_BASE_URL!,
apiKey: process.env.LPCRM_API_KEY!,
});
const statuses = await client.getStatuses();
const orderIds = await client.getOrderIdsByStatus({ status: 3 });
const orders = await client.getOrdersById(orderIds.data?.slice(0, 10) ?? []);Direct client instances use the same retry and rate-limit defaults as the MCP server. Pass minRequestIntervalMs, maxRetries, or retryDelayMs to tune them; 0 disables the corresponding delay or retry count.
Tools
lpcrm_get_statuses
Get LP-CRM order statuses.
lpcrm_get_order_ids_by_status
Get order IDs by status.
Input:
{
"status": "3",
"dateStart": "2026-04-23",
"dateEnd": "2026-04-30"
}lpcrm_get_orders_by_id
Get order details by one or more order IDs. LP-CRM accepts up to 100 IDs per request.
Input:
{
"orderIds": ["15198557827"]
}lpcrm_get_categories
Get the LP-CRM product category tree.
lpcrm_get_products_by_category
Get products by category ID.
Input:
{
"categoryId": 1
}lpcrm_get_products_by_id
Get product details by one or more product IDs.
Input:
{
"productIds": [1, 2],
"statusIgnore": true
}statusIgnore: true sends status_ignore=1; false sends status_ignore=0.
lpcrm_get_order_ids_by_user
Get order IDs by LP-CRM user login.
Input:
{
"user": "admin",
"dateStart": "2026-04-23",
"dateEnd": "2026-04-30"
}Development
npm install
npm test
npm run type-check
npm run buildRun the MCP server locally:
LPCRM_BASE_URL=https://example.lp-crm.biz LPCRM_API_KEY=... npm run devLive Verification
The current implementation was checked against a test LP-CRM cabinet:
getStatuses.html: okgetOrdersIdByStatus.html: okgetOrdersByID.html: okgetCategories.html: okgetProductsByCategory.html: endpoint reachable; the tested cabinet returned "no products in category"getProduct.html: okgetOrdersIdByUser.html: ok
