Token导航 LogoToken导航TokenDH.com
baton (Augmnt) logo
金融服务stdio官方级别未说明来源级核验

baton (Augmnt)

MCP Server

@augmnt-sh/baton

Baton是一个用于Tempo区块链的CLI工具包和MCP服务器,提供完整的区块链操作、账户管理、代币操作和DEX集成功能。

工具数

14

提示词数

0

GitHub Stars

1

资源数

0
TypeScriptClaude命令行工具Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

augmnt

提供方

augmnt

最后核验

2026/5/17 20:21

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx @augmnt-sh/baton <command>

详细介绍

指挥棒

Tempo区块链的CLI工具包和MCP服务器。

特性

  • 126 MCP工具 -通过模型上下文协议完成区块链操作
  • CLI接口 -所有操作的命令行界面
  • TIP-20代币操作 -转移、批准、造币、销毁和角色管理
  • DEX集成 -掉期、限价单和价格计算
  • 账户管理 -余额、非数、费用代币
  • 访问密钥管理 -授权和撤销访问密钥
  • 政策体系 -创建和管理转移策略(TIP-403)
  • 奖励分配 -领取并分配奖励
  • 测试网水龙头 -测试网上的基金地址

安装

CLI用法(推荐)

全局安装以使用 baton 命令在任何地方:

npm install -g @augmnt-sh/baton

或者直接使用npx运行(无需安装):

npx @augmnt-sh/baton 

编程式用法

作为项目依赖项安装:

npm install @augmnt-sh/baton

来源

git clone https://github.com/augmnt/baton.git
cd baton
npm install
npm run build

快速开始

最快的入门方法是使用交互式设置向导:

baton init

这将指导您完成:

  • 创建新钱包或导入现有钱包
  • 选择您的网络(测试网或主网)
  • 将配置保存到 .env
  • 可选地从测试网水龙头为您的钱包提供资金

示例设置流程

$ baton init

██████╗  █████╗ ████████╗ ██████╗ ███╗   ██╗
██╔══██╗██╔══██╗╚══██╔══╝██╔═══██╗████╗  ██║
██████╔╝███████║   ██║   ██║   ██║██╔██╗ ██║
██╔══██╗██╔══██║   ██║   ██║   ██║██║╚██╗██║
██████╔╝██║  ██║   ██║   ╚██████╔╝██║ ╚████║
╚═════╝ ╚═╝  ╚═╝   ╚═╝    ╚═════╝ ╚═╝  ╚═══╝

  Welcome to Baton Setup

? How would you like to set up your wallet?
  ❯ Create a new wallet
    Import existing wallet (private key)
    Import from mnemonic phrase

? Generate recovery phrase (mnemonic)? Yes

✓ Wallet generated successfully!

  Address:     0x742d35Cc6634C0532925a3b844Bc454e4438f44e
  Mnemonic:    word1 word2 word3 ... word12

  ⚠️  IMPORTANT: Write down your mnemonic phrase and store it safely!

? Which network would you like to use?
  ❯ Testnet (recommended for getting started)
    Mainnet

? Save configuration to .env file? Yes
✓ Configuration saved to .env

? Fund wallet from testnet faucet? Yes
✓ Funded successfully!

🚀 You're all set!

更新配置

要稍后更新配置,请执行以下操作:

# Interactive configuration menu
baton config

# Or use specific commands:
baton config show          # View current config
baton config set-key       # Update private key (secure input)
baton config set-network   # Change network

安全说明:set-key 命令使用安全的密码样式输入-您的私钥永远不会在屏幕上显示或保存到shell历史记录中。

______________________________________________________________________

配置

环境变量

Baton使用以下环境变量:

变量必填描述
TEMPO_PRIVATE_KEY用于写操作用于签署交易的私钥
TEMPO_RPC_URL自定义RPC终结点(默认为Tempo测试网)
TEMPO_EXPLORER_URL自定义块浏览器URL
TEMPO_NETWORK没有mainnettestnet (默认:测试网)

配置方法

