dune-mcp-skill
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDune MCP Skill
Dune MCP Skill
Use this skill to run Dune MCP operations through .
uxcReuse the skill for shared protocol discovery, output parsing, and generic auth/binding flows.
uxc通过使用此技能来运行Dune MCP操作。
uxc复用技能以实现共享协议发现、输出解析以及通用身份验证/绑定流程。
uxcPrerequisites
前提条件
- is installed and available in
uxc.PATH - Network access to .
https://api.dune.com/mcp/v1 - Dune API key is available for authenticated calls.
- 已安装且可在
uxc中访问。PATH - 可访问的网络权限。
https://api.dune.com/mcp/v1 - 拥有用于认证调用的Dune API密钥。
Core Workflow
核心工作流
- Confirm endpoint and protocol with help-first probing:
uxc https://api.dune.com/mcp/v1 -h
- Configure credential/binding for repeatable auth:
uxc auth credential set dune-mcp --auth-type api_key --header "x-dune-api-key={{secret}}" --secret-env DUNE_API_KEYuxc auth credential set dune-mcp --auth-type api_key --header "x-dune-api-key={{secret}}" --secret-op op://Engineering/dune/api-keyuxc auth binding add --id dune-mcp --host api.dune.com --path-prefix /mcp/v1 --scheme https --credential dune-mcp --priority 100
- Use fixed link command by default:
command -v dune-mcp-cli- If missing, create it:
uxc link dune-mcp-cli https://api.dune.com/mcp/v1 dune-mcp-cli -h
- Inspect operation schema before execution:
dune-mcp-cli searchTables -hdune-mcp-cli searchTablesByContractAddress -hdune-mcp-cli createDuneQuery -hdune-mcp-cli executeQueryById -hdune-mcp-cli getExecutionResults -h
- Prefer read/discovery operations first, then query creation or credit-consuming execution.
- 通过优先提供帮助的探测确认端点和协议:
uxc https://api.dune.com/mcp/v1 -h
- 配置凭证/绑定以实现可重复的身份验证:
uxc auth credential set dune-mcp --auth-type api_key --header "x-dune-api-key={{secret}}" --secret-env DUNE_API_KEYuxc auth credential set dune-mcp --auth-type api_key --header "x-dune-api-key={{secret}}" --secret-op op://Engineering/dune/api-keyuxc auth binding add --id dune-mcp --host api.dune.com --path-prefix /mcp/v1 --scheme https --credential dune-mcp --priority 100
- 默认使用固定链接命令:
command -v dune-mcp-cli- 若缺失,创建链接:
uxc link dune-mcp-cli https://api.dune.com/mcp/v1 dune-mcp-cli -h
- 执行前检查操作模式:
dune-mcp-cli searchTables -hdune-mcp-cli searchTablesByContractAddress -hdune-mcp-cli createDuneQuery -hdune-mcp-cli executeQueryById -hdune-mcp-cli getExecutionResults -h
- 优先执行读取/发现操作,再进行查询创建或消耗积分的执行操作。
Capability Map
功能映射
- Discovery:
searchDocssearchTableslistBlockchainssearchTablesByContractAddress
- Query lifecycle:
createDuneQuerygetDuneQueryupdateDuneQueryexecuteQueryByIdgetExecutionResults
- Analysis helpers:
generateVisualizationgetTableSizegetUsage
- 发现:
searchDocssearchTableslistBlockchainssearchTablesByContractAddress
- 查询生命周期:
createDuneQuerygetDuneQueryupdateDuneQueryexecuteQueryByIdgetExecutionResults
- 分析辅助工具:
generateVisualizationgetTableSizegetUsage
Recommended Usage Pattern
推荐使用模式
- Find the right table first:
dune-mcp-cli searchTables query='uniswap swaps'dune-mcp-cli searchTablesByContractAddress contractAddress=0x...
- Prefer higher-level tables when they already expose the metrics you need.
spell - Keep SQL partition-aware:
- use ,
block_date, or another partition/date column inevt_block_dateWHERE
- use
- Create a temporary query only after confirming table choice and date range.
- Execute and fetch results by execution ID.
- 先找到合适的表:
dune-mcp-cli searchTables query='uniswap swaps'dune-mcp-cli searchTablesByContractAddress contractAddress=0x...
- 若已有暴露所需指标的高阶表,优先使用。
spell - 保持SQL的分区感知:
- 在子句中使用
WHERE、block_date或其他分区/日期列evt_block_date
- 在
- 确认表选择和日期范围后,再创建临时查询。
- 通过执行ID获取执行结果。
Guardrails
防护规则
- Keep automation on JSON output envelope; do not rely on .
--text - Parse stable fields first: ,
ok,kind,protocol,data.error - Use as default command path.
dune-mcp-cli - is equivalent to
dune-mcp-cli <operation> ....uxc https://api.dune.com/mcp/v1 <operation> ... - Discovery operations are read-only:
searchDocssearchTableslistBlockchainssearchTablesByContractAddressgetDuneQuerygetExecutionResultsgetTableSizegetUsage
- Require explicit user confirmation before credit-consuming or state-changing operations:
createDuneQueryupdateDuneQueryexecuteQueryByIdgenerateVisualization
- Be careful with privacy:
- confirm before switching a query from private to public
- temporary queries can still be visible; inspect and
is_privateis_temp
- input now supports automatic type conversion for numeric MCP arguments.
key=value - Numeric IDs can be passed directly with , for example:
key=valuequery_id=6794106queryId=6794106
- Positional JSON is still useful for nested objects or when mixing string and numeric fields precisely:
{"executionId":"01...","timeout":90,"limit":20}
- For SQL passed via , wrap the whole SQL string in double quotes so inner SQL single quotes survive shell parsing.
key=value - If returns a Dune-side schema/facet error, fall back to
listBlockchainswithsearchTablesfilters.blockchains
- 自动化操作基于JSON输出包,不要依赖格式。
--text - 优先解析稳定字段:、
ok、kind、protocol、data。error - 使用作为默认命令路径。
dune-mcp-cli - 等效于
dune-mcp-cli <operation> ...。uxc https://api.dune.com/mcp/v1 <operation> ... - 发现操作是只读的:
searchDocssearchTableslistBlockchainssearchTablesByContractAddressgetDuneQuerygetExecutionResultsgetTableSizegetUsage
- 消耗积分或改变状态的操作需要用户明确确认:
createDuneQueryupdateDuneQueryexecuteQueryByIdgenerateVisualization
- 注意隐私:
- 将查询从私有切换为公开前需确认
- 临时查询仍可能被可见;检查和
is_private字段is_temp
- 输入现在支持对数值型MCP参数自动类型转换。
key=value - 数值ID可直接通过传递,例如:
key=valuequery_id=6794106queryId=6794106
- 位置JSON仍适用于嵌套对象或需要精确混合字符串和数值字段的场景:
{"executionId":"01...","timeout":90,"limit":20}
- 对于通过传递的SQL,需将整个SQL字符串用双引号包裹,以便内部的SQL单引号能在shell解析中保留。
key=value - 若返回Dune端的模式/分面错误, fallback到带
listBlockchains过滤器的blockchains。searchTables
Tested Real Scenario
已测试的真实场景
The following flow was exercised successfully through :
uxc- discover table:
uniswap.uniswapx_trades - create temporary query for Base daily volume
- execute query
- fetch results
The successful SQL shape was:
sql
SELECT block_date,
ROUND(SUM(amount_usd), 2) AS daily_volume_usd,
COUNT(*) AS trades
FROM uniswap.uniswapx_trades
WHERE blockchain = 'base'
AND block_date >= date_add('day', -7, CURRENT_DATE)
GROUP BY 1
ORDER BY 1 DESC
LIMIT 7以下流程已通过成功执行:
uxc- 发现表:
uniswap.uniswapx_trades - 创建针对Base日交易量的临时查询
- 执行查询
- 获取结果
成功的SQL语句如下:
sql
SELECT block_date,
ROUND(SUM(amount_usd), 2) AS daily_volume_usd,
COUNT(*) AS trades
FROM uniswap.uniswapx_trades
WHERE blockchain = 'base'
AND block_date >= date_add('day', -7, CURRENT_DATE)
GROUP BY 1
ORDER BY 1 DESC
LIMIT 7References
参考资料
- Invocation patterns:
references/usage-patterns.md
- 调用模式:
references/usage-patterns.md