How to Use the Amazon Selling Partner MCP in Mastra AI
Build resilient Amazon workflows with Mastra AI. Handle rate limits, retry failed syncs, and branch logic based on FBA stock levels.
Works with every AI agent you already use
…and any MCP-compatible client
Connect Amazon Selling Partner MCP to Mastra AI
Create your Vinkius account to connect Amazon Selling Partner to Mastra AI and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Conditional FBA Restock Logic
Checking Amazon inventory manually leads to API throttling. Mastra AI fixes that by wrapping this MCP Server in a workflow engine with exponential backoff. You configure an agent to run `list_fba_inventory` every morning without worrying about breaking the script. If stock drops below 50 units, the workflow branches. The agent hits `search_catalog` to verify the current buy box price, then triggers an approval request. Mastra's `requireToolApproval` halts execution until a human manager clicks yes to generate a new shipment.
Automated Financial Auditing
Sellers lose money when they ignore refund discrepancies in their financial events. Set up a scheduled Mastra workflow to pull `list_financial_events` at the end of every billing cycle. The agent automatically audits the fees and payout amounts. If the agent spots an anomaly in the transaction data, it branches to a deeper investigation. It runs `create_report` to request the full ledger, waits, and polls `get_report_status`. If the report fails to generate, Mastra automatically retries without waking you up.
Mastra AI Order Resolution
Customer complaints require immediate context from their order history. When a ticket opens, your Mastra agent grabs the buyer details and executes `list_orders` to find the exact purchase history across all regions pulled from `list_marketplaces`. The workflow then isolates the specific transaction using `get_order_items`. If the item shipped, the agent drafts a response. If it sits in pending status, the workflow routes the ticket to a human support tier. You build complex routing logic while the MCP Server handles the Amazon data.
Set up Amazon Selling Partner MCP in Mastra AI
Prerequisites
- Node.js 18+ and a TypeScript project
-
@mastra/mcp+@mastra/corepackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
npm install @mastra/mcp @mastra/coreplus your preferred model provider (e.g.@ai-sdk/openai). - 2
Configure the MCPClient
Create an
MCPClientwith your Vinkius endpoint as aURLobject. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Discover and inject tools
Call
mcpClient.listTools()and spread the result into your agent'stoolsobject. All Amazon Selling Partner tools become native Mastra tools. - 4
Run with any model
Swap
openai("gpt-4o")for any AI SDK-compatible provider. Callagent.generate()and the agent routes tool calls through MCP automatically.
import { MCPClient } from "@mastra/mcp";
import { Agent } from "@mastra/core/agent";
import { openai } from "@ai-sdk/openai";
const mcpClient = new MCPClient({
id: "amazon-selling-partner-mcp-client",
servers: {
"amazon-selling-partner-mcp": {
url: new URL(
"https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp"
),
},
},
});
const agent = new Agent({
name: "Amazon Selling Partner Agent",
model: openai("gpt-4o"),
instructions: "You have access to Amazon Selling Partner tools.",
tools: {
...(await mcpClient.listTools()),
},
});
const result = await agent.generate(
"List recent Amazon Selling Partner transactions"
);
console.log(result.text); Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by Amazon Selling Partner. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about Amazon Selling Partner MCP in Mastra AI
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the Amazon Selling Partner MCP today
We host it, we monitor it, we maintain it. You just paste one token.