关于 Luno MCP Server
Luno MCP Server 是用于 Luno 加密货币交易所 API 的 MCP 服务。它面向使用 Claude Code、VS Code、Cursor 等客户端的用户,可查询行情、账户余额和交易记录,并可选择开启下单类写操作。
主要功能
- 01查询行情、订单簿、成交记录和K线数据
- 02查看账户余额和交易明细
- 03创建、取消订单及换币(需显式开启)
- 04默认只读模式,写操作需单独启用
- 05支持 stdio 与 SSE 传输方式
适用场景
- 01查询比特币等加密货币的当前价格
- 02查看 Luno 账户余额和历史交易
- 03在 AI 客户端中辅助查看市场数据
MCP 相关
该服务以 MCP 服务形式运行,向 MCP 客户端暴露行情、账户和交易相关的资源与工具。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。
详细介绍
Luno MCP 服务
一个 Model Context Protocol (MCP) 服务,提供对 Luno 加密货币交易所 API 的访问。
该服务支持与 Claude Code/VSCode/Cursor(以及其他兼容 MCP 的客户端)集成,提供与 Luno 加密货币交易所相关的上下文信息和功能。
快速开始
部分工具需要你的 Luno API 密钥和密钥。请从你的 Luno 账户设置 获取这些信息。
标准配置(Docker)适用于大多数 MCP 客户端:
{
"mcpServers": {
"luno": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "LUNO_API_KEY_ID=YOUR_API_KEY_ID",
"-e", "LUNO_API_SECRET=YOUR_API_SECRET",
"ghcr.io/luno/luno-mcp:latest"
]
}
}
}
Claude Code
使用 Docker:
claude mcp add luno -- docker run --rm -i -e LUNO_API_KEY_ID=YOUR_API_KEY_ID -e LUNO_API_SECRET=YOUR_API_SECRET ghcr.io/luno/luno-mcp:latest
或者,如果你是从源码构建的:
claude mcp add luno -e LUNO_API_KEY_ID=YOUR_API_KEY_ID -e LUNO_API_SECRET=YOUR_API_SECRET -- luno-mcp
Claude Desktop
一行命令安装并配置(macOS):
curl -fsSL https://raw.githubusercontent.com/luno/luno-mcp/main/claude-desktop-install.sh | \
LUNO_API_KEY_ID=<key> LUNO_API_SECRET=<secret> sh
或者手动将标准配置添加到你的 claude_desktop_config.json(设置指南)。
Cursor
前往 Cursor Settings → MCP → Add new MCP Server。使用 command 类型,命令为 docker,参数使用上方标准配置中的 args。
或者将标准配置添加到你的 .cursor/mcp.json。
Windsurf
请遵循 Windsurf MCP 文档。使用上方标准配置。
VS Code(手动配置)
点击上方徽章即可一键 Docker 安装,或者将以下内容添加到你的 VS Code settings.json 或 .vscode/mcp.json:
使用 Docker
{
"inputs": [
{"id": "luno_api_key_id", "type": "promptString", "description": "Luno API Key ID", "password": true},
{"id": "luno_api_secret", "type": "promptString", "description": "Luno API Secret", "password": true}
],
"servers": {
"luno": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "LUNO_API_KEY_ID=${input:luno_api_key_id}",
"-e", "LUNO_API_SECRET=${input:luno_api_secret}",
"ghcr.io/luno/luno-mcp:latest"
]
}
}
}
从源码构建
{
"inputs": [
{"id": "luno_api_key_id", "type": "promptString", "description": "Luno API Key ID", "password": true},
{"id": "luno_api_secret", "type": "promptString", "description": "Luno API Secret", "password": true}
],
"servers": {
"luno": {
"command": "luno-mcp",
"env": {
"LUNO_API_KEY_ID": "${input:luno_api_key_id}",
"LUNO_API_SECRET": "${input:luno_api_secret}"
}
}
}
}
SSE transport
{
"servers": {
"luno": {
"type": "sse",
"url": "http://localhost:8080/sse"
}
}
}
从源码构建
需要 Go 1.25 或更高版本。
直接安装:
go install github.com/luno/luno-mcp/cmd/server@latest
或克隆并构建:
git clone https://github.com/luno/luno-mcp
cd luno-mcp
go build -o luno-mcp ./cmd/server
也可选择将其安装到系统全局:
sudo mv luno-mcp /usr/local/bin/
Homebrew (macOS)
通过 Homebrew 使用 luno/homebrew-luno-mcp tap 安装:
brew tap luno/luno-mcp
brew install luno-mcp
然后配置你的 MCP 客户端:
{
"mcpServers": {
"luno": {
"command": "luno-mcp",
"args": ["--transport", "stdio"],
"env": {
"LUNO_API_KEY_ID": "YOUR_API_KEY_ID",
"LUNO_API_SECRET": "YOUR_API_SECRET"
}
}
}
}
或使用 Claude Code:
claude mcp add luno -e LUNO_API_KEY_ID=YOUR_API_KEY_ID -e LUNO_API_SECRET=YOUR_API_SECRET -- luno-mcp
Docker
使用上面的标准配置,或直接运行:
docker run --rm -i \
-e LUNO_API_KEY_ID=YOUR_API_KEY_ID \
-e LUNO_API_SECRET=YOUR_API_SECRET \
ghcr.io/luno/luno-mcp:latest
对于 SSE 模式:
docker run --rm \
-e LUNO_API_KEY_ID=YOUR_API_KEY_ID \
-e LUNO_API_SECRET=YOUR_API_SECRET \
-p 8080:8080 \
ghcr.io/luno/luno-mcp:latest \
--transport sse --sse-address 0.0.0.0:8080
可选环境变量:
LUNO_API_DEBUG=true— 启用调试日志LUNO_API_DOMAIN=api.staging.luno.com— 覆盖 API 域名ALLOW_WRITE_OPERATIONS=true— 启用写操作(create_order、cancel_order、convert)
标准配置(Docker)适用于大多数 MCP 客户端:
{
"mcpServers": {
"luno": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "LUNO_API_KEY_ID=YOUR_API_KEY_ID",
"-e", "LUNO_API_SECRET=YOUR_API_SECRET",
"ghcr.io/luno/luno-mcp:latest"
]
}
}
}
Claude Code
使用 Docker:
claude mcp add luno -- docker run --rm -i -e LUNO_API_KEY_ID=YOUR_API_KEY_ID -e LUNO_API_SECRET=YOUR_API_SECRET ghcr.io/luno/luno-mcp:latest
或者如果你是从源码构建的:
claude mcp add luno -e LUNO_API_KEY_ID=YOUR_API_KEY_ID -e LUNO_API_SECRET=YOUR_API_SECRET -- luno-mcp
Claude Desktop
一行命令安装并配置(macOS):
curl -fsSL https://raw.githubusercontent.com/luno/luno-mcp/main/claude-desktop-install.sh | \
LUNO_API_KEY_ID=<key> LUNO_API_SECRET=<secret> sh
或手动将标准配置添加到你的 claude_desktop_config.json(设置指南)。
Cursor
前往 Cursor Settings → MCP → Add new MCP Server。使用 command 类型,命令为 docker,参数为上面标准配置中的 args。
或将标准配置添加到你的 .cursor/mcp.json。
Windsurf
按照 Windsurf MCP 文档操作。使用上面的标准配置。
VS Code(手动配置)
点击上面的徽章进行一键 Docker 安装,或将以下内容添加到你的 VS Code settings.json 或 .vscode/mcp.json:
使用 Docker
{
"servers": {
"luno": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "LUNO_API_KEY_ID=${input:luno_api_key_id}",
"-e", "LUNO_API_SECRET=${input:luno_api_secret}",
"ghcr.io/luno/luno-mcp:latest"
],
"inputs": [
{"id": "luno_api_key_id", "type": "promptString", "description": "Luno API Key ID", "password": true},
{"id": "luno_api_secret", "type": "promptString", "description": "Luno API Secret", "password": true}
]
}
}
}
从源码
{
"servers": {
"luno": {
"command": "luno-mcp",
"env": {
"LUNO_API_KEY_ID": "${input:luno_api_key_id}",
"LUNO_API_SECRET": "${input:luno_api_secret}"
},
"inputs": [
{"id": "luno_api_key_id", "type": "promptString", "description": "Luno API Key ID", "password": true},
{"id": "luno_api_secret", "type": "promptString", "description": "Luno API Secret", "password": true}
]
}
}
}
SSE transport
{
"servers": {
"luno": {
"type": "sse",
"url": "http://localhost:8080/sse"
}
}
}
从源码构建
需要 Go 1.25 或更高版本。
直接安装:
go install github.com/luno/luno-mcp/cmd/server@latest
或克隆并构建:
git clone https://github.com/luno/luno-mcp
cd luno-mcp
go build -o luno-mcp ./cmd/server
也可选择将其安装到系统全局:
sudo mv luno-mcp /usr/local/bin/
Docker
使用上面的标准配置,或直接运行:
docker run --rm -i \
-e LUNO_API_KEY_ID=YOUR_API_KEY_ID \
-e LUNO_API_SECRET=YOUR_API_SECRET \
ghcr.io/luno/luno-mcp:latest
对于 SSE 模式:
docker run --rm \
-e LUNO_API_KEY_ID=YOUR_API_KEY_ID \
-e LUNO_API_SECRET=YOUR_API_SECRET \
-p 8080:8080 \
ghcr.io/luno/luno-mcp:latest \
--transport sse --sse-address 0.0.0.0:8080
可选环境变量:
LUNO_API_DEBUG=true— 启用调试日志LUNO_API_DOMAIN=api.staging.luno.com— 覆盖 API 域名ALLOW_WRITE_OPERATIONS=true— 启用写操作(create_order、cancel_order、convert)
功能特性
- 资源:访问账户余额、交易历史等
- 工具:创建和管理订单、查询价格以及查看交易详情等功能
- 安全性:使用 Luno API 密钥进行安全身份验证
- VS Code 集成:轻松集成到 VSCode 或其他 AI IDE
可用工具
| 工具 | 类别 | 描述 | 需要认证 | 写入 |
|---|---|---|---|---|
get_ticker | 市场数据 | 获取交易对的当前行情信息 | ❌ | ❌ |
get_tickers | 市场数据 | 列出给定交易对(或全部)的行情 | ❌ | ❌ |
get_order_book | 市场数据 | 获取交易对的订单簿 | ❌ | ❌ |
list_trades | 市场数据 | 列出货币对的近期成交 | ❌ | ❌ |
get_candles | 市场数据 | 获取货币对的 K 线市场数据 | ❌ | ❌ |
get_markets_info | 市场数据 | 列出所有支持市场的参数信息 | ❌ | ❌ |
get_balances | 账户信息 | 获取所有账户的余额 | ✅ | ❌ |
create_order | 交易 | 创建新的买入或卖出订单 | ✅ | ✅ |
cancel_order | 交易 | 取消现有订单 | ✅ | ✅ |
list_orders | 交易 | 列出未成交订单 | ✅ | ❌ |
list_transactions | 交易记录 | 列出账户的交易记录 | ✅ | ❌ |
get_transaction | 交易记录 | 获取特定交易的详情 | ✅ | ❌ |
convert | 交易 | 在两种货币之间即时兑换 | ✅ | ✅ |
命令行选项
--transport:传输类型(stdio、sse或streamable-http;默认值:stdio)--sse-address:SSE 与 Streamable HTTP 传输的地址(默认值:localhost:8080)--domain:Luno API 域名(默认值:api.luno.com)--log-level:日志级别(debug、info、warn、error,默认值:info)--allow-write-operations:启用写入操作(create_order、cancel_order、convert)。也可通过ALLOW_WRITE_OPERATIONS环境变量配置
示例
使用钱包
你可以让大模型显示你的钱包余额:
What are my current wallet balances on Luno?
交易
你可以让大模型帮你进行交易:
Create a limit order to buy 0.001 BTC at 50000 ZAR
交易历史
你可以让大模型显示你的交易历史:
Show me my recent Bitcoin transactions
市场数据
你可以让大模型显示市场数据:
Show me recent trades for XBTZAR
What's the latest price for Bitcoin in ZAR?
安全注意事项
此工具需要可访问你 Luno 账户的 API 凭据。使用 API 密钥时请务必谨慎,尤其是具有提现权限的密钥。建议仅创建具有你的具体使用场景所需权限的 API 密钥。
写入操作控制
默认情况下,MCP 服务以 只读模式 运行 — 不会暴露 create_order、cancel_order 和 convert。要启用它们,请将 ALLOW_WRITE_OPERATIONS 设置为 true、1 或 yes。有关在何处添加此标志,请参阅上方的配置示例。
API 凭据的最佳实践
- 创建受限权限的 API 密钥:仅授予你的使用场景绝对必要的权限
- 切勿将凭据提交到版本控制:确保
.env文件始终位于你的.gitignore中 - 定期轮换 API 密钥:定期重新生成你的 API 密钥,以限制潜在泄露的影响
- 监控 API 使用情况:定期检查你的 Luno 账户是否存在任何未经授权的活动
- 默认使用只读模式:仅在确实需要时才启用写入操作
贡献
如果你想为本项目的开发做出贡献,请参阅 CONTRIBUTING.md 文件了解相关指南。
许可证
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。