选项1:MCP服务器配置(建议用于Claude)

添加MCP服务器时直接传递环境变量:

claude mcp add baton -e TEMPO_PRIVATE_KEY=0x... -- npx @augmnt-sh/baton mcp

这是最安全的方法,因为密钥存储在Claude的MCP配置中,不会暴露在shell历史或环境中。

选项2:外壳轮廓

添加到 ~/.zshrc~/.bashrc:

export TEMPO_PRIVATE_KEY=0x...
export TEMPO_NETWORK=testnet

选项3:.env文件

创建 .env 工作目录中的文件:

TEMPO_PRIVATE_KEY=0x...
TEMPO_RPC_URL=https://rpc.moderato.tempo.xyz
TEMPO_NETWORK=testnet

注:对于MCP服务器 .env 文件必须位于Claude运行的目录(您的项目目录)中,而不是接力棒安装目录中。

CLI使用情况

设置命令

# Interactive setup wizard (recommended for new users)
baton init

# Configuration management
baton config              # Interactive config menu
baton config show         # View current configuration
baton config set-key      # Update private key (secure input)
baton config set-network  # Change network (mainnet/testnet)

钱包操作

# Generate a new wallet
baton wallet new

# Generate with mnemonic
baton wallet new --mnemonic

# Derive address from private key
baton wallet derive 

# Derive from mnemonic
baton wallet from-mnemonic "word1 word2 ..."

账户操作

# Get all balances
baton balances 

# Get specific token balance
baton account balance  --token 

# Get account info
baton account info 

# Get nonce
baton account nonce 

令牌操作

# Get token info
baton token info 

# Transfer tokens
baton token transfer   

# Transfer with memo
baton token transfer    --memo "Payment for services"

# Approve spender
baton token approve   

# Get allowance
baton token allowance   

# Mint tokens (requires MINTER_ROLE)
baton token mint   

# Burn tokens
baton token burn  

DEX运营

# Get swap quote
baton dex quote   

# Execute swap
baton dex swap   

# Place limit order
baton dex order    --buy
baton dex order    --sell

# Cancel order
baton dex cancel 

# Get order info
baton dex order-info 

# Price utilities
baton dex price --tick 100
baton dex price --price 1.01

连锁经营

# Get chain info
baton chain info

# Get block number
baton chain block-number

# Get block
baton chain block 

# Get transaction
baton chain tx 

水龙头(测试网)

# Fund address
baton faucet fund 

# Check faucet status
baton faucet status

# Check cooldown
baton faucet cooldown 

全局选项

# Use testnet
baton --network testnet 

# Use custom RPC
baton --rpc https://custom-rpc.example.com 

# JSON output
baton  -o json

MCP服务器

启动服务器

baton mcp

与Claude Code集成

基本设置(只读操作):

claude mcp add baton -- npx @augmnt-sh/baton mcp

使用私钥进行写操作:

claude mcp add baton -e TEMPO_PRIVATE_KEY=0x... -- npx @augmnt-sh/baton mcp

对于测试网:

claude mcp add baton -e TEMPO_NETWORK=testnet -e TEMPO_PRIVATE_KEY=0x... -- npx @augmnt-sh/baton mcp

要更新配置,请删除并重新添加:

claude mcp remove baton
claude mcp add baton -e TEMPO_PRIVATE_KEY=0x... -- npx @augmnt-sh/baton mcp

用户级别(适用于所有项目):

claude mcp add -s user baton -e TEMPO_PRIVATE_KEY=0x... -- npx @augmnt-sh/baton mcp

与Claude Desktop集成

将以下内容添加到您的Claude Desktop配置文件中:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 窗户: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "baton": {
      "command": "node",
      "args": ["/path/to/baton/dist/src/mcp-server.js"],
      "env": {
        "TEMPO_NETWORK": "testnet",
        "TEMPO_PRIVATE_KEY": "0x..."
      }
    }
  }
}

或者通过npm全局安装:

{
  "mcpServers": {
    "baton": {
      "command": "npx",
      "args": ["@augmnt-sh/baton", "mcp"],
      "env": {
        "TEMPO_NETWORK": "testnet"
      }
    }
  }
}

可用工具

MCP服务器提供126个按域组织的工具:

工具描述
5区块和交易查询
钱包6钱包生成和派生
账户13余额和账户信息
代币14TIP-20代币操作
DEX10掉期和订单管理
费用9费用代币管理
手续费AMM7手续费流动性操作
钥匙链11访问密钥管理
策略8传输策略管理
奖励10奖励分配
历史记录7传输历史记录
水龙头8测试网水龙头
合同8通用合同操作
实用程序10实用程序功能

资源

  • tempo://tokens/known -已知令牌地址
  • tempo://contracts/addresses -合同地址
  • tempo://contracts/abis/tip20 -TIP-20abi
  • tempo://config/network -当前网络配置

提示

  • transfer-tokens -引导式代币转移工作流程
  • swap-tokens -引导式交换工作流程
  • check-account -完整的账户概述
  • new-wallet -生成并资助新钱包

编程式用法

import {
  generateWallet,
  getBalances,
  transfer,
  getSwapQuote,
  swap,
} from '@augmnt-sh/baton'

// Generate wallet
const wallet = generateWallet()
console.log(wallet.address)

// Get balances
const balances = await getBalances('0x...')

// Transfer tokens
const result = await transfer({
  token: '0x20c0000000000000000000000000000000000001',
  to: '0x...',
  amount: 100000000n, // 100 tokens (6 decimals)
})

// Swap tokens
const quote = await getSwapQuote({
  tokenIn: '0x20c0000000000000000000000000000000000000',
  tokenOut: '0x20c0000000000000000000000000000000000001',
  amountIn: 100000000n,
})

const swapResult = await swap({
  tokenIn: '0x20c0000000000000000000000000000000000000',
  tokenOut: '0x20c0000000000000000000000000000000000001',
  amountIn: 100000000n,
})

关键概念

6位小数

所有TIP-20代币都使用6位小数。CLI中的金额是人类可读的:

# Transfer 100.5 tokens
baton token transfer   100.5

在代码中,使用最小单位:

import { parseAmount, formatAmount } from '@augmnt-sh/baton'

const amount = parseAmount('100.5') // 100500000n
const formatted = formatAmount(100500000n) // "100.5"

备忘录编码

备注以字节32编码:

# String memo (max 31 chars)
baton token transfer   100 --memo "Payment"

# Or hex bytes32
baton token transfer   100 --memo "0x..."

Tick定价

DEX价格使用分时值:

import { priceToTick, tickToPrice } from '@augmnt-sh/baton'

const tick = priceToTick(1.0001) // Get tick for price
const price = tickToPrice(100)   // Get price from tick

已知令牌

令牌地址
pathUSD0x20c0000000000000000000000000000000000000
AlphaUSD0x20c0000000000000000000000000000000000001
Beta美元0x20c0000000000000000000000000000000000002
ThetaUSD0x20c0000000000000000000000000000000000003

合同地址

合同地址
TIP20_工厂0x20fc000000000000000000000000000000000000
稳定币_DEX0xdec0000000000000000000000000000000000000
费用经理0xfeec000000000000000000000000000000000000
ACCOUNT_KEYCHAIN0xAAAAAAAA00000000000000000000000000000000
FEE_AMM0xfee0000000000000000000000000000000000000
保单登记簿0x403000000000000000000000000000000000000
多播30xcA11bde05977b3631167028862bE2a173976CA11

安全

  • 永远不要共享您的私钥
  • 从以下位置读取私钥 TEMPO_PRIVATE_KEY 环境变量
  • 钥匙从未被记录或存储
  • 使用访问密钥授予权限

许可证

麻省理工学院

目录标签

目录标签

TypeScriptClaude命令行工具区块链工具本地部署CLI工具账户管理代币操作DEX集成

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

token

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

@augmnt-sh/baton

工具数量(toolCount,工具数)

14

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiotoken部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP