BotDuaChuot MCP
MCP server that enables ChatGPT to read/write files, run commands, and perform offline investigation tasks (geo, forensics, OSINT) on the host machine, scoped to a workspace with OPSEC controls.
README
BotDuaChuot Host MCP
A minimal MCP server that lets ChatGPT operate directly on your machine, scoped to HOST_WORKSPACE_DIR.
This repository has two main functions:
- Read, write, search files and run commands on the host.
- Provide working guidance plus a real inventory of tools installed on the machine via
duachuot_knowledge.
Layout
app/
├── host/ # File, command, policy and tool-inventory logic
├── geo/ # Geo Engine (convert, geodesic, exif, reverse, timezone)
├── ops/ # OPSEC gate
├── platform/ # OS/distro/arch/shell + tool resolution
├── tools/ # MCP adapters: health, host, knowledge, geo, probes, ops
├── config.py
├── mcp_server.py
└── main.py
knowledge/
├── WORKING_GUIDE.md
├── HOST_ENVIRONMENT.md
├── TOOL_CATALOG.json
├── GEO_PLAYBOOK.md
├── FORENSICS_PLAYBOOK.md
└── OSINT_PLAYBOOK.md
skills/
├── ctf-geo/
├── ctf-forensics-plus/
├── ctf-osint-plus/
└── ctf-stego-plus/
datasets/
└── landmarks.json
resources/
└── RESOURCE_MAP.json (generated from the host ctf-tools repo)
└── landmarks.json
install.sh
scripts/
├── install_basic.sh
├── install_cli.sh
├── uninstall_cli.sh
├── restart_server_only.sh
├── start_tunnel_server.sh
├── dev.sh
├── install_datasets.py
└── test.sh
Installation
1. One-line install (recommended)
curl -fsSL https://raw.githubusercontent.com/cornhub69-x/botduachuot_mcp/main/install.sh | bash
By default the script clones the main branch into ~/.botduachuot_mcp, creates a .venv, installs dependencies, creates a .env with 600 permissions, and links the CLI at ~/.local/bin/duachuot. Re-running the same command updates the installation via fast-forward; if the working tree has uncommitted files, the installer stops to avoid overwriting user data.
It can be customized with environment variables:
curl -fsSL https://raw.githubusercontent.com/cornhub69-x/botduachuot_mcp/main/install.sh | \
DUACHUOT_INSTALL_DIR="$HOME/apps/botduachuot_mcp" \
DUACHUOT_BIN_DIR="$HOME/.local/bin" \
DUACHUOT_BRANCH=main \
bash
Supported variables: DUACHUOT_REPO_URL, DUACHUOT_INSTALL_DIR, DUACHUOT_BIN_DIR, DUACHUOT_BRANCH. DUACHUOT_SKIP_PIP_UPGRADE=true should only be used in test environments or offline setups with a prepared package cache.
2. Manual install from a local repository
cd botduachuot_mcp
./install.sh
scripts/install_basic.sh is kept for compatibility and forwards directly to the main installer.
3. Configuration and post-install checks
Make sure ~/.local/bin is in your PATH:
export PATH="$HOME/.local/bin:$PATH"
Add this line to ~/.bashrc or ~/.zshrc to keep it across sessions.
Configure .env before exposing the service. The default template requires authentication:
REQUIRE_AUTH=true
GATEWAY_TOKEN=<secret-random-token>
HOST_WORKSPACE_DIR=/home/user
Then verify:
duachuot version
duachuot config validate
duachuot doctor
Running through Cloudflare Tunnel
./run_mcp_tunnel.sh
./run_mcp_tunnel.sh --status
./run_mcp_tunnel.sh --url
./run_mcp_tunnel.sh --stop
The connector URL looks like:
https://<random>.trycloudflare.com/mcp
Streamable HTTP is configured stateless and returns JSON directly. Every ChatGPT request works independently: no mcp-session-id is required and no SSE stream is kept for regular tool calls.
MCP_JSON_RESPONSE=true
MCP_STATELESS_HTTP=true
REST API
The REST API shares the host services with the MCP server and runs on the same server/tunnel. Base path:
/api/v1
OpenAPI document:
/api/v1/openapi.json
Main endpoints:
| Method | Endpoint | Purpose |
|---|---|---|
GET |
/api/v1/health |
Server status |
GET |
/api/v1/capabilities |
Tools, workspace and limits |
GET |
/api/v1/files |
List directory |
GET |
/api/v1/files/content |
Read text file |
PUT |
/api/v1/files/content |
Create or overwrite file |
PATCH |
/api/v1/files/content |
Replace text in file |
POST |
/api/v1/files/append |
Append content to file |
POST |
/api/v1/directories |
Create directory |
GET |
/api/v1/search |
Search text in workspace |
POST |
/api/v1/commands/check |
Check a command |
POST |
/api/v1/commands/run |
Run a command on the host |
GET |
/api/v1/knowledge |
Read guides and tool inventory |
When REQUIRE_AUTH=true, use one of these headers:
Authorization: Bearer <GATEWAY_TOKEN>
X-Gateway-Token: <GATEWAY_TOKEN>
Example:
BASE_URL="https://<tunnel>.trycloudflare.com"
TOKEN="<GATEWAY_TOKEN>"
curl -H "Authorization: Bearer $TOKEN" \
"$BASE_URL/api/v1/files?path=GitHub"
curl -X PUT \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"path":"Workspace/demo.txt","content":"hello REST\n"}' \
"$BASE_URL/api/v1/files/content"
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"command":"git status --short","cwd":"GitHub/botduachuot_mcp"}' \
"$BASE_URL/api/v1/commands/run"
MCP tools
health_check
get_capabilities
duachuot_list_directory
duachuot_read_file
duachuot_write_file
duachuot_replace_in_file
duachuot_append_file
duachuot_make_directory
duachuot_search_text
duachuot_check_command
duachuot_run_command
duachuot_knowledge
duachuot_run_command has no approval="approved" parameter. Policy is decided entirely server-side.
Investigation tools (Forensics + OSINT + Geo)
BotDuaChuot adds 21 dedicated investigation tools, fully offline and deterministic:
# Geo Engine (offline, no network required)
duachuot_geo_extract # EXIF GPS, exiftool/exiv2 cross-check, DOP/HPE, timezone, landmarks
duachuot_geo_scan # scan arbitrary text/logs/SRT/NMEA/MGRS/UTM for coordinates
duachuot_coord_convert # DMS/decimal/UTM/MGRS + datum transform (WGS84/ED50/NAD27)
duachuot_geo_calc # geodesic distance/bearing + uncertainty from DOP/HPE
duachuot_geo_reverse # offline reverse geocoding (landmarks + country resolution)
duachuot_geo_verify # conclude only with >= 2 independent facts; fewer -> BLOCKER
duachuot_geo_landmark_check # radius check around a landmark
duachuot_timezone_at # offline timezone/UTC offset from coordinates
# Probes
duachuot_media_probe # file + exiftool JSON + ffprobe
duachuot_pcap_probe # conversations/endpoints/DNS + GPS hints (NMEA, Wi-Fi probes)
duachuot_disk_probe # fsstat + fls
duachuot_mem_probe # Volatility 3 (info/pslist)
duachuot_stego_probe # binwalk + steghide, WAV LSB detection, LSB/MP3 extraction
duachuot_ocr_probe # tesseract + QR (zxing-cpp)
duachuot_win_probe # SAM/SYSTEM hives, LNK, prefetch (pure-Python, Linux/Windows)
# OPSEC + platform
duachuot_ops_check # blocks telemetry / attack tools / discovery while ctf-live / flags in commands
duachuot_ops_jitter # human-like delay between network queries
duachuot_ops_redact # redact secret/flag before writing logs
duachuot_platform # probe OS/arch/distro/shell + tool availability (native/WSL/missing)
duachuot_plan # generate an investigation plan by artifact type
duachuot_resource_lookup # resolve a managed ctf-tools resource from RESOURCE_MAP.json
Resource Registry: resources/RESOURCE_MAP.json is generated from the host
ctf-tools repository by scripts/generate_resource_map.py (skills, scripts,
tools, bin entries, notes). Lookups return path + invoke template + availability;
missing resources are BLOCKERs, never silent fallbacks.
Full playbooks: knowledge/GEO_PLAYBOOK.md, knowledge/FORENSICS_PLAYBOOK.md, knowledge/OSINT_PLAYBOOK.md. Bundled skills: skills/ctf-geo, skills/ctf-forensics-plus, skills/ctf-osint-plus, skills/ctf-stego-plus.
OPSEC (mandatory during CTF)
- Default
ctf-live: no public-source lookups (sherlock/maigret/whois/dnsrecon/search engines), no automated attack tools against scope, no automatic flag submission — always through a human. investigationmode (OSINT_MODE=true) opens OSINT lookups scoped to what the operator specifies.- Between network queries: wait for
duachuot_ops_jitter()(800–3000 ms). - Every coordinate conclusion needs >= 2 independent facts (verified via
duachuot_geo_verify).
duachuot_knowledge
duachuot_knowledge(section="overview")
duachuot_knowledge(section="guide")
duachuot_knowledge(section="tools", query="python", include_versions=true)
duachuot_knowledge(section="search", query="docker")
This tool reads the documents in knowledge/ and matches TOOL_CATALOG.json against the machine's actual PATH.
Testing
./scripts/test.sh
./scripts/quality_gate.sh
./scripts/manual_test_installer.sh
manual_test_installer.sh uses a temporary repository and HOME in /tmp; it never starts, stops or restarts a real Cloudflare tunnel.
Key configuration
HOST_WORKSPACE_DIR=/home/light
HOST_RESTRICT_TO_WORKSPACE=true
HOST_COMMAND_POLICY=guarded
MAX_TIMEOUT_SECONDS=60
MAX_OUTPUT_BYTES=500000
REQUIRE_AUTH=true
GATEWAY_TOKEN=<secret>
guarded is only a protection layer against obviously destructive operations, not a sandbox. The MCP server runs with the privileges of the user that starts the process.
See also: docs/ARCHITECTURE.md and SECURITY.md.
duachuot CLI
The repository ships a unified CLI to operate the bridge/tunnel and call the REST API without hand-writing curl.
Install the editable entry point:
.venv/bin/python -m pip install -e . --no-deps
Run it either way:
./bin/duachuot --help
.venv/bin/duachuot --help
Local operations group:
duachuot start
duachuot status
duachuot url
duachuot server restart # restart the bridge only, keep the tunnel URL
duachuot restart --yes # restart the tunnel too, URL may change
duachuot stop
REST API group:
duachuot health
duachuot --public health
duachuot capabilities --tools
duachuot fs ls GitHub
duachuot fs cat GitHub/project/README.md --lines 1:40
duachuot fs write GitHub/demo.txt --text "hello"
printf 'next\n' | duachuot fs append GitHub/demo.txt --stdin
duachuot fs search FastMCP --path GitHub/botduachuot_mcp
duachuot cmd check 'git status --short'
duachuot cmd run 'git status --short' --cwd GitHub/botduachuot_mcp
duachuot knowledge tools --query python --versions
Operations support groups:
duachuot logs server -n 100
duachuot logs follow server
duachuot config show
duachuot config validate
duachuot doctor
duachuot completion bash
Every command supports --json. Global options can be placed before or after the subcommand:
duachuot --public health --json
duachuot health --public --json
By default the CLI calls the local REST endpoint at http://127.0.0.1:<MCP_PORT>. Use --public to take the current URL from logs/tunnel_url.txt, or --base-url to point at another endpoint.
Main exit codes:
0 success
1 operation failed
2 invalid arguments
3 cannot reach the server
4 authentication failed
5 blocked by policy
6 resource not found
7 timeout
8 conflict
For duachuot cmd run, when the server executed the command successfully at the request level, the CLI exit code mirrors the real exit code of the command.
Full design: docs/CLI_DESIGN_PLAN.md.
Additional CLI docs: docs/CLI_MANUAL_TEST_PLAN.md and docs/CLI_IMPLEMENTATION_REPORT.md.
Operations and recovery
Unified quality gate:
./scripts/quality_gate.sh
./scripts/quality_gate.sh --runtime
./scripts/quality_gate.sh --full
Strict doctor and config:
duachuot doctor --local-only
duachuot doctor --strict
duachuot config validate --strict
Collect diagnostics with sensitive configuration redacted:
./scripts/collect_diagnostics.sh
Installation, bridge-only restart (keeping the tunnel), recovery, rollback and the production checklist are described in docs/OPERATIONS_RUNBOOK.md.
Architecture, security and releases
- Runtime architecture and boundaries:
docs/ARCHITECTURE.md - Security model and hardening:
SECURITY.md - Operations, recovery and rollback:
docs/OPERATIONS_RUNBOOK.md - Release checklist:
docs/RELEASE_CHECKLIST.md
GitHub Actions runs the quality gate on push and pull request; Dependabot tracks Python and GitHub Actions dependencies.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。