Bỏ qua để đến nội dung

Tools và MCP

Tools giúp Bestie đọc file, search local context, đọc logs, gọi MCP server đã cho phép và báo tiến độ rõ ràng. Nhưng tools phải có phân loại, permission và receipts.

Bestie có internal read tools cho terminal và Telegram, ví dụ:

  • đọc file
  • list folder
  • search text
  • gom Markdown bundle
  • đọc logs
  • xem memories
  • xem git status/diff/log ở chế độ read-only

Local read tools thường có thể allow. Write, patch, exec và URL reads nên để ask hoặc deny nếu chưa chắc.

{
"internalTools": {
"policies": {
"internal.write_file": "ask",
"internal.edit_file": "ask",
"internal.apply_patch": "ask",
"internal.exec": "ask",
"internal.list_processes": "allow",
"internal.read_url": "ask"
}
}
}

MCP tool cần được classify local trước. Foundation hiện tại chỉ nên gọi tool thuộc category read.

Terminal window
bestie mcp list
bestie mcp add remote-docs --url https://example.com/mcp --transport streamable-http
bestie mcp add remote-docs --url https://example.com/mcp --oauth-client-id bestie-local
bestie mcp login remote-docs
bestie mcp login remote-docs --code <code>
bestie mcp show dry-run
bestie mcp test dry-run --connect
bestie mcp tools dry-run --connect
bestie mcp classify dry-run read_file --category read
bestie mcp call dry-run read_file --read --json '{"path":"README.md"}'
bestie mcp call dry-run read_file --read --ask --json '{"path":"README.md"}'

bestie mcp add hiện thêm URL-based server dùng http hoặc streamable-http. Nếu truyền --oauth-client-id và discovery thành công, Bestie ghi OAuth metadata vào config rồi yêu cầu chạy bestie mcp login <name>. Token sau login được lưu trong .bestie/.env, không lưu raw secret trong config.

bestie mcp tools <name> --connect có thể auto-classify tool mới từ MCP annotations: readOnlyHint thành read, destructiveHint thành destructive, và openWorldHint thành external_write. Vẫn phải review classification trước khi gọi tool.

  • Classify từng MCP tool.
  • Bắt đầu bằng read-only.
  • Secrets để trong env, không để trong config.
  • Redact secrets khỏi logs/errors.
  • Ask trước local write, external write, destructive, public và payment actions.