forked from AtomDancing/tlbm-mcp
feat: 支持私有仓库 Bearer Token 认证安装
- install.sh 添加 --token 参数支持
- 使用 oauth2:${TOKEN}@ 格式进行认证
- README 更新安装说明,包含公开/私有两种方式
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,12 +15,21 @@ TLBM 无人车运营 API 的 MCP 封装,支持 Hermes、Claude Code 等 AI Age
|
|||||||
|
|
||||||
### 方式一:一键安装(推荐)
|
### 方式一:一键安装(推荐)
|
||||||
|
|
||||||
|
公开仓库:
|
||||||
```bash
|
```bash
|
||||||
curl -fsSL https://git.atomdancing.com/AtomDancing/tlbm-mcp/raw/branch/main/install.sh | bash
|
curl -fsSL https://git.atomdancing.com/AtomDancing/tlbm-mcp/raw/branch/main/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
|
私有仓库(需要 Token):
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://git.atomdancing.com/AtomDancing/tlbm-mcp/raw/branch/main/install.sh | bash -s -- --token=YOUR_TOKEN
|
||||||
|
```
|
||||||
|
|
||||||
|
> **获取 Token**:Gitea -> 设置 -> 应用 -> 生成访问令牌
|
||||||
|
|
||||||
### 方式二:从源码安装
|
### 方式二:从源码安装
|
||||||
|
|
||||||
|
公开仓库:
|
||||||
```bash
|
```bash
|
||||||
git clone https://git.atomdancing.com/AtomDancing/tlbm-mcp.git
|
git clone https://git.atomdancing.com/AtomDancing/tlbm-mcp.git
|
||||||
cd tlbm-mcp
|
cd tlbm-mcp
|
||||||
@@ -29,6 +38,15 @@ npm run build
|
|||||||
npm link
|
npm link
|
||||||
```
|
```
|
||||||
|
|
||||||
|
私有仓库(需要 Token):
|
||||||
|
```bash
|
||||||
|
git clone https://oauth2:YOUR_TOKEN@git.atomdancing.com/AtomDancing/tlbm-mcp.git
|
||||||
|
cd tlbm-mcp
|
||||||
|
npm install
|
||||||
|
npm run build
|
||||||
|
npm link
|
||||||
|
```
|
||||||
|
|
||||||
## 配置
|
## 配置
|
||||||
|
|
||||||
### Hermes Agent
|
### Hermes Agent
|
||||||
|
|||||||
+31
-7
@@ -3,6 +3,24 @@ set -e
|
|||||||
|
|
||||||
echo "🚀 TLBM MCP 一键安装脚本"
|
echo "🚀 TLBM MCP 一键安装脚本"
|
||||||
|
|
||||||
|
# 解析参数
|
||||||
|
TOKEN=""
|
||||||
|
for arg in "$@"; do
|
||||||
|
case $arg in
|
||||||
|
--token=*)
|
||||||
|
TOKEN="${arg#*=}"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# 构建 git URL
|
||||||
|
if [ -n "$TOKEN" ]; then
|
||||||
|
GIT_URL="https://oauth2:${TOKEN}@git.atomdancing.com/AtomDancing/tlbm-mcp.git"
|
||||||
|
else
|
||||||
|
GIT_URL="https://git.atomdancing.com/AtomDancing/tlbm-mcp.git"
|
||||||
|
fi
|
||||||
|
|
||||||
# 检测是否已克隆
|
# 检测是否已克隆
|
||||||
if [ -d "tlbm-mcp" ]; then
|
if [ -d "tlbm-mcp" ]; then
|
||||||
echo "📁 检测到已存在 tlbm-mcp 目录"
|
echo "📁 检测到已存在 tlbm-mcp 目录"
|
||||||
@@ -10,15 +28,21 @@ if [ -d "tlbm-mcp" ]; then
|
|||||||
git pull
|
git pull
|
||||||
else
|
else
|
||||||
echo "📥 克隆仓库..."
|
echo "📥 克隆仓库..."
|
||||||
# 先尝试公开克隆,失败则提示登录
|
# 尝试克隆
|
||||||
if git clone https://git.atomdancing.com/AtomDancing/tlbm-mcp.git 2>/dev/null; then
|
if [ -n "$TOKEN" ]; then
|
||||||
cd tlbm-mcp
|
git clone "$GIT_URL"
|
||||||
else
|
else
|
||||||
echo "⚠️ 仓库需要登录,请输入 Gitea 用户名:"
|
if git clone "$GIT_URL" 2>/dev/null; then
|
||||||
read -r username
|
:
|
||||||
git clone "https://${username}@git.atomdancing.com/AtomDancing/tlbm-mcp.git"
|
else
|
||||||
cd tlbm-mcp
|
echo "⚠️ 仓库需要认证,请使用以下命令:"
|
||||||
|
echo " curl -fsSL https://git.atomdancing.com/AtomDancing/tlbm-mcp/raw/branch/main/install.sh | bash -s -- --token=YOUR_TOKEN"
|
||||||
|
echo ""
|
||||||
|
echo "💡 获取 Token: Gitea -> 设置 -> 应用 -> 生成访问令牌"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
cd tlbm-mcp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "📦 安装依赖..."
|
echo "📦 安装依赖..."
|
||||||
|
|||||||
Reference in New Issue
Block a user