Using OpenCode with Marrow MCP
OpenCode 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, Marrow MCP acts as the data layer for OpenCode. Your agent calls Marrow 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, or the built-in OpenCode Zen tier enabled
- Marrow 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 Marrow data
Prerequisites
- A Marrow account with your Amazon connections set up and synced
- A Marrow MCP key. If you have not created one yet, follow the Marrow MCP Overview guide first, then return here. You can also create a key directly in Marrow MCP Integrations
- An API key for your chosen LLM provider, or the built-in OpenCode Zen tier
- A modern terminal emulator
- Node.js 18 or later installed
Step 1: Install OpenCode
Install OpenCode using the method that suits your platform:
Step 2: Configure an LLM provider and choose a model
Navigate to any directory and runopencode to open the TUI. You have two options for connecting an LLM:
Option A - OpenCode Zen
Run /connect inside the TUI, select opencode, and sign in at opencode.ai/auth. Zen provides a curated set of models maintained by the OpenCode team.
Option B - your own API key
Run /model inside the TUI to open the model picker:
- Select a provider such as Anthropic, OpenAI, Google, or Mistral
- Choose an authentication method
- Paste your key
- Select a model
Step 3: Connect Marrow MCP
Important: OpenCode does not currently support adding remote authenticated MCP servers with a CLI command. You must configure Marrow MCP by editing the config file manually.Open
~/.config/opencode/opencode.jsonc in your preferred text editor and add the following block:
YOUR_MARROW_MCP_KEY with your key from Marrow MCP Integrations.
Save the file. Before restarting OpenCode, verify that the config is picked up correctly:
marrow-mcp with a connected or enabled state.
If marrow-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. Restart OpenCode after saving the file.
Step 4: Verify the MCP connection
Restart OpenCode and open a new session, then ask:list_sellers, query_table, and others.
Step 5: First conversation and seven-day sales report
Start with a simple query:list_sellers through Marrow MCP and returns the names of your connected accounts.
Now produce a business report, replacing {example_seller} with your seller name:
Profit by SKU & Date table, and return a structured markdown report with per-SKU breakdowns, daily rows, and executive KPIs.
Step 6: Build a sales dashboard HTML page
This step shows OpenCode’s coding-agent capability: it fetches live Amazon data from Marrow and writes a complete, self-contained HTML dashboard into your project folder. Create a new project directory and open OpenCode inside it:{example_seller} with your seller name:
dashboard.html, and write the file to the current directory.
Related resources
- OpenCode documentation
- OpenCode MCP server configuration
- OpenCode GitHub repository
- Marrow MCP Overview
- Marrow MCP Integrations
Marrow MCP resources
- MCP server URL:
https://mcp.marrow.com/mcp/v1 - Interactive Data Scheme
- Data Scheme JSON: https://api.marrow.com/api/v1/spec/data-scheme

