Let an AI agent buy gift cards with USDC over x402, within limits the wallet owner sets.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
本地运行
claude mcp add spendthebits-gift-cards --env STB_AGENT_PRIVATE_KEY='<STB_AGENT_PRIVATE_KEY>' -- npx -y @spendthebits/mcp-giftcards~/.codex/config.toml
[mcp_servers.spendthebits-gift-cards]
command = "npx"
args = ["-y", "@spendthebits/mcp-giftcards"]
env = { STB_AGENT_PRIVATE_KEY = "<STB_AGENT_PRIVATE_KEY>" }
# codex mcp add spendthebits-gift-cards --env STB_AGENT_PRIVATE_KEY='<STB_AGENT_PRIVATE_KEY>' -- npx -y @spendthebits/mcp-giftcards~/.cursor/mcp.json
{
"mcpServers": {
"spendthebits-gift-cards": {
"command": "npx",
"args": [
"-y",
"@spendthebits/mcp-giftcards"
],
"env": {
"STB_AGENT_PRIVATE_KEY": "<STB_AGENT_PRIVATE_KEY>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"spendthebits-gift-cards": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@spendthebits/mcp-giftcards"
],
"env": {
"STB_AGENT_PRIVATE_KEY": "<STB_AGENT_PRIVATE_KEY>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"spendthebits-gift-cards": {
"command": "npx",
"args": [
"-y",
"@spendthebits/mcp-giftcards"
],
"env": {
"STB_AGENT_PRIVATE_KEY": "<STB_AGENT_PRIVATE_KEY>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"spendthebits-gift-cards": {
"command": "npx",
"args": [
"-y",
"@spendthebits/mcp-giftcards"
],
"env": {
"STB_AGENT_PRIVATE_KEY": "<STB_AGENT_PRIVATE_KEY>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"spendthebits-gift-cards": {
"command": "npx",
"args": [
"-y",
"@spendthebits/mcp-giftcards"
],
"env": {
"STB_AGENT_PRIVATE_KEY": "<STB_AGENT_PRIVATE_KEY>"
}
}
}
}远程托管
claude mcp add --transport http spendthebits-gift-cards https://x402.spendthebits.com/mcp~/.codex/config.toml
[mcp_servers.spendthebits-gift-cards]
url = "https://x402.spendthebits.com/mcp"
# codex mcp add spendthebits-gift-cards --url https://x402.spendthebits.com/mcp~/.cursor/mcp.json
{
"mcpServers": {
"spendthebits-gift-cards": {
"url": "https://x402.spendthebits.com/mcp"
}
}
}.vscode/mcp.json
{
"servers": {
"spendthebits-gift-cards": {
"type": "http",
"url": "https://x402.spendthebits.com/mcp"
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"spendthebits-gift-cards": {
"httpUrl": "https://x402.spendthebits.com/mcp"
}
}
}claude_desktop_config.json · Customize › Connectors › Add custom connector
{
"mcpServers": {
"spendthebits-gift-cards": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://x402.spendthebits.com/mcp"
]
}
}
}.trae/mcp.json
{
"mcpServers": {
"spendthebits-gift-cards": {
"url": "https://x402.spendthebits.com/mcp"
}
}
}需要的环境变量
STB_AGENT_PRIVATE_KEY
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。