@tradly/mcp
v1.0.1
Published
MCP server for Tradly Headless API
Downloads
82
Readme
Tradly MCP Server
An MCP (Model Context Protocol) server that connects the Tradly Marketplace API with MCP-compatible clients such as ChatGPT Desktop, Claude Desktop, Codex, and other MCP hosts.
This package makes it easy to query products, categories, accounts, reports, and a much broader set of Tradly admin and commerce endpoints directly inside your MCP-enabled environment.
Features
- MCP-compatible server for Tradly.
- Fetch products and product details.
- Get listing categories.
- Search accounts and stores.
- Create listings and blog posts when write access is enabled.
- Search users, fetch user details, and send email from the same MCP surface.
- Create and manage collections for curated content workflows.
- Manage coupons when the tenant supports the coupon endpoint.
- Reach additional Tradly endpoints through the generic
tradly_requesttool when you need raw access to an Istanbul-style endpoint that is not wrapped yet. - OAuth bearer-token authentication or a Tradly
x-auth-keysession token. - Node.js 18+ ready.
- Stdio MCP server for local MCP clients.
- HTTP MCP server for hosted deployments.
- Streamable HTTP and legacy SSE transport support.
- OAuth discovery endpoints for hosted clients.
Installation
npm install -g @tradly/mcpLocal Stdio Usage
Before running, set your Tradly API access token. Use a server-side Tradly bearer token or Tradly x-auth-key session token for local stdio usage.
Keys can be found in your Tradly SuperAdmin under Settings/API.
export TRADLY_API_KEY=your_tradly_access_token
@tradly/mcpIf everything is set up correctly, the process starts on stdio and logs:
Tradly MCP server running on stdioConnect To An MCP Client
Add this to your MCP client config:
{
"servers": {
"tradly": {
"command": "@tradly/mcp",
"env": {
"TRADLY_API_KEY": "your_tradly_access_token"
}
}
}
}Restart your MCP client, then ask natural-language questions such as:
- "Get categories from Tradly"
- "Search accounts for electronics stores"
- "Find products matching milk"
- "Create a test listing in my Tradly store"
Hosted HTTP Usage
Run locally:
npm install
npm run start:httpThe HTTP MCP endpoint is:
http://localhost:3000/api/mcpProduction manifest endpoint:
https://mcp.tradly.app/.well-known/mcp/manifest.jsonEnvironment Variables
TRADLY_API_KEY: Tradly access token used by stdio mode.TRADLY_AUTH_KEY: Optional Tradlyx-auth-keysession token override for stdio mode.TRADLY_BASE_URL: Tradly app/API base URL. Defaults tohttps://api.tradly.app.TRADLY_OAUTH_BASE_URL: Tradly OAuth base URL. Defaults tohttps://skua.tradly.app.TRADLY_EMAIL_AUTH_KEY: Auth key used by the email utility endpoint. Falls back toTRADLY_API_KEYwhen unset.SENTRY_DSN: Optional Sentry DSN to enable error reporting.SENTRY_ENVIRONMENT: Optional Sentry environment name.SENTRY_TRACES_SAMPLE_RATE: Optional tracing sample rate between0and1.SENTRY_RELEASE: Optional release identifier for Sentry.TRADLY_CLIENT_ID: OAuth client ID for hosted callback token exchange.TRADLY_CLIENT_SECRET: OAuth client secret for hosted callback token exchange.TRADLY_REDIRECT_URI: OAuth redirect URI for hosted callback token exchange.PORT: HTTP server port. Defaults to3000.LOG_MCP_REQUESTS: Set tofalseto disable HTTP MCP request logs.MCP_LOG_LEVEL: Log level for structured MCP logs. Defaults toinfo.MCP_LOG_FORMAT: Set toprettyfor human-readable console logs. Defaults to JSON lines.MCP_LOG_FILE: Optional file path for persisted JSONL logs.MCP_LOG_FILE_MAX_BYTES: Maximum size in bytes before rotatingMCP_LOG_FILE. Defaults to5242880.MCP_LOG_FILE_MAX_BACKUPS: Number of rotated log files to keep. Defaults to3.MCP_LOG_VIEWER: Set tofalseto disable the local browser log viewer.
Logs are written to stderr so stdio MCP clients do not receive protocol-breaking output on stdout.
Local Log Viewer
When running the HTTP server locally, open:
http://localhost:3000/logsThe page polls the recent log buffer and listens to /api/logs/stream for live updates.
Tools
The following tools are available once connected to an MCP client.
get_products
Fetch products/listings from the marketplace.
Parameters:
pagenumber, default1per_pagenumber, default30price_fromnumber, optionalprice_tonumber, optionalsearch_keystring, optionalsortstring, optionalcategory_idstring, optionalaccount_idstring, optionalattribute_value_idstring, optional
get_product_details
Get details for a specific product/listing.
Parameters:
listingIdstring, required
search_accounts
Search accounts/stores in the marketplace.
Parameters:
pagenumber, default1typestring, defaultaccountsper_pagenumber, default20category_idstring, optionaluser_idstring, optionalsearch_keystring, optionallatitudenumber, optionallongitudenumber, optionalmax_distancenumber, optionalstatusnumber, optional
get_categories
Fetch available categories.
Parameters:
typestring, defaultlistingsparentstring, default0
create_listing
Create a new product listing.
Required parameters:
titledescriptionpricecategory_idaccount_id
Optional parameters include currency_id, images, stock, offer_percent, coordinates, type, order_type, and attributes.
create_blog_post
Create a blog post using the Layers API.
Required parameters:
titlecontent
Optional parameters include tags, slug, account_id, and published.
send_email
Send an email through Tradly's utility endpoint.
Required parameters:
subjectbodyemailemail_type
email must be an array of recipient addresses.
search_users
Search Tradly users by keyword.
Parameters:
pagenumber, optionalper_pagenumber, optionalsortstring, optionalsearchstring, optionalblockedboolean, optional
Use this together with get_user_details or get_user_profile when you need a specific person before sending an email.
get_collections
List collections.
Parameters:
pagenumber, optionalper_pagenumber, optionalscope_typenumber, optional
create_collection
Create a collection.
Required parameters:
collection
update_collection
Update a collection.
Required parameters:
collectionId
get_coupons
List coupons.
Parameters:
pagenumber, optionalper_pagenumber, optional
create_coupon
Create a coupon.
Required parameters:
couponcollection
delete_collection
Delete a collection.
Required parameters:
collectionId
tradly_request
Send a raw request to a Tradly endpoint.
Parameters:
pathstring, requiredmethodstring, defaultGETbasestring, defaultapiauth_modestring, defaultbearerqueryobject, optionalbodyobject, optionalheadersobject, optional
Use this for Tradly endpoints that are present in the Istanbul app but not yet wrapped as first-class MCP tools.
get_reports
Generate delivery reports.
Parameters:
typestring, defaultorders
Write tools create real Tradly records. For release testing, use test names prefixed with MCP_PUBLIC_TEST_DO_NOT_USE.
Release Checks
npm test
npm run pack:dry-runThe release checks verify:
- package metadata and binary name
- manifest and tool registry consistency
- stdio MCP initialize/tools/list/tool-call flow
- HTTP MCP well-known endpoints and streamable HTTP flow
- basic error behavior without needing live write calls
Live API checks require a valid Tradly access token:
TRADLY_API_KEY=your_tradly_access_token npm testRun live Tradly tool checks:
TRADLY_API_KEY=your_tradly_access_token npm run test:liveRun live write checks only when you have a disposable account/category:
TRADLY_API_KEY=your_tradly_access_token \
LIVE_WRITE=true \
TEST_ACCOUNT_ID=123 \
TEST_CATEGORY_ID=456 \
npm run test:liveDevelopment
npm install
npm run test:static
npm run test:stdio
npm run test:httpContributing
Pull requests are welcome. Please open an issue first for major changes so the expected MCP behavior and Tradly API surface can be discussed.
Keywords
mcp model-context-protocol tradly marketplace server sdk
