AWS Kiro is an agentic IDE with built-in Model Context Protocol (MCP) support. Connect AWS Kiro IDE to Treasure AI through MCP so Kiro's agent can query databases, inspect schemas, manage parent segments, segments, journeys, and workflows, or run Treasure AI Studio Actions and chats without leaving your editor.
You can connect AWS Kiro IDE to Treasure AI using either or both of two MCP integration patterns:
- Local MCP Server (
tdx mcp): Runs the Treasure Code (tdx) CLI locally overstdio. Kiro callstdx_searchandtdx_runusing your localtdxprofile to query databases and work with parent segments, segments, journeys, and workflows directly against Treasure AI APIs. - Treasure AI Studio MCP Endpoint: Connects over Streamable HTTP to the Treasure AI Studio Agent Gateway. Kiro delegates work to a shared work folder in Treasure AI Studio, runs saved Actions, and starts or continues Studio chats.
| Aspect | Local MCP Server (tdx mcp) | Treasure AI Studio MCP Endpoint |
|---|---|---|
| Best for | Engineers querying tables, exploring databases, and working with parent segments, segments, journeys, and workflows from Kiro | Teams running saved Studio Actions, listing shared work folders, and starting or continuing Studio chats from Kiro |
| Transport | Local stdio process (tdx mcp) started by Kiro | Remote Streamable HTTP (https://agent-gateway.<REGION>.treasure.ai/v1/mcp/<endpoint-id>) |
| Authentication | Your tdx profile stored in your system keychain (optional dedicated TDX_PROFILE=kiro) | Static Gateway Token (Authorization: Bearer tasgwt_<secret>) |
| Runs as | The Treasure AI user authenticated in your tdx profile | The MCP endpoint's designated executor in one shared work folder |
| AI token usage | Kiro only (Treasure AI serves standard API requests) | Kiro + Treasure AI Studio (Treasure AI Credits for Studio chats and Actions) |
| Tools exposed | tdx_run, tdx_search | list_work_folders, list_actions, run_action, start_chat, continue_chat, get_chat_result |
You can connect both MCP servers to Kiro at the same time in ~/.kiro/settings/mcp.json. With both configured, Kiro has tdx (2 tools, running locally on your machine) and tai-studio (6 tools, running work in Studio).
The commands below are shown for macOS (Apple Silicon). Intel Macs, Linux, and Windows follow the same steps with their platform-specific Kiro installer and terminal commands.
| Requirement | Details |
|---|---|
| Kiro IDE and sign-in | AWS Kiro IDE installed (choose Kiro IDE, not Kiro Crew) and signed in with a GitHub or Google account |
| Node.js | Version 22.12 or later, required for tdx and the optional npx endpoint check. On macOS, install with Homebrew (brew install node), or see the tdx Installation Guide for other operating systems |
Treasure AI account (for tdx mcp) | An API key or SSO sign-in with permissions for the databases, segments, journeys, and workflows you plan to use |
| Treasure AI Studio access (for Studio MCP Endpoint) | Manage access to a non-archived shared work folder, permission under your account's endpoint creation policy (Static-Token MCP Endpoints), access to Studio on Web or Desktop (not Mobile), and HTTPS connectivity to the Studio Agent Gateway |
Use this setup so Kiro starts tdx mcp locally over stdio. Every command runs with the permissions of the Treasure AI user behind your tdx profile. Kiro's configuration file stores only the path to tdx (and optionally a profile name); tdx keeps credentials in your system credential store.
If you already have Kiro IDE installed and signed in, skip to Step 2.
- Go to kiro.dev, select Download, and pick Kiro IDE for your platform (for example, Kiro IDE for Mac (Apple Silicon) — not Kiro Crew).
- Install and launch Kiro. On macOS, open the downloaded
.dmg, drag Kiro into Applications, and launch it from Applications. - Select Sign in, choose GitHub or Google, approve in the browser, and return to Kiro.
- Optionally create a practice folder (File → Open Folder, create
kiro-td-test, and open it). Typehelloin Kiro's agent chat panel to confirm you receive a reply.
Open your terminal and confirm Node.js is version 22.12 or later:
node --versionIf Node.js is missing or older than 22.12, install a current release (for example, brew install node on macOS).
Install @treasuredata/tdx globally and note the full path returned by which tdx:
npm install -g @treasuredata/tdx
tdx --version
which tdxWrite down the full path printed by which tdx (for example, /opt/homebrew/bin/tdx on Apple Silicon macOS). You need this exact path in Step 4.
Treasure Work ships its own bundled copy of tdx inside the desktop app. Kiro cannot reach that bundled binary, so install this separate global copy of @treasuredata/tdx for Kiro.
Check whether tdx is already authenticated:
tdx userIf it displays your Treasure AI account and email, continue to Step 4. Otherwise, run tdx auth setup and follow the prompts:
tdx auth setup
tdx user- For a non-US site, pass
--site eu01,--site ap01, or--site ap02. - For SSO sign-in, pass
--account-name <YOUR_ACCOUNT>. tdxstores credentials in your system credential store (macOS Keychain, Windows Credential Manager, or Linux Secret Service) rather than in a plain-text file.
Create a dedicated profile to tie Kiro to a single Treasure AI account (such as a sandbox account) without changing your default tdx setup:
tdx profile create kiro
tdx status --profile kiroIf the prompts do not ask you to sign in, run tdx auth setup --profile kiro. You reference this profile name in Step 4.
Create and open Kiro's user-level MCP configuration file at ~/.kiro/settings/mcp.json:
mkdir -p ~/.kiro/settings && touch ~/.kiro/settings/mcp.json && open -a Kiro ~/.kiro/settings/mcp.jsonEdit the file inside Kiro (or another code editor). Do not edit it in macOS TextEdit, which replaces straight quotes with smart quotes and produces invalid JSON.
Paste the configuration below into ~/.kiro/settings/mcp.json, replacing /opt/homebrew/bin/tdx with the path you noted from which tdx in Step 2. If the file already defines other servers, add the "tdx" entry inside the existing "mcpServers" object:
{
"mcpServers": {
"tdx": {
"command": "/opt/homebrew/bin/tdx",
"args": ["mcp"],
"autoApprove": ["tdx_search"]
}
}
}Save the file (Cmd+S on macOS, Ctrl+S on Windows/Linux). Kiro reloads MCP servers automatically when the file changes.
To use a dedicated tdx profile (such as the optional kiro profile from Step 3), add an "env" block to the "tdx" entry:
"env": { "TDX_PROFILE": "kiro" }Never add tdx_run to autoApprove. tdx_run can execute any tdx command, including workflow runs and segment pushes that cannot be undone. tdx_search only looks up commands, so it is safe to auto-approve.
tdx mcp resolves credentials in this order: TDX_PROFILE, then TDX_API_KEY plus TDX_SITE, then your default tdx sign-in. Prefer profiles over TDX_API_KEY so no API key is stored in mcp.json. Kiro also supports a project-level configuration file at .kiro/settings/mcp.json if you want tdx enabled for a single workspace; never commit a workspace config file that contains credentials.
Select the Kiro icon in the left sidebar and check the MCP Servers section. You should see tdx connected with two tools: tdx_run and tdx_search.

Try these prompts in Kiro's chat. When Kiro asks for permission to run tdx_run, review the command arguments and select Allow:
- "Use tdx to list my Treasure AI databases."
- "Show the tables in sample_datasets and describe one of them."
- "Using tdx, run this query: SELECT COUNT(1) FROM sample_datasets.www_access"

Kiro returns the query results from tdx, confirming the local MCP connection is working:

Use this setup to let Kiro list your Studio shared work folder, run saved Actions, and start or continue Treasure AI Studio chats over Streamable HTTP. Calls run as the endpoint's executor (by default, the person who created the endpoint) using that person's permissions and Treasure AI Credits.
A static-token MCP endpoint publishes one shared work folder. If you already manage a non-archived shared work folder you want to use, skip to Step 2. For the full folder layout and manager workflow, see Shared Work Folders and Sharing a Work Folder.
- Create a new shared folder: Open the Work Folders catalog with +, then select New shared folder. Creating a new folder requires fewer than 25 active work folders on your account.
- Share an existing folder: Open its ⋯ menu, select Share…, and choose which top-level items to publish. The folder converts in place, its chats continue working, and private contents move into your
my/area. - Publish and grant access: A new shared folder starts in Setting up. Publishing is one-way—a shared folder cannot become private again, though membership can change. To grant access, open the folder, select ⋯ → Shared folder settings, then under People select Add people, search by email within the same Treasure AI account, assign one or more work modes, and publish when ready.
| Work Mode | What It Allows |
|---|---|
| View only | Reads the entire folder and writes only to your private my/ area |
| Custom folders | Writes only to the top-level folders listed in the mode, such as reports/ |
| Write everywhere | Reads and writes the entire shared folder |
| Manage | Full access, including members, work modes, settings, and deletion |
The person who creates the MCP endpoint must hold Manage access on the shared folder. The endpoint wizard lists only non-archived folders where you hold Manage.
- Open Treasure AI Studio on Web or Desktop (not Mobile).
- Go to Settings → Agent Channels → New MCP Endpoint.
- Leave Static token · shared executor selected, enter a name (for example,
kiro-test), and select Next. - Under Shared work folder, choose your folder from Step 1. Requests from Kiro will run as you and use your Treasure AI Credits.
- Choose a token lifetime (for example, 30 days).
- Select Create endpoint & issue first token.
- Copy both the Connection URL (
https://agent-gateway.<REGION>.treasure.ai/v1/mcp/<endpoint-id>) and the Token (tasgwt_...) into your password manager right away. - Check I have stored the values, then select Done.

The tasgwt_ token is displayed only once. A lost token cannot be recovered; you must issue a new token on the endpoint's detail page and revoke the old one.
If you do not see New MCP Endpoint, or no shared folder appears in the wizard, ask your account administrator. Either you need Manage rights on a shared work folder, or your account's creation policy restricts endpoint creation to account administrators.
Verify that the endpoint responds on its own so any later issue can be isolated to Kiro's configuration. In your terminal, substitute your Connection URL and token and run:
export MCP_SERVER_URL="https://agent-gateway.<REGION>.treasure.ai/v1/mcp/<endpoint-id>"
export MCP_TOKEN="tasgwt_..."
npx @modelcontextprotocol/inspector --cli "$MCP_SERVER_URL" --transport http --header "Authorization: Bearer $MCP_TOKEN" --method tools/listIf npx prompts to install @modelcontextprotocol/inspector, enter y.
To keep the token out of your zsh shell history, replace the second export line with a hidden prompt:
read -rs 'MCP_TOKEN?Paste the Studio token (hidden): '
export MCP_TOKEN
printf '\n'
echo ${MCP_TOKEN:0:7}The output should list all six Studio tools: list_work_folders, list_actions, run_action, start_chat, continue_chat, and get_chat_result.
401 Unauthorized: The Connection URL or token was copied incorrectly, or the token is expired or revoked.403 Forbidden: The endpoint is disabled, has no executor, or the executor lost access to the shared folder.
- Reopen Kiro's user-level MCP configuration file:
open -a Kiro ~/.kiro/settings/mcp.json- Add the
"tai-studio"block inside"mcpServers"alongside"tdx". Replace the URL and token with your own values, keeping the wordBearerfollowed by a single space beforetasgwt_.... Keep your owntdxbinary path from Option 1:
{
"mcpServers": {
"tdx": {
"command": "/opt/homebrew/bin/tdx",
"args": ["mcp"],
"autoApprove": ["tdx_search"]
},
"tai-studio": {
"url": "https://agent-gateway.<REGION>.treasure.ai/v1/mcp/<endpoint-id>",
"headers": { "Authorization": "Bearer tasgwt_..." },
"autoApprove": ["list_work_folders", "list_actions", "get_chat_result"]
}
}
}- Save with
Cmd+S(Ctrl+Son Windows/Linux).
The three auto-approved tools (list_work_folders, list_actions, get_chat_result) are read-only. Leaving run_action, start_chat, and continue_chat out of autoApprove ensures Kiro asks for your approval before starting Studio work that spends credits.
~/.kiro/settings/mcp.json lives in your home directory, outside Git repositories. Never place a tasgwt_ token in a project-level .kiro/settings/mcp.json file.
Open the MCP Servers section in Kiro's sidebar and confirm tdx shows 2 tools and tai-studio shows 6 tools.

Test the Studio connection with prompts such as:
- "List the actions in my Treasure AI Studio folder."
- "Run the
<action_name>Action in tai-studio. If it returns a running status, pollget_chat_resultuntil it finishes." - "Start a Studio chat in that folder asking: summarize what's in this folder."
- "Use tdx to count rows in
sample_datasets.www_access, then start a Studio chat that explains the result."
| Tool | What It Does |
|---|---|
tdx_run | Executes a tdx CLI command and returns the output |
tdx_search | Finds the tdx command that matches a task |
| Area | Example Prompt |
|---|---|
| Data | "List the tables in sample_datasets and describe www_access." |
| Queries | "Count rows in sample_datasets.www_access grouped by HTTP method." |
| CDP | "List my parent segments and the child segments under one of them." |
| Journeys | "List my journeys and show the stages of one." |
| Workflows | "List my workflow projects and show the last few sessions for one." |
| Tool | Inputs | What It Does |
|---|---|---|
list_work_folders | None | Lists the work folders reachable through this endpoint |
list_actions | work_folder_id | Lists the saved Actions in a work folder |
run_action | work_folder_id, action_name | Runs a saved Action in Studio |
start_chat | work_folder_id, message | Starts a free-form Studio task |
continue_chat | chat_id, message | Sends a follow-up instruction to an existing Studio chat |
get_chat_result | chat_id | Retrieves the latest result of a Studio chat, or waits for it to finish |
For full tool schemas and status codes, see Connecting an MCP Client.
tdx_run can run any tdx command that your profile's user has permission to execute, including operations that cannot be undone. Ask Kiro for a dry run first and review every tool call before approving it:
tdx wf run: Starts a workflow attempt immediately. Activation workflows send to the full audience right away.tdx journey resume: Resumes a paused journey so audience members enter stages and activations fire.- Segment, journey, and parent segment pushes (for example,
tdx sg push,tdx journey push,tdx ps push): Update live CDP configurations.
Ask Kiro to run mutating commands with --dry-run first, or use read-only validation commands (tdx wf validate, tdx sg validate, tdx journey validate). Point Kiro's tdx profile at a demo or sandbox account whenever possible.
- Studio shared folder scope: A static-token endpoint publishes one shared work folder read-only and executes every call as the endpoint's executor, using that person's permissions and Treasure AI Credits. Each chat runs in a temporary workspace that is discarded when the chat ends.
- Rate and message limits: Up to 30 new chats per minute. Messages must be between 1 and 32,768 characters.
- Actions and clarifying questions: Saved Actions do not accept arguments—use
start_chatwhen you need to pass inputs. If Studio would ask a clarifying question, it is declined automatically, so include all required inputs in your prompt. - Supported MCP primitives: Only MCP tools are exposed; MCP resources and prompts are not supported.
- Long-running Studio tasks: Tool calls wait up to 200 seconds. If a task runs longer or times out in Kiro, poll
get_chat_resultwith the returnedchat_idinstead of starting the task again.
- Prefer
TDX_PROFILEoverTDX_API_KEY: Using atdxprofile keeps credentials in your system keychain rather than inmcp.json. - Follow least privilege: Kiro can perform any action permitted to the
tdxprofile's user or the Studio endpoint's executor. Use an account with only the permissions required. - Keep mutating tools out of
autoApprove: Never addtdx_run,run_action,start_chat, orcontinue_chattoautoApprove. - Protect
~/.kiro/settings/mcp.json: Because this file holds thetasgwt_token in plain text, keep it in your home directory and restrict file permissions withchmod 600 ~/.kiro/settings/mcp.json. Never commit tokens to Git, place them in a workspace.kiro/settings/mcp.json, or paste them into chat tools. - Rotate and revoke tokens: Set an expiration when creating the Studio endpoint and rotate tokens regularly. If a token is exposed, revoke it in Settings → Agent Channels and issue a new one.
- Revoking access:
- For Local MCP Server: Delete the
tdxblock from~/.kiro/settings/mcp.json, then runtdx auth clear(ortdx profile delete kiroif you created a dedicated profile). - For Studio MCP Endpoint: To stop access immediately, disable the endpoint in Settings → Agent Channels. Disabling does not revoke tokens—revoke tokens separately if needed.
- For Local MCP Server: Delete the
| Symptom | Likely Cause | Fix |
|---|---|---|
| Kiro will not open on macOS ("unidentified developer") | macOS Gatekeeper blocked the first launch | Right-click Kiro in Applications, select Open, then confirm Open |
npm: command not found or npx: command not found | Node.js is not installed | Install Node.js 22.12 or later (for example, brew install node on macOS) and retry |
EACCES permission error during npm install -g @treasuredata/tdx | Node.js is installed in a system-owned directory | Use a user-writable Node installation such as Homebrew (which node should show /opt/homebrew/bin/node on Apple Silicon). Do not run npm install -g with sudo |
| Node.js version error | Installed Node.js is older than 22.12 | Upgrade Node.js to 22.12 or later |
tdx mcp appears to hang when run directly in Terminal | Expected behavior—tdx mcp waits for stdio messages from an MCP client | Press Ctrl+C; Kiro starts tdx mcp for you |
tdx shows as failed in Kiro's MCP Servers | The "command" path is wrong, or Kiro cannot find tdx on its PATH (common with nvm) | Run which tdx and paste that exact full path into "command" in ~/.kiro/settings/mcp.json |
Auth errors or wrong Treasure AI account in tdx | tdx is not signed in, or Kiro is pointing at a different profile | Run tdx user (or tdx status --profile kiro) and re-run tdx auth setup if needed |
A long query times out in tdx | tdx commands time out after 15 minutes | Ask Kiro to submit long queries asynchronously with tdx job submit |
Other tdx errors | Local tdx runtime or API error | Inspect the local log with tail -50 ~/.cache/tdx/logs/tdx.log |
| New MCP Endpoint is missing or disabled in Studio | Endpoint creation is restricted to account administrators | Ask an account administrator to create the endpoint or update the creation policy |
| No shared folder appears in the endpoint wizard | You do not hold Manage access on a non-archived shared folder | Ask a folder manager for Manage access, or select an eligible shared folder |
401 Unauthorized from the Studio endpoint | The URL or token was copied incorrectly, the token expired or was revoked, or the endpoint was deleted | Re-copy the URL and token, or issue a new token in Settings → Agent Channels |
403 Forbidden from the Studio endpoint | The endpoint is disabled, has no executor, or the executor lost access to the folder | Re-enable the endpoint or restore folder access in Studio |
MCP Inspector test passes, but tai-studio fails in Kiro | Invalid JSON syntax, or the header is missing Bearer (with a space) | Check for valid JSON (commas between server blocks) and confirm "Authorization": "Bearer tasgwt_...". Edit the file in Kiro, not TextEdit |
tdx disappeared after adding tai-studio | Replacing mcp.json removed the tdx block | Put both "tdx" and "tai-studio" inside the same "mcpServers" object |
Studio tool call returns a running status | The Studio task took longer than 200 seconds | Ask Kiro to call get_chat_result with the returned chat_id |
| Studio responds about the wrong folder or Actions | The endpoint publishes a different shared folder than expected | Check the endpoint overview in Studio, then ask Kiro to run list_work_folders and list_actions |
- Local MCP Server — reference for
tdx_runandtdx_search - tdx mcp command reference — full tool reference and blocked commands
- Static-Token MCP Endpoints — create and manage Treasure AI Studio endpoints
- Connecting an MCP Client to Treasure AI Studio — full reference for the six Studio MCP tools
- Kiro MCP Configuration — official AWS Kiro documentation for MCP settings
- Connect a different tool: Claude Code · OpenAI Codex · VS Code and GitHub Copilot · Cursor · Snowflake Cortex Code · Databricks Genie Code