Skip to content

Commit 68bef7a

Browse files
committed
feat: 更新文档,添加 腾讯云开发 MCP Dockerfile
1 parent 01e3543 commit 68bef7a

File tree

4 files changed

+85
-23
lines changed

4 files changed

+85
-23
lines changed

DOC.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,27 @@
99
## 环境变量
1010

1111
- 需要将 **ALAPI_TOKEN** 配置为您在 ALAPI 上创建的 [TOKEN](https://www.alapi.cn/dashboard/data/token)
12+
- 可选配置 **ALAPI_ID** 为接口ID,如果不指定使用的接口,请填 0
1213

1314
## 🗺️ 功能清单
1415

1516
以下仅罗列部分功能,具体请以实际调用为准
1617

17-
| 命令名称 | 功能描述 | 核心参数 |
18-
|-------------------------------|-----------------------------------------------|---------------|
19-
| user_apis | 获取已申请的接口列表 | |
20-
| /api/ip | 查询IP归属地信息 | ip |
21-
| /api/tianqi | 查询国内天气详情、包含天气信息、天气预警、天气指数、AQI 等 | city |
18+
| 命令名称 | 功能描述 | 核心参数 |
19+
| ----------------------------- | --------------------------------------------------------------------------------------- | ------------- |
20+
| user_apis | 获取已申请的接口列表 | |
21+
| /api/ip | 查询IP归属地信息 | ip |
22+
| /api/tianqi | 查询国内天气详情、包含天气信息、天气预警、天气指数、AQI 等 | city |
2223
| /api/tophub | 查询今日热榜数据,包含抖音热搜、头条热榜、知乎、36k、百度热搜、搜狗热搜、微博热搜等数据 | id,type |
23-
| /api/censor/text | 查询文本是否违规,特别适合AI内容审核 | text |
24-
| /api/url | 短网址缩短,将长网址缩短为短网址,方便短信发送、二维码生成等场景 | url |
25-
| /api/qr/decode | 支持一图多码,支持数十二维码,条形码的识别 | url |
26-
| /api/eventHistory | 历史上的今天,查历史上的指定日期发生的大事 | date |
27-
| /api/exchange | 汇率查询,根据货币代码查询货币汇率和换算,支持全球170+个国家和地区货币查询 | money,from,to |
28-
| /api/enterprise/simple_search | 企业工商信息搜索,根据企业名称或统一社会信用代码查询企业基本工商信息 | keyword |
29-
| /api/kd | 快递查询V1,免费查询快递物流轨迹,支持中通、申通、顺丰、极兔、百世、圆通等 | numner,phone |
30-
| /api/star | 星座运势查询,提供星座运势查询服务,支持查询十二星座今日或明日、本周、本月、本年的运势。 | star |
31-
| /api/gold | 查询当前黄金的实时价格,最高价,最低价,品牌黄金的价格 | market |
24+
| /api/censor/text | 查询文本是否违规,特别适合AI内容审核 | text |
25+
| /api/url | 短网址缩短,将长网址缩短为短网址,方便短信发送、二维码生成等场景 | url |
26+
| /api/qr/decode | 支持一图多码,支持数十二维码,条形码的识别 | url |
27+
| /api/eventHistory | 历史上的今天,查历史上的指定日期发生的大事 | date |
28+
| /api/exchange | 汇率查询,根据货币代码查询货币汇率和换算,支持全球170+个国家和地区货币查询 | money,from,to |
29+
| /api/enterprise/simple_search | 企业工商信息搜索,根据企业名称或统一社会信用代码查询企业基本工商信息 | keyword |
30+
| /api/kd | 快递查询V1,免费查询快递物流轨迹,支持中通、申通、顺丰、极兔、百世、圆通等 | numner,phone |
31+
| /api/star | 星座运势查询,提供星座运势查询服务,支持查询十二星座今日或明日、本周、本月、本年的运势。 | star |
32+
| /api/gold | 查询当前黄金的实时价格,最高价,最低价,品牌黄金的价格 | market |
3233

3334
## 仓库地址
3435

Dockerfile

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
21
FROM golang:1.24-alpine AS builder
32

3+
# config alpine mirror
4+
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tencent.com/g' /etc/apk/repositories
5+
46
# Install git since it might be needed for go mod
5-
RUN apk add --no-cache git
7+
RUN apk update && apk add --no-cache git
68

79
WORKDIR /app
810

@@ -17,11 +19,26 @@ COPY . .
1719
RUN CGO_ENABLED=0 go build -o mcp-alapi-cn .
1820

1921
# Final stage
20-
FROM alpine:latest
22+
FROM node:20-alpine
23+
24+
# config npm and yarn registry
25+
RUN npm config set registry https://mirrors.cloud.tencent.com/npm/ \
26+
&& yarn config set registry https://mirrors.cloud.tencent.com/npm/
27+
28+
# config alpine mirror
29+
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tencent.com/g' /etc/apk/repositories
30+
2131
WORKDIR /app
2232

2333
# Copy the built binary from builder
2434
COPY --from=builder /app/mcp-alapi-cn ./
2535

26-
# Run the MCP server
27-
CMD ["./mcp-alapi-cn"]
36+
# 安装 @cloudbase/mcp-transformer 工具
37+
RUN npm install -g @cloudbase/[email protected]
38+
39+
# 固定暴露端口
40+
EXPOSE 80
41+
42+
# 启动命令
43+
# 使用 cloudbase-mcp-transformer 将 Stdio 转换为远程 MCP 服务
44+
CMD cloudbase-mcp-transformer stdioToCloudrun --stdioCmd "./mcp-alapi-cn" --port 80

mcp-meta.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "mcp-alapi-cn",
33
"title": "ALAPI MCP",
4-
"description": "提供 ALAPI 接口平台调用的 MCP 服务器,使用AI就可以与接口交互,免去开发烦扰",
5-
"author": {"name": "Alone88","email": "[email protected]"},
4+
"description": "通过 MCP 协议提供 ALAPI 接口平台服务,支持IP归属地查询、天气查询、热榜数据、文本审核、短网址等功能,可通过 LLM 自然语言交互调用",
5+
"author": {"name": "Alone88"},
66
"gitUrl": "https://cnb.cool/alapi/mcp-alapi-cn",
7-
"tags": ["社区 MCP","ALAPI","API接口调用"],
7+
"tags": ["社区 MCP","ALAPI","数据接口","天气服务","企业服务"],
88
"port": "80",
99
"logo": ["https://file.alapi.cn/logo/logo.svg"],
1010
"env_params": {
1111
"ALAPI_TOKEN": "在 ALAPI 平台申请创建的 token",
12-
"API_ID": "接口ID,如果不指定使用的接口,请填 0"
12+
"ALAPI_ID": "接口ID,如果不指定使用的接口,请填 0"
1313
}
1414
}

