mcp-dauthau
Connects AI tools to Vietnamese bid (đấu thầu) lookup service DauThau via MCP, with local key signing for security.
README
@dauthau/mcp-dauthau
Node.js wrapper kết nối AI tool (Claude Code, Cursor, Antigravity, Windsurf...) với dịch vụ tra cứu đấu thầu công Việt Nam của DauThau qua giao thức Model Context Protocol.
Wrapper chạy stdio trên máy bạn, ký request local rồi forward HTTPS lên gateway. Apisecret KHÔNG bao giờ rời máy bạn.
Tính năng
- 🔐 Apisecret giữ local — wrapper ký
hashsecretper-request bằngnode:crypto(md5) hoặcbcrypt, chỉ gửi chữ ký qua mạng. - ⚡ Zero-install — chạy qua
npx -y @dauthau/mcp-dauthau@latest, không cài cố định, auto-update. - 🧩 Pass-through proxy động — danh sách tool query từ gateway mỗi session. Khi backend mở rộng tool, bạn KHÔNG cần update wrapper.
- 🛡️ Tối thiểu dependency — chỉ 1 runtime dependency (
@modelcontextprotocol/sdk) + Node stdlib. Mỗi release publish với npm provenance SLSA. - 🌍 Cross-platform — Node.js ≥ 22 trên macOS / Linux / Windows. CI test cả 3 OS × 3 Node version.
Yêu cầu
- Node.js >= 22 (LTS). Tải tại https://nodejs.org/
- Tài khoản DauThau với apikey + apisecret (đăng ký tại https://dauthau.info).
- MCP gateway key — liên hệ DauThau để được cấp.
Cài đặt
KHÔNG cần npm install. Dùng trực tiếp qua npx.
Config .mcp.json cho Claude Code / Cursor / Windsurf
{
"mcpServers": {
"dauthau": {
"command": "npx",
"args": ["-y", "@dauthau/mcp-dauthau@latest"],
"env": {
"DAUTHAU_APIKEY": "<apikey-cua-ban>",
"DAUTHAU_APISECRET": "<apisecret-cua-ban>",
"DAUTHAU_METHOD": "md5_verify",
"MCP_GATEWAY_URL": "<url-gateway-duoc-cap>",
"MCP_GATEWAY_KEY": "<gateway-key-duoc-cap>"
}
}
}
}
Sau khi config, restart MCP client (Claude Code / Cursor) để nạp wrapper. AI assistant sẽ tự discover danh sách tool và bắt đầu dùng được.
Vị trí .mcp.json theo client
| Client | Đường dẫn |
|---|---|
| Claude Code | .mcp.json trong project root, hoặc ~/.claude.json (global) |
| Cursor | ~/.cursor/mcp.json |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
| Antigravity | xem doc client tương ứng |
Biến môi trường
Bắt buộc
| Env | Mô tả |
|---|---|
DAUTHAU_APIKEY |
Apikey từ tài khoản DauThau của bạn |
DAUTHAU_APISECRET |
Apisecret tương ứng (giữ local, dùng để ký hashsecret) |
MCP_GATEWAY_URL |
URL endpoint gateway (DauThau cấp khi đăng ký) |
MCP_GATEWAY_KEY |
Gateway subscription key (DauThau cấp) |
Tuỳ chọn
| Env | Default | Mô tả |
|---|---|---|
DAUTHAU_METHOD |
password_verify |
Phương thức xác thực chữ ký: password_verify (mặc định, dùng bcrypt) hoặc md5_verify (dùng md5). |
LOG_LEVEL |
info |
debug / info / warn / error — log ra stderr (stdout dành cho MCP framing). |
MCP_GATEWAY_TIMEOUT_MS |
30000 |
Timeout HTTPS request lên gateway, range 1000-120000. |
Bảo mật
- Apisecret KHÔNG bao giờ gửi qua mạng. Wrapper ký
hashsecret = md5(apisecret + "_" + timestamp)local, chỉ gửihashsecret+timestamp(Unix seconds) qua header. - Wrapper KHÔNG log giá trị nhạy cảm: apikey, apisecret, hashsecret, gateway key, raw body. Log chỉ chứa: tool name, latency, status, error message.
- Mọi credential giữ trong RAM scope process — KHÔNG persist ra disk/cache.
- Mỗi request 1 timestamp mới + 1 hashsecret mới — chống replay attack (gateway verify skew window phía server).
Lưu ý
- Khi bạn paste apisecret vào
.mcp.json, file đó phải được bảo vệ (chmod 600 trên Unix, ACL hạn chế trên Windows). KHÔNG commit.mcp.jsonchứa apisecret lên git. - Cold-start
npxlần đầu mỗi session khoảng 200-500ms để tải package vào cache. Sau đó session sau dùng cache local.
Troubleshooting
Thiếu env: DAUTHAU_APIKEY, ...
Kiểm tra block env trong .mcp.json đã có đủ 4 biến bắt buộc. Restart MCP client sau khi sửa.
Node.js >= 22 required
Wrapper yêu cầu Node 22+ (LTS). Cài LTS mới nhất tại https://nodejs.org/.
gateway timeout sau 30000ms
Mạng chậm hoặc gateway tạm thời không phản hồi. Tăng timeout qua MCP_GATEWAY_TIMEOUT_MS=60000 hoặc kiểm tra kết nối internet.
Clock skew (lỗi liên quan timestamp)
Đồng hồ máy lệch so với server > 60s. Sync NTP:
- macOS / Linux:
sudo sntp -sS time.google.comhoặcsudo timedatectl set-ntp on - Windows: mở PowerShell admin, chạy
w32tm /resync
Kiểm tra wrapper trước khi tin tưởng
npx -y @dauthau/mcp-dauthau@latest --version
npx -y @dauthau/mcp-dauthau@latest --help
Phát triển local
git clone https://github.com/vinades/mcp-dauthau.git
cd mcp-dauthau
npm install
npm run lint # tsc --noEmit
npm test # vitest unit + integration mock
npm run build # tsc → dist/
node dist/index.js --version
Đóng góp
Pull request và issue đều welcome. Trước khi PR:
- Đảm bảo
npm run lint && npm testpass. - Thêm test cho code mới (vitest, mục tiêu coverage ≥ 85% cho module core).
- KHÔNG commit
.env, key thật, hoặc thông tin nhạy cảm. - Mô tả PR ngắn gọn, đính kèm test plan.
Báo cáo lỗ hổng bảo mật: vui lòng dùng GitHub Security Advisory (private) trước khi public disclosure.
Liên kết
- Model Context Protocol — chuẩn giao thức Anthropic phát triển.
- @modelcontextprotocol/sdk — TypeScript SDK chính chủ.
- DauThau — dịch vụ tra cứu đấu thầu công Việt Nam.
License
GNU General Public License v2.0
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。