Using OpenCode with DataDoe MCP
OpenCode (opens in a new tab) is an open-source AI coding agent built for the terminal. It supports a TUI, CLI, and desktop app, and works with major LLM providers such as Anthropic, OpenAI, and Google. Unlike browser-based assistants, OpenCode runs in your terminal alongside your code, making it a natural fit for scaffolding projects, writing scripts, and building tools that use live data.
In this setup, DataDoe MCP acts as the data layer for OpenCode. Your agent calls DataDoe tools to read live Amazon Seller, Vendor, and Ads data on demand, without manual exports or custom SP-API pipelines.
What you will build
By the end of this tutorial, you will have:
- OpenCode installed and running on your machine
- An LLM provider configured (Anthropic, OpenAI, or OpenCode Zen)
- DataDoe MCP connected via the
~/.config/opencode/opencode.jsoncconfig file - A verified first query listing your connected Amazon sellers
- A seven-day sales report generated directly in the terminal
- A self-contained
dashboard.htmlsales dashboard built by OpenCode using live DataDoe data, ready to open in any browser
Prerequisites
- A DataDoe account with your Amazon connections set up and synced
- A DataDoe MCP key - if you have not created one yet, follow the DataDoe MCP Overview guide first, then return here. You can also create a key directly in DataDoe MCP Integrations (opens in a new tab)
- An API key for your chosen LLM provider (Anthropic or OpenAI), or use the built-in OpenCode Zen tier (no external key required)
- A modern terminal emulator, such as WezTerm (opens in a new tab), Ghostty (opens in a new tab), Alacritty (opens in a new tab), or Kitty (opens in a new tab)
- Node.js (opens in a new tab) 18 or later installed (verify with
node --version)
Step 1: Install OpenCode
Install OpenCode using the method that suits your platform:
1# One-liner (recommended)
2curl -fsSL https://opencode.ai/install | bash
3
4# Node.js (npm, bun, pnpm, or yarn)
5npm i -g opencode-ai@latest
6
7# macOS and Linux (Homebrew - always up to date)
8brew install anomalyco/tap/opencode
9
10# Windows
11scoop install opencode
12choco install opencodeA desktop app is also available if you prefer a graphical interface. Download it from opencode.ai/download (opens in a new tab) for macOS, Windows, or Linux.
Verify the installation:
1opencode --versionStep 2: Configure an LLM provider and choose a model
Navigate to any directory and run opencode to open the TUI. You have two options for connecting an LLM:
Option A - OpenCode Zen (no external API key required)
Run /connect inside the TUI, select opencode, and sign in at opencode.ai/auth (opens in a new tab). Zen provides a curated set of models maintained by the OpenCode team, so you do not need an Anthropic or OpenAI account.
Option B - your own API key
Run /models inside the TUI to open the model picker:
- Select a provider - OpenCode supports Anthropic, OpenAI, Google, Mistral, and more
- Choose an authentication method: API key
- Paste your key
- Select a model, for example
claude-sonnet-4-6
Build vs. plan mode. OpenCode has two built-in agent modes: build (default, full file access) and plan (read-only, for analysis and exploration). Switch between them with the
Tabkey. For this tutorial, stay in build mode.
Step 3: Connect DataDoe MCP
Important: OpenCode does not currently support adding remote authenticated MCP servers with a CLI command. You must configure DataDoe MCP by editing the config file manually in a text editor such as VS Code, nano, or vim.
Open ~/.config/opencode/opencode.jsonc in your preferred text editor and add the following block:
1{
2 "$schema": "https://opencode.ai/config.json",
3 "mcp": {
4 "datadoe-mcp": {
5 "type": "remote",
6 "url": "https://mcp.datadoe.com/mcp/v1",
7 "enabled": true,
8 "headers": {
9 "datadoe-mcp-key": "YOUR_DATADOE_MCP_KEY"
10 }
11 }
12 }
13}Replace YOUR_DATADOE_MCP_KEY with your key from DataDoe MCP Integrations (opens in a new tab).
Save the file. Before restarting OpenCode, you can verify that the config is picked up correctly by running the following command in your terminal:
1opencode mcp listThis lists all configured MCP servers and their status. You should see datadoe-mcp with a connected or enabled state.
If datadoe-mcp does not appear, check that the config file is saved at ~/.config/opencode/opencode.jsonc and that it contains valid JSON with no trailing commas and correct indentation.
Now restart OpenCode (press Ctrl+C to quit, then run opencode again) to load the MCP server into the active session.
Quick setup reference
If you are already familiar with OpenCode MCP configuration, here is everything you need:
Config: ~/.config/opencode/opencode.jsonc → mcp.datadoe-mcp
URL: https://mcp.datadoe.com/mcp/v1
Header: datadoe-mcp-key: YOUR_DATADOE_MCP_KEYStep 4: Verify the MCP connection
Restart OpenCode and open a new session, then ask:
What DataDoe tools do you have access to?OpenCode should respond with a list of DataDoe MCP tools, such as sellers_and_vendors_list, exports_sources_get, exports_create, and others. If no tools appear, check that the config file contains valid JSON with correct indentation and that the MCP key is correct.
Step 5: First conversation and seven-day sales report
List your connected sellers
Start with a simple query to confirm that DataDoe data flows through the connection:
List all my available Amazon sellersOpenCode calls sellers_and_vendors_list through DataDoe MCP and returns the names of your connected accounts. Note the Seller name, as you will use it in the next query.
Generate a seven-day sales report
Now use OpenCode to produce a business report. Paste the prompt below, replacing {example_seller} with your seller name:
Prepare a sales summary for the {example_seller} seller for the last 7 daysOpenCode will:
- Call
sellers_and_vendors_listto confirm the account - Create an export from the
Profit by SKU & Datesource for the last seven days and download the result - Analyze the data and return a structured markdown report with per-SKU breakdowns, daily rows, and executive KPIs (total sales, units sold, profit, ACoS, TACoS, ROI)
Step 6: Build a sales dashboard HTML page
This step shows OpenCode's full coding agent capability: it fetches live Amazon data from DataDoe and writes a complete, self-contained HTML dashboard into your project folder. No server or build step is required.
Setup
Create a new project directory and open OpenCode inside it:
1mkdir sales-dashboard && cd sales-dashboard
2opencodePrompt
Paste the following prompt, replacing {example_seller} with your seller name:
Using DataDoe MCP, fetch the 7-day sales data for my {example_seller} seller and create
a self-contained HTML file called dashboard.html with a sales dashboard. Include:
- KPI cards at the top: total revenue, total units sold, total profit, average ACoS
- A daily revenue chart (bar chart) using Chart.js from CDN
- A table of top 5 products by profit with columns: SKU, ASIN, total revenue, units sold, profit, ROI
Use clean modern inline CSS, no external stylesheets. All data must come from DataDoe tools.What OpenCode does
- Calls
sellers_and_vendors_list, then exports seven days of data from theProfit by SKU & Datesource. - Aggregates daily revenue and per-SKU totals.
- Scaffolds
dashboard.htmlwith Chart.js (loaded from CDN), KPI summary cards, a daily bar chart, and a top-5 product table. - Writes the file to the current directory.
The generated file is a single self-contained HTML page. It uses Chart.js from a CDN, inline CSS, and the seven-day data embedded as JavaScript arrays. That is roughly 300 lines in total. Yours will differ based on your live data.
Verify the result
Open the generated file in your browser:
1# macOS
2open dashboard.html
3
4# Windows
5start dashboard.html
6
7# Linux
8xdg-open dashboard.htmlThe page is fully self-contained, so no web server or additional dependencies are required.
Note: The dashboard is generated from live data at the time of running. Re-run the same prompt at any time to refresh the data.
Related resources
- OpenCode documentation (opens in a new tab)
- OpenCode MCP server configuration (opens in a new tab)
- OpenCode GitHub repository (opens in a new tab)
- DataDoe MCP Overview
- DataDoe MCP Integrations (opens in a new tab)
DataDoe MCP resources
Check the following resources for more information:
- MCP server URL:
https://mcp.datadoe.com/mcp/v1 - Interactive Data Scheme
- Data Scheme JSON: https://api.datadoe.com/api/v1/spec/data-scheme
- Need help? Use the contact form