tcb.Dockerfile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FROM golang:1.24-alpine AS builder
2+
3+
# config alpine mirror
4+
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tencent.com/g' /etc/apk/repositories
5+
6+
# Install git since it might be needed for go mod
7+
RUN apk update && apk add --no-cache git
8+
9+
WORKDIR /app
10+
11+
# Copy go mod and sum files first for caching
12+
COPY go.mod go.sum ./
13+
RUN go mod tidy
14+
15+
# Copy the rest of the application
16+
COPY . .
17+
18+
# Build the application
19+
RUN CGO_ENABLED=0 go build -o mcp-alapi-cn .
20+
21+
# Final stage
22+
FROM node:20-alpine
23+
24+
# config npm and yarn registry
25+
RUN npm config set registry https://mirrors.cloud.tencent.com/npm/ \
26+
&& yarn config set registry https://mirrors.cloud.tencent.com/npm/
27+
28+
# config alpine mirror
29+
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tencent.com/g' /etc/apk/repositories
30+
31+
WORKDIR /app
32+
33+
# Copy the built binary from builder
34+
COPY --from=builder /app/mcp-alapi-cn ./
35+
36+
# 安装 @cloudbase/mcp-transformer 工具
37+
RUN npm install -g @cloudbase/[email protected]
38+
39+
# 固定暴露端口
40+
EXPOSE 80
41+
42+
# 启动命令
43+
# 使用 cloudbase-mcp-transformer 将 Stdio 转换为远程 MCP 服务
44+
CMD cloudbase-mcp-transformer stdioToCloudrun --stdioCmd "./mcp-alapi-cn" --port 80

0 commit comments

Comments
 (0)