Venira Mcp

io.github.N0moreher0由 GitHub 账号 N0moreher0 发布v1.19.0更新于 Nov 8, 2026

Workspace-scoped MCP server for coding agents: files, search, shell, checkpoints, PR/CI, audit.

概览

AI 生成的概览

面向 AI 编程代理的工作区级工具集:文件读写编辑、搜索、代码分析、Shell 执行、快照,以及可选的 PR/CI 工具。

可以做什么
  • 列出、读取、批量读取并查看工作区内的文件与目录
  • 按文件名、内容、正则或符号搜索;生成符号大纲、比较文件差异、分析依赖图与改动影响
  • 创建、编辑、批量编辑和删除文件,并可用快照做检查点与回滚
  • 异步运行 Shell 命令,轮询或取消,并根据日志文本诊断错误
  • 把 API 令牌存入本地加密保险库,并注入到命令中
  • 专家模式下可创建、评论、合并拉取请求,并读取、触发或控制 CI 运行
适用场景
适合让编程代理在单个项目目录内工作,获得更快的批量读取、受保护的写入、可回滚的检查点和审计记录,而不必直接使用原始 Shell 与文件访问。专家模式额外提供 GitHub、GitLab 或 Bitbucket 的拉取请求与 CI 操作。
运行要求
通过 npx 以 stdio 在本地运行(需要 Node.js,并依赖原生模块 better-sqlite3)。需将 VENIRA_WORKSPACE 设为项目目录;VENIRA_DATA_DIR 可选,用于指定审计数据库与加密密钥的存放位置。其他可选变量用于选择工具模式、输出模式和安全配置。PR/CI 工具需要提供商令牌,可通过密钥工具或 git 令牌变量提供。
安装前请注意
它是防护栏而非沙箱:以当前操作系统用户权限运行,Shell 命令仅按规则分类,被诱导的代理仍可能执行当前配置放行的有害命令。同一用户下的任何进程都能读取 VENIRA_DATA_DIR 中的密钥。写入、编辑、删除和快照恢复会改动文件,删除不可撤销。Shell 执行、PR 合并和 CI 触发会影响真实系统。将 VENIRA_UNRESTRICTED 设为 1 会关闭工作区路径限制,off 安全配置会关闭 Shell 检查。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Venira Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

venira-mcp

Fast, workspace-scoped MCP server for coding agents (OpenCode, Claude Desktop, any MCP client). Two tool modes — Default (32 coding tools + shell, no CI/CD) · Expert (43 tools: default + CI/CD). Setting VENIRA_ALLOW_JS_EXEC=1 adds project_execute_js (33 / 44). Pure Node, 1 native dependency (better-sqlite3), no GUI, no external binary.

Security scope. Venira is a guard rail with an audit trail, not a sandbox. It runs with the privileges of the OS user that started it. The workspace lock limits the paths the file tools can touch (unless VENIRA_UNRESTRICTED=1), not what a shell command does: commands are classified by rules (allow / ask / deny) and every call is audited, but a malicious prompt can still steer the agent into running a harmful command that the active profile lets through (with off, every command runs). Anything running as the same OS user can read the keys in VENIRA_DATA_DIR. For untrusted workspaces, or whenever you need a real isolation boundary, run Venira in a container or VM. Details: SECURITY.md.

1. Setup

One-line install (run in your project, then restart the client):

bash
npx --yes venira-mcp@latest --install auto --workspace .

Prefer your agent? Paste this prompt into OpenCode/Claude/Cursor:

text
Set up Venira MCP for this workspace.1. Detect my MCP client config path.2. Run: npx --yes venira-mcp@latest --install auto --workspace .3. Restart the client. Then call project_health to verify.

Manual config (pick your client):

ClientConfig pathFormat
VS Code<workspace>/.vscode/mcp.jsonJSONC
OpenCode~/.config/opencode/opencode.jsoncJSONC
Claude Desktopclaude_desktop_config.jsonJSON
Cursor~/.cursor/mcp.jsonJSON
Codex~/.codex/config.tomlTOML

All use the same npx command. See §2 for ready-to-copy JSON/TOML.

In this repo .vscode/mcp.json is git-ignored because it holds machine-specific settings (and may relax security flags). Copy .vscode/mcp.example.json to .vscode/mcp.json and adjust it locally.

2. Client configs (copy-paste)

The examples use four environment variables: workspace, tool set, output size, and security posture. For most users, change only VENIRA_WORKSPACE and keep VENIRA_SECURITY_PROFILE=balanced.

OpenCode / VS Code / Cursor / Claude / Kimi / DeepSeek / Antigravity — use the wrapper format supported by your client:

jsonc
// OpenCode: "mcp" > "venira" > "environment"{  "mcp": {    "venira": {      "type": "local",      "command": ["npx", "--yes", "--package=venira-mcp@latest", "venira-mcp"],      "enabled": true,      "environment": {        "VENIRA_WORKSPACE": "/absolute/path/to/project",        "VENIRA_TOOL_MODE": "expert",        "VENIRA_OUTPUT_MODE": "full",        "VENIRA_SECURITY_PROFILE": "balanced"      }    }  }}
// VS Code: "servers" > "venira" > "env"; ${workspaceFolder} expands automatically.{  "servers": {    "venira": {      "type": "stdio",      "command": "npx",      "args": ["--yes", "--package=venira-mcp@latest", "venira-mcp"],      "env": {        "VENIRA_WORKSPACE": "${workspaceFolder}",        "VENIRA_TOOL_MODE": "expert",        "VENIRA_OUTPUT_MODE": "full",        "VENIRA_SECURITY_PROFILE": "balanced"      }    }  }}
// Claude / Cursor and compatible clients: "mcpServers" > "venira" > "env"{  "mcpServers": {    "venira": {      "command": "npx",      "args": ["--yes", "--package=venira-mcp@latest", "venira-mcp"],      "env": {        "VENIRA_WORKSPACE": "/absolute/path/to/project",        "VENIRA_TOOL_MODE": "expert",        "VENIRA_OUTPUT_MODE": "full",        "VENIRA_SECURITY_PROFILE": "balanced"      }    }  }}

Generic MCP JSON example

For clients that accept the common mcpServers JSON shape, use the example for the user's operating system as a realistic starting point. Replace the example paths with paths on the user's machine; VENIRA_DATA_DIR is optional and can point to any writable directory. Keep this file private if it contains local paths or credentials.

Windows:

json
{  "mcpServers": {    "venira": {      "command": "npx",      "args": ["--yes", "--package=venira-mcp@latest", "venira-mcp"],      "env": {        "VENIRA_WORKSPACE": "C:\\Users\\YourName\\Projects\\my-app",        "VENIRA_DATA_DIR": "C:\\Users\\YourName\\AppData\\Local\\venira",        "VENIRA_TOOL_MODE": "expert",        "VENIRA_OUTPUT_MODE": "full",        "VENIRA_SECURITY_PROFILE": "balanced"      }    }  }}

Linux:

json
{  "mcpServers": {    "venira": {      "command": "npx",      "args": ["--yes", "--package=venira-mcp@latest", "venira-mcp"],      "env": {        "VENIRA_WORKSPACE": "/home/yourname/projects/my-app",        "VENIRA_DATA_DIR": "/home/yourname/.local/share/venira-mcp",        "VENIRA_TOOL_MODE": "expert",        "VENIRA_OUTPUT_MODE": "full",        "VENIRA_SECURITY_PROFILE": "balanced"      }    }  }}

mcpServers is a common client configuration shape, but some clients use a different outer key or file format. Preserve the Venira command, args, and environment values when adapting the example. The approval command returned at runtime uses the effective data directory from this configuration, so users and agents should copy data.approval.approve_command instead of constructing a path themselves.

Codex (~/.codex/config.toml):

toml
[mcp_servers.venira]command = "npx"args = ["--yes", "--package=venira-mcp@latest", "venira-mcp"]
[mcp_servers.venira.env]VENIRA_WORKSPACE = "C:\\path\\to\\project"VENIRA_TOOL_MODE = "expert"VENIRA_OUTPUT_MODE = "full"VENIRA_SECURITY_PROFILE = "balanced"

Security profiles

VENIRA_SECURITY_PROFILEShell policyJavaScript approvalUse
strictstrictRequiredRead-only and workspace-local allowlist runs without approval
balanced (default)balancedRequiredRecommended general-purpose setting
trustedpermissiveRequiredAsk-rule and unclassified commands run; hard-deny commands require approval
offoffDisabledTrusted environments only; prints a warning and audits shell commands

VENIRA_SHELL_MODE and VENIRA_JS_EXEC_APPROVAL are advanced overrides and take precedence over the profile. VENIRA_ALLOW_JS_EXEC=1 separately registers the JavaScript tool; it remains disabled by default.

Choose trusted when you want fewer prompts on a personal machine. Choose off only when you intentionally accept that shell checks and per-call JavaScript approval are disabled. The secret_env gate remains active in every profile.

Advanced configuration

VariableDefaultChange when
VENIRA_SHELL_MODEProfile mappingYou need to override only the shell policy (strict, balanced, permissive, or off)
VENIRA_JS_EXEC_APPROVALProfile mappingTrusted automation needs to skip per-call JS approval
VENIRA_ALLOW_JS_EXEC0You need to register project_execute_js
VENIRA_UNRESTRICTED0Keep workspace path restrictions enabled; do not set to 1 in production

See the full environment reference in §6 for caching, shell, provider, and diagnostic options.

3. Benchmark (per-op, p50)

Measured: Windows + Node 24, standalone build, 2026-11-01.

Opp50Notes
Cached read_file8.0 mswarm cache
read_batch (8 files)12.8 msone call, 8 items
get_file_info6.2 mscached
search (literal, *.ts)11.5 msp95 ≈ 1.3 s (file count dependent)
health (no DB)28.5 ms
shell_run + status~930 ms2 s wait budget dominates
First call113.7 mspost warm-up

Batch: 8 reads as one batch call (16.6 ms) vs 8× individual (~76 ms) — the round-trip saving that makes the agent loop fast.

Agent tool-path benchmark: Venira MCP vs Codex exec_command

Measured on 2026-11-07 on one Windows 11 build 26200 machine (Intel Core i5-1035G1, 8 logical processors, 11.8 GiB RAM, Node v24.20.0). Each workload used 20 paired samples per phase, alternating call order. Venira used the persistent MCP connection; each native exec_command call launched a fresh PowerShell process. Cache-miss samples cleared Venira's in-process cache; warm samples reused it. The OS filesystem cache stayed warm.

WorkloadPhaseVenira p50 / p95exec_command p50 / p95Ratio of p50s
Read first lines of 8 files in one batchCache miss53.5 / 72 ms962 / 1,121 ms17.98×
Read first lines of 8 files in one batchWarm39 / 60 ms1,103.5 / 1,549 ms28.29×
Search VENIRA_WORKSPACE across the workspace (49 hits)Cache miss118.5 / 188 ms1,034.5 / 1,507 ms8.73×
Search VENIRA_WORKSPACE across the workspace (49 hits)Warm34.5 / 152 ms1,018 / 1,383 ms29.51×

Both workloads matched exactly in all 20 pairs: normalized text for the 8-file batch and sorted file/line locations for search. These are practical agent tool-path timings, not raw filesystem timings. A separate 100-sample component benchmark shows native PowerShell can be faster for simple uncached reads; the largest Venira gains are on warm list/search and avoiding a fresh shell process. The p95 estimates are rough with 20 samples, and results from this one machine are not a general performance guarantee.

See the full methodology and results and raw samples. Reproduce the component benchmark from the repository root with npm run bench:tools -- --runs=100.

4. Two tool modes

Two tool modes set which tools the client sees. Set via VENIRA_TOOL_MODE env var or "toolMode" in venira.config.json (env wins). VENIRA_PROFILE=core|full still applies on top.

ModeToolsIncludes
default32 (33 with VENIRA_ALLOW_JS_EXEC=1)Read/write/edit/search, code intel, snapshots, shell, project_delete_path, optional JS exec — no CI/CD
expert43 (44 with VENIRA_ALLOW_JS_EXEC=1)Everything in default + project_pr_*, project_ci_*

project_delete_path is always available. In balanced / strict mode, shell rm -rf / / ~ and Windows drive-wide deletes are hard-denied, and recursive/force deletes (Remove-Item -Recurse -Force, rd /s /q, del /f /q) need approval. permissive mode applies no shell checks at all.

5. Tools quick reference

All tools return the standard envelope (ok, kind, data, hint, elapsed_ms).

Read (batch-safe, cached)

ToolPurpose
project_list_filesList files/dirs, depth 1–3, limit ≤ 200
project_read_fileRead a file by line range; optional ranges[] (up to 16)
project_get_file_infoFile/dir metadata (kind, size, mtime)
project_searchSearch by file/dir name, content, regex, or symbol; hybrid: 1 tags hits with source+confidence
project_recent_filesRecently modified files (index-first, scan-fallback)
project_read_batchUp to 8 read-only ops in one call; each item takes the same arguments as its standalone tool (search items support regex, case_sensitive, hybrid, ...)
project_healthDiagnostics: capability, queue, cache hit-rates, p50/p95, and security limits notice
project_read_auditRead recent audit log rows

Write (mutating, pass reason)

ToolPurpose
project_write_fileCreate/overwrite/append; expected_sha256 guards blind overwrites
project_edit_fileReplace old_text→new_text; edits[] (up to 64); fuzzy edit opt-in
project_edit_batchMultiple edits; stops at first failure and attempts checkpoint rollback. Check data.atomic and data.rollback_succeeded; snapshot failure/incompleteness or a partial restore means changes may remain.
project_createCreate file or directory
project_delete_pathDelete file/dir; not undoable

Checkpoints (git-free rollback)

project_snapshot — create/list/restore/delete. Content-addressed, deduplicated, atomic per-file restore.

Code intelligence

ToolPurpose
project_outline_symbolParse a file's symbols (functions, classes, types) with line numbers
project_diff_filesUnified diff between two files
project_symbol_referencesFind all occurrences of a named symbol
project_selective_searchMulti-query search with AND/NOT + fuzzy scoring
project_dependency_graphTS/JS/Python/Rust/Go/Java/Kotlin import/symbol graph (JSON/DOT/Mermaid)
project_change_impact"What breaks if I edit this?" — bounded reverse/forward closure

Shell (async, policy-gated)

ToolPurpose
project_shell_runRun a command; background: 0 blocks for final output; 1 returns run_id
project_shell_statusPoll a running command (not queued, not audit-logged)
project_shell_cancelKill a running command by run_id
project_shell_cancel_sessionKill all shell runs in this session

Git provider: PR/CI (GitHub, GitLab, Bitbucket)

project_pr_create/comment/merge/list/close/reopen, project_ci_status/trigger/logs/wait, project_ci_control (cancel / retry-failed; Bitbucket supports cancel only) — same tool args across providers; token from project_secret or env vars.

CI reads are bounded and never hide a cap:

  • Pagination — status/job/check-run/step lists follow the provider's next-page link (Link header on GitHub/GitLab, body next on Bitbucket) for at most 5 pages / 200 items, stay on the configured API origin, and never fetch the same page twice. When a cap or the provider total stops the walk, the result says so (truncated / partial) instead of reporting a partial list as complete.
  • Verdicts — a finished Bitbucket pipeline/step is read from state.result (not just COMPLETED), so a failed run is never shown green.
  • Logs — failing steps/jobs are read first; archives and entries are byte-capped (see VENIRA_GIT_LOG_*), and a log whose declared size is over the cap is refused before it is downloaded.
  • project_ci_wait — one bounded long-poll (no polling loop). Returns summary (one line), next_step (wait_again · merge_or_continue · fix_failing_step_then_push · read_logs · inspect_status), failing_jobs (max 5) and, on failure, a failure_tail of the first failing job (numeric ids on GitHub/GitLab, UUID step ids on Bitbucket).

Secrets (encrypted at rest)

project_secret — store/inspect/remove credentials by name; AES-256-GCM; rotation metadata; expired secrets refused. project_github_connect — GitHub Device Flow, tokens in vault.

Diagnostics & planning

project_explain_error — turn an error into a cause + next tool calls (rule table, no model). project_plan_read_batch — plan which files to read for a task, returns ready project_read_batch call.

JS execution

project_execute_js — run synchronous JS (opt-in, VENIRA_ALLOW_JS_EXEC=1); per-call human approval by default.

6. Environment variables (key ones)

Full reference: the source reads 90+ distinct VENIRA_* names; this table lists the documented ones. See the source or npx venira-mcp --help for the rest.

VariableDefaultWhat it does
VENIRA_WORKSPACEprocess.cwd()Workspace root; all paths resolve against it
VENIRA_TOOL_MODEdefaultdefault (32 tools) or expert (43 tools); +1 with VENIRA_ALLOW_JS_EXEC=1
VENIRA_OUTPUT_MODEfullfull or compact (summarize/trim payloads > 8 KiB; generic payloads use preview_text)
VENIRA_PROFILEfullfull or core (disables dependency graph / change impact)
VENIRA_UNRESTRICTED"0""1" disables workspace lock (never in production)
VENIRA_SECURITY_PROFILEbalancedSelects shell policy and JS approval defaults: strict, balanced, trusted, or off
VENIRA_SHELL_MODEProfile mappingAdvanced override for shell policy: strict, balanced, permissive, or off
VENIRA_SHELL_EXIT_EARLY"1""1" pollers return as soon as exit code is known
VENIRA_SHELL_TIMEOUT_POLICY"soft""soft" warns on timeout · "hard" kills process tree
VENIRA_SHELL_ENV_PASS_ALL"0""1" passes full host env to shell (build tools that need it)
VENIRA_ALLOW_JS_EXEC"0""1" registers project_execute_js
VENIRA_JS_EXEC_APPROVALProfile mappingAdvanced override for per-call JavaScript approval
VENIRA_USE_RIPGREP"1""1" uses ripgrep if installed (faster on big repos)
VENIRA_CACHE_ALL"1""1" TTL caches on · "0" always-fresh (slower)
VENIRA_EDIT_FUZZY"0""1" enables fuzzy-match fallback for old_text
VENIRA_DATA_DIRper-user OS pathWhere audit DB + encrypted secrets live
VENIRA_SNAPSHOT_ROOT<per-user data dir>/snapshotsShared checkpoint root for every project and client; each workspace gets its own sub-folder (absolute path)
VENIRA_SNAPSHOT_DIRunsetExact checkpoint store for a single project, no sub-folders; wins over VENIRA_SNAPSHOT_ROOT (absolute path)
VENIRA_SNAPSHOT_KEEP20Checkpoints kept per project (oldest pruned on create)
VENIRA_SNAPSHOT_MIRROR_DIRunsetOptional append-only copy of the checkpoint store in this existing folder (OneDrive/Dropbox, NAS share, USB drive, rclone mount); absolute path, must be outside the store and the workspace
VENIRA_SNAPSHOT_MIRROR_TIMEOUT_MS20000 after create, 100000 for action=mirrorTime budget of one mirror run; it stops between files (partial) and the next run resumes
VENIRA_DISABLE_TOOLSunsetComma-separated tool names to hide from tools/list
VENIRA_GIT_PROVIDERinferredgithub / gitlab / bitbucket
VENIRA_GIT_TOKENunsetFallback token when no provider-specific secret found
VENIRA_GIT_TIMEOUT_MS60000Per-request timeout for provider JSON calls (1 000–600 000)
VENIRA_GIT_RETRIES1Retries for safe GET reads only (0–3); POSTs are never replayed
VENIRA_GIT_LOG_TIMEOUT_MS90000Timeout for CI log downloads (1 000–900 000)
VENIRA_GIT_LOG_ZIP_BYTES33554432Max bytes of a CI log archive; larger declared sizes are refused before download
VENIRA_GIT_LOG_ENTRY_BYTES / VENIRA_GIT_LOG_TEXT_BYTES4194304 / 8388608Per-entry and total decoded log text caps
VENIRA_SECRET_ALLOW_REVEAL"0""1" allows reveal=1 to print secret plaintext
VENIRA_SHELL_OVERRIDESunsetOperator allowlist: ALLOW_GIT_PUSH, ALLOW_ENV_READ
VENIRA_TRACE"0""1" logs every tool call to stderr (debug only)
VENIRA_PERMISSION_MODEallow_allPermission mode passed when the session scope opens (manual / best_effort / allow_all); shown in project_health
VENIRA_SESSION_IDautoSet for test/verify runs to separate audit rows
VENIRA_SHELL_ELICIT"0""1" asks the person through an MCP confirmation dialog (client must support elicitation)
VENIRA_SESSION_GRANT_RULESbuilt-in: cd_outside_workspaceExtra ask-rule ids (comma-separated) that may be approved with --approve --session
VENIRA_SHELL_APPROVAL_TTL_MS600000 (10 min)Lifetime of an in-memory --session grant; pending approvals always expire after a fixed 5 minutes
VENIRA_ALLOW_SELF_INSTALL"0""1" lets project_install_self write other clients' config files
VENIRA_SHELL_POLICY_FILEunsetPath to a JSON shell policy file (allow/ask/deny rules); never read from the workspace automatically
VENIRA_TOOL_POLICY_JSON / VENIRA_TOOL_POLICY_FILEunsetPer-tool policy rules, inline JSON or a file (see lib/tool-policy.ts)

7. Security model

Conservative by default:

  • Workspace lock: all paths validated inside VENIRA_WORKSPACE; ../ escape rejected (path_escape).
  • Security profile (VENIRA_SECURITY_PROFILE, default balanced): sets shell policy and per-call JS approval together. VENIRA_SHELL_MODE and VENIRA_JS_EXEC_APPROVAL can override either setting individually. Every project_shell_run command is classified allow, ask or deny.
    • balanced (default): hard-deny rules refuse the command; ask rules need approval; routine dev-workspace commands run; anything unclassified needs approval.
    • strict: like balanced, but only a read-only / workspace-local allowlist runs without approval.
    • permissive (the trusted profile): ask-rule commands run without a prompt; a hard-deny match becomes an approval request (ask.deny.<rule>).
    • off: the shell policy is disabled — every command runs, nothing is asked or denied (only secret_env injection still asks). Prints a startup warning; use only in a trusted environment. Previous permissive behaviour (v1.14.4) = off.
    • Hard-deny (14 rules): disk destroy, filesystem mount/overwrite, shutdown/reboot, fork bomb, pipe download to shell, privilege escalation (sudo/doas/runas), filesystem root/drive-home delete (rm -rf /, rm -rf C:\, Remove-Item -Recurse -Force $HOME, …), chmod 777 /, Windows drive-wide and wildcard mass delete, encoded PowerShell commands, self-approval (touching the approve CLI or approval store), protected credential/key files.
    • Ask (20 rules): command substitution, reads/writes/cd outside the workspace, network access, package mutation, git history rewrite, container/VM control and state, process control and taskkill /f, secret dumps, dynamic execution and wrapper commands, find -delete/-exec, destructive recursive/force deletes (Remove-Item -Recurse -Force, rd /s /q, del /f /q; prefer project_delete_path), attribute reset, infinite writes to NUL, unresolved file arguments.
    • Deny always wins over ask.
  • Secrets: AES-256-GCM encrypted at rest; values never in tool metadata; secret_env requires human approval; expired secrets refused.
  • Provider DLP: Secretlint scans PR/CI request args and HTTP payloads; detected credentials blocked before sending, withheld from response.
  • Audit trail: all ops (including failures) written to SQLite WAL; project_read_audit for post-mortems.
  • Token transport: provider token in Authorization header only; dropped on cross-origin redirect.

Approvals — what needs a human, and how it is granted

GateTriggers whenSwitch (default)
Shell denyA hard-deny rule matches: refused outright, no approval possibleVENIRA_SECURITY_PROFILE (balanced; trusted asks; off disables shell checks)
Shell askAn ask rule matches, or the command is unclassified in balanced / strictVENIRA_SECURITY_PROFILE (balanced) · advanced override: VENIRA_SHELL_MODE
Secret injectionproject_shell_run with secret_envalways asks, in every mode
project_execute_jsEvery callVENIRA_ALLOW_JS_EXEC (0: tool not registered) · profile JS gate (strict / balanced / trusted: on; off: off) · advanced override: VENIRA_JS_EXEC_APPROVAL
Secret plaintextproject_secret with reveal=1VENIRA_SECRET_ALLOW_REVEAL (0)
Self-installproject_install_self writes another client's configVENIRA_ALLOW_SELF_INSTALL (0)
Named shell overrideALLOW_GIT_PUSH / ALLOW_ENV_READVENIRA_SHELL_OVERRIDES (unset), plus override and a reason on the call

Granting a shell or JS approval:

  1. The call fails with [approval_required] and returns data.approval_id (valid for 5 minutes) together with the command or code, the rule and the reason. Shell and JS share one payload, data.approval: { approval_id, gate, rule, reason, subject_preview, expires_at, approve_command, retry_with: { tool, arguments } }.
  2. A person copies data.approval.approve_command exactly into an interactive PowerShell terminal (the returned command includes the server data directory and works in Windows PowerShell and PowerShell 7), reviews the request and answers y. The CLI refuses without a TTY. --yes skips the prompt. --session extends the grant to the same command group until it expires, but only for rules in VENIRA_SESSION_GRANT_RULES (built-in: cd_outside_workspace).
  3. The agent retries the same call with approval_id. The grant is HMAC-signed, tied to the session, bound to the exact command / shell / cwd / secret_env / rule (or code / argv for JS), and single-use. Concurrent retries of the same id cannot both run: consumption is an atomic file claim, so exactly one wins.

TTL behavior: the pending request (approval_id) is valid for a fixed 5 minutes and cannot be revived by retrying. A --session grant lasts 10 minutes by default (VENIRA_SHELL_APPROVAL_TTL_MS) and lives only in this server process; restarting the server clears it.

Agent helpers:

  • project_shell_run with dry_run: 1 returns the tier, rule and would_run / requires_approval without running anything or creating an approval, so an agent knows beforehand which command will be asked.
  • approval_wait_ms (max 45000) on project_shell_run / project_execute_js keeps the call open while the human approves; a grant that arrives in time runs the command in the same call, otherwise you get the normal [approval_required] (the pending approval_id stays valid). Keep it below the client's request timeout.
  • project_health reports approvals (mode, JS gate, elicitation, session rules, TTL, max wait), the shared posture report (level, stable finding ids such as workspace.unrestricted, profile.off, combo.unrestricted_open_shell, js.exec_without_approval) and the flat warnings list. Posture findings are warnings only; invalid values already fail closed at startup. doctor surfaces the same report.

Alternative (off by default, project_shell_run only): VENIRA_SHELL_ELICIT=1 shows a confirmation dialog in MCP clients that support elicitation, and accepting it records the grant for you.

Removed in v1.15: approval_token and VENIRA_SHELL_AUTO_APPROVE_TOKEN. Passing approval_token now returns [approval_invalid] with a hint to use approval_id; setting the env var only logs a warning and is ignored.

Approvals are a guard rail, not a sandbox: a process running as the same OS user can read the approval key.

Snapshot store (checkpoints)

Checkpoints live outside every workspace, in one shared per-user folder, so every MCP client that opens the same project sees the same history:

%LOCALAPPDATA%\venira\snapshots\        (Linux: ~/.local/share/venira/snapshots, macOS: ~/Library/Application Support/venira/snapshots)  my-app\              project.json  index\  blobs\  my-app-6cb89aac\     a second workspace that is also called "my-app"
  • Folder name = workspace folder name. The first workspace to claim a name keeps it (recorded in project.json); a different workspace with the same name gets a -<hash8> suffix. The same workspace always maps to the same folder, whatever the path casing or 8.3/symlink spelling.
  • Override with VENIRA_SNAPSHOT_ROOT (shared root) or VENIRA_SNAPSHOT_DIR (exact folder, single project). Both must be absolute paths; a relative one fails with [config_invalid].
  • The file tools (read, write, edit, search, delete) refuse anything under the snapshot root or exact dir, the same way they refuse the data dir. Only project_snapshot touches the store.
  • Retention is per project (VENIRA_SNAPSHOT_KEEP), so one busy project cannot push out another's checkpoints.
  • Shell commands are guarded too: any read, write or delete operand inside the snapshot store is a hard deny in balanced / strict (deny.protected_file_access) and needs approval in permissive. off disables shell policy entirely, so keep checkpoints you cannot afford to lose in a separate backup as well.
  • Unreadable checkpoints are reported, never dropped silently. project_snapshot action=list adds unreadable[] (snapshot_version_unsupported = written by a newer venira-mcp, snapshot_corrupt = broken index file) and a hint. While any index is unreadable, blob cleanup is paused (gc_skipped: "unreadable_manifests" on delete), because that index still owns blobs this build cannot enumerate. For the first case upgrade venira-mcp; for the second, remove the broken index\<id>.json.gz yourself (agent shell access to the store is denied by design) and cleanup resumes.
  • Manifests carry a version. Older layouts are upgraded in memory when read (MIGRATIONS in lib/snapshot-store.ts); the file on disk is never rewritten.

Backing up the store

The store is plain files: immutable content-addressed blobs\<ab>\<sha256>, gzip manifests in index\ written by write-then-rename, and project.json naming the owning workspace. A backup is a folder copy; a restore is copying it back to the same location (a checkpoint only restores into the workspace recorded in its manifest).

  • Run the copy yourself, outside the agent: shell policy denies the store to agent commands.
  • Copy the shared root (VENIRA_SNAPSHOT_ROOT) to cover every project, or one project folder. Windows: robocopy "%LOCALAPPDATA%\venira\snapshots" "D:\backup\venira-snapshots" /E; Linux/macOS: rsync -a ~/.local/share/venira/snapshots/ /mnt/backup/venira-snapshots/ (macOS: the Application Support path above).
  • Do it while no agent is creating or deleting checkpoints. If you copy in two passes, take index\ first and blobs\ second: a blob is always written before the manifest that references it, so that order cannot capture a manifest without its blobs, while the reverse order can. Blobs without a manifest are harmless leftovers.
  • After restoring a backup, project_snapshot action=list should show the expected count and no unreadable entries.

Mirroring the store (optional)

Set VENIRA_SNAPSHOT_MIRROR_DIR to an existing absolute folder and venira keeps a second copy there, with no cloud SDKs, credentials or network code of its own (point it at a OneDrive/Dropbox folder, NAS share, USB drive or rclone mount and let that tool move the bytes).

  • Same layout as the store (<mirror>\<project>\project.json, index\, blobs\), so restoring is copying the folder back to the store location; there is no separate format.
  • After every project_snapshot action=create the result carries mirror (status, copied_blobs, copied_indexes, bytes, failed[], error). It is best-effort: a mirror problem never changes the checkpoint's own status. project_snapshot action=mirror runs the same sync on demand; add verify=1 to re-hash every blob already at the mirror and re-copy bad ones.
  • Order is blobs, then indexes, then project.json, so the mirror never holds a checkpoint whose blobs are missing. Every copy is verified (blob sha256 equals its file name; index bytes equal the source) before it gets its final name. A corrupt local blob blocks only the checkpoints that use it.
  • Append-only: venira never deletes anything at the mirror. A checkpoint pruned locally (VENIRA_SNAPSHOT_KEEP) or deleted stays at the mirror until you remove it by hand, so expect it to grow; the only overwrite is verify=1 replacing a file that no longer matches its source.
  • Bounded: a run stops between files once its time budget is spent and reports partial / timed_out; run it again to resume (only missing files are copied). A first sync of a large store may need a few runs.
  • Refused ([config_invalid]): a relative path, a folder that does not exist (venira never creates the mirror root, so an unmounted drive is not silently replaced by a local folder), and a folder that equals, contains or sits inside the local store or sits inside the workspace. A mirror folder already owned by a different workspace fails with [mirror_conflict].
  • The mirror folder is a protected root like the store: file tools refuse it and shell commands that read, write or delete inside it are denied.
  • To restore after losing the store: copy <mirror>\<project> back to the store location (for example %LOCALAPPDATA%\venira\snapshots\<project>) with venira stopped, then project_snapshot action=list. Unreadable local indexes are not mirrored (they are counted in skipped_unreadable).

Threats this does NOT protect against: a malicious prompt can still instruct the agent to run destructive commands. Use a container/VM for untrusted workspaces — see ISOLATION.md for Docker, WSL 2 and Windows Sandbox setups, including mounts, network controls and their limits.

8. Envelopes & error codes

Success:

jsonc
{ "ok": true, "status": "completed", "kind": "file_read", "data": { … }, "hint": "Next chunk: …", "elapsed_ms": 2.57 }

Failure:

jsonc
{ "ok": false, "status": "failed", "error": { "code": "not_found", "message": "…", "retryable": false }, "hint": "Check with project_list_files first", "next_actions": [{ "tool": "project_list_files", "arguments": { "relative_path": "." } }] }

ok describes the tool operation. For project_shell_run, a command that ran and exited non-zero still has ok: true; command_status: "failed" and hint report the command outcome. A running or cancelled command reports command_status: "running" or "cancelled". A read batch with failed items reports top-level ok: false, status: "partial", and error.code: "batch_partial_failure"; inspect data.responses for each result.

In compact mode, shortened payloads set trimmed: true and truncated: true; summary describes omitted content. For an otherwise unsupported large payload, data.preview_text contains a bounded JSON-text preview and summary reports the original size and shape. Large error messages or attached error data are also explicitly marked as trimmed. Use full when the complete payload is required.

Common codes: not_found, invalid_request, old_text_not_found, old_text_ambiguous, stale_content, path_escape, resource_limit, sensitive_result, unsupported, internal.

9. Agent instructions (paste into AGENTS.md / CLAUDE.md)

text
Venira MCP rules:1. Unfamiliar task: call project_plan_read_batch first, then run steps[0].2. Read with project_read_batch (up to 8 items). Never re-read a file a tool already returned.3. Prefer project_edit_file / project_edit_batch over project_write_file; pass `reason` on every mutation.4. Snapshot before multi-file or destructive changes.5. Short commands: project_shell_run with background: 0. Long jobs: background: 1, then poll project_shell_status.6. Do not call project_execute_js unless the user asked for JS; it needs per-call approval.7. On failure, follow the envelope's hint. Treat ok:false + retryable:false as final.8. Report only what the tool returned.9. On [approval_required]: stop, tell the user the approval_id and approve_command, do not loop or approve it yourself; retry once with data.approval.retry_with after they confirm. Use dry_run: 1 to preview a command's tier.

10. Development

bash
npm run build       # tsc → dist/  (verify launches dist/server.js, so rebuild before verifying)npm run smoke       # in-process sanity checknpm run doctor      # 15 preflight checksnpm run verify      # 518 behavioural + security checksnpm run coverage:shell  # V8 coverage for lib/shell-*.ts (report only, no thresholds)npm run bench:mcp   # end-to-end numbers

Adding a tool:

  1. Register in tools/project.ts → registerProjectTools, use the config() helper.
  2. Read-only: route through executeCached; mutations: add to MUTATING set.
  3. Envelope: use buildEnvelope / errorEnvelope from lib/output.ts.
  4. Add a check in the matching section module under scripts/verify/ (scripts/verify.ts only orchestrates); update the decision tree in server.ts INSTRUCTIONS.
  5. npm run build && npm run verify && npm run bench:mcp — paste numbers in the PR.

11. Troubleshooting

SymptomFix
not_found on a path that looks fineRun npm run doctor; confirm VENIRA_WORKSPACE points where you think
path_escapePath resolves outside workspace; use a workspace-relative path
Shell command not finishingproject_shell_status with wait_seconds: 30; check project_health → shells.active
better-sqlite3 build failureUnusual platform; run npm rebuild better-sqlite3 with build tools, or use the Docker image
SQLite binding unavailableThe server still starts. Audit writes are skipped in the default best-effort mode; set VENIRA_AUDIT_STRICT=1 to fail operations that cannot be recorded. Install/rebuild better-sqlite3 to restore the audit trail.
venira.db won't openAnother process has the WAL locked; make sure only one server writes to the same data dir
Everything slowproject_health → queue.depth and per-op p95

License

Licensed under the GNU Affero General Public License v3.0 (AGPLv3) — see LICENSE.

Free for developers, individual use, and open-source projects. Embedding Venira into proprietary closed-source services or commercial agent platforms requires a commercial license from the author.

来源:README.md,提交 8300e17

工具

32

project_list_files

List files

List files/directories in the workspace. depth 1..3 shows the tree in a single call. Use when: you need to see the directory tree, check a path, or list files before reading. Avoid when: you only need one file's metadata (project_get_file_info) or one file's contents (project_read_file). Speed: fast; TTL cache 1.5s, auto-wiped on write/edit/delete. Output: file_list: entries, truncated, hint. Batch-safe: yes

输入参数depthlimitrelative_pathinclude_ignored

project_read_file

Read file

Read a text file, optionally by line range (1-based). The result carries next_start_line when truncated. Use when: you need the contents of one file, or one line range of a large file. Avoid when: you need to read 2+ files (project_read_batch) or only need metadata (project_get_file_info). Speed: very fast on repeat; cache validated by mtime+size. Output: file_read: text, first_line, last_line, total_bytes, next_start_line. Batch-safe: yes

输入参数rangesend_linemax_bytesstart_lineline_numbersrelative_path必填

project_get_file_info

Get file info

File/directory metadata (kind, size, modification time). Use when: you only need size/mtime/kind, or want to check that a path exists. Avoid when: you need the file's contents (project_read_file). Speed: very fast; cache validated by mtime+size. Output: file_info: relative_path, kind, size_bytes, modified_unix_seconds. Batch-safe: yes

输入参数relative_path必填

project_recent_files

Recent files

List files modified most recently in the workspace, newest first, plus session_edits (files you already wrote this session). Cheap orientation call: use it at the start of a task, when resuming, before editing a file the user may have changed, and after shell/build/git steps to see what really changed (bounded filesystem scan, skips node_modules/target/.git). Use when: starting or resuming a task, checking what the user or a command just changed (after shell/build/format/git), re-orienting after context loss, or picking the next files to feed into project_read_batch. Prefer it over listing a whole tree. Avoid when: you need the full list / by name (project_list_files) or content search (project_search). Speed: medium (filesystem walk); TTL cache 2s, bounded to 4000 files / 300 directories. Output: recent_files: entries[] sorted by mtime desc, scanned_files, truncated. Batch-safe: no

输入参数depthlimitrelative_pathinclude_ignored

project_read_batch

Batch read

Run up to 8 READ-ONLY ops (list_files, read_file, get_file_info, search) in one call; read/info use the cache so repeats are very fast. Each item takes the same arguments as the standalone tool, including numeric 0/1 flags (e.g. search regex, case_sensitive, hybrid). Use when: you need to read 2+ files/ops in the same step (reading context, scanning several files). Avoid when: there is only a single op; or you need a mutating op (use the corresponding tool). Speed: fastest for read-heavy work; sequential + cached, with a response budget. Output: read_batch: responses[] (each item is an ok/error envelope). Batch-safe: yes

输入参数requests必填max_response_bytes_per_item

project_write_file

Write file

Write a file. mode=create errors if it exists; overwrite replaces existing contents; append concatenates. Create and verify a scoped project_snapshot before overwriting existing file contents. Use when: create a new file or append content; before mode=overwrite on an existing file, create a scoped project_snapshot, confirm it captured the target, and keep the returned id. Avoid when: only a small section needs to change (project_edit_file), or an existing file would be overwritten without a verified pre-write project_snapshot. Speed: fast; clears the read/list/search cache for the affected path. Output: file_written: action, bytes_written, sha256_after. Batch-safe: no

输入参数modereasoncontent必填create_dirsrelative_path必填expected_sha256

project_edit_file

Edit file

Edit a file by exact text replacement: one old_text/new_text pair, or edits[] for multiple sections. Supports TOCTOU guard mode (guard=sha256) for atomic read-edit-verify cycle. Use when: change one or a few text sections whose exact content you know; pair with expected_sha256 to guard against blind overwrites. Use guard=sha256 for atomic read-edit-verify. Before editing 2+ files or 2+ sections, create a scoped project_snapshot and confirm coverage. Avoid when: the whole file must change (project_write_file), or you have not read the file to know old_text. Speed: fast; clears the read/list/search cache for the affected path. Output: file_written: replacements, sha256_before/after, verified (with guard=sha256). Batch-safe: no

输入参数editsguardreasonnew_textold_textreplace_allrelative_path必填fuzzy_distanceold_text_fuzzyexpected_sha256case_insensitiveignore_indentation

project_edit_batch

Edit batch

Apply multiple edit_file operations atomically in one call; aborts after the first failure and restores the pre-batch snapshot when possible. Use when: before editing existing files in a multi-edit batch, create a scoped project_snapshot when it spans multiple files/sections or needs rollback after later checks. Batch rollback covers an in-batch failure only; it does not undo a successful batch after tests fail. Avoid when: a single edit (project_edit_file) or a whole-file rewrite (project_write_file). Speed: depends on item count; each runs edit_file and clears caches. Output: batch: responses[] {ok, response|error}, atomic metadata with executed/skipped indexes and rollback status. Batch-safe: no

输入参数edits必填max_response_bytes_per_item

project_delete_path

Delete path

Delete a file or directory (directories require recursive=1). Create and verify a scoped snapshot before using this irreversible tool; do not delete if the checkpoint is incomplete. Use when: only after creating a scoped project_snapshot for the exact target, confirming file_count/truncated/skipped cover the intended files, and keeping its id for recovery. Avoid when: the target is ambiguous or a pre-delete snapshot is missing, truncated, or skipped the target. This op is not undoable; capture and verify a checkpoint first. Speed: fast; clears the read/list/search cache. Output: path_deleted: entries_deleted, bytes_deleted. Batch-safe: no

输入参数reasonrecursiverelative_path必填

project_shell_run

Shell run

Run a shell command (cwd defaults to /workspace/mcp-validate). Asynchronous by default: returns run_id immediately, so poll project_shell_status for the output. Pass background=0 (or false) for a foreground run: the call blocks until the command exits and returns the final stdout/stderr. For commands that overwrite/delete existing workspace source files, create and verify a scoped project_snapshot first; prefer project file tools for targeted edits. Commands pass a policy gate: risky ones return an approval_required error with a pending approval_id; catastrophic ones are denied outright. Named overrides require operator allowlisting and a per-call reason. Use when: build/test/lint/long-running commands. For hard-to-reverse workspace file changes, checkpoint first. Default (background=1) returns run_id immediately so it never blocks other tools; set background=0 when you need the final output in this call — it blocks until the command exits, and you must not start other work while waiting. After approval_required, ask the user to approve the approval_id in an interactive terminal, then retry. Avoid when: a command that may never finish: use the async default plus project_shell_status/project_shell_cancel. Speed: background=1 returns in ~5 ms, run time is up to the command; background=0 blocks for the whole run (bounded by timeout_ms, default 10 min). Output: shell_run: run_id/shell_id, running, exit_code, background/foreground, stdout_tail/stderr_tail, timed_out, policy; background=0 also returns bounded stdout/stderr. approval_required: rule, reason, approval_id, retry_with. Batch-safe: no

输入参数shellreasoncommand必填dry_runoverridebackgroundsecret_envtimeout_msapproval_idrelative_cwdapproval_scopeapproval_token另有 1 个

project_shell_status

Shell status

Check status + output of a running command. wait_seconds (0..30) is an observation window, not a timeout. Use when: after project_shell_run; poll until running=false. Avoid when: no run_id available yet. Speed: fast; not queued so it never blocks other tools. Output: shell_run: running, exit_code, stdout_tail/stderr_tail. Batch-safe: no

输入参数run_id必填wait_seconds

project_shell_cancel

Shell cancel

Cancel a running shell command by run_id. Use when: the command is running too long or its result is no longer needed. Avoid when: the command already finished (check with project_shell_status). Speed: fast; kills the whole process tree so grandchildren do not keep running. Output: cancellation: accepted, cleanup_complete. Batch-safe: no

输入参数run_id必填kill_key必填

project_create

Create file or directory

Create a directory OR a file in ONE call. For an existing file, mode=overwrite replaces its contents: create and verify a scoped project_snapshot first. Use when: create a directory or new file; if replacing an existing file, first create a scoped project_snapshot, confirm it captured the target, and keep its id. Avoid when: editing an existing file (project_edit_file/project_write_file); never use mode=overwrite unless a pre-write project_snapshot covers the existing contents. Speed: fast; triggers cache invalidation on write / new directory. Output: directory_created or file_written (data kind depends on the op). Batch-safe: no

输入参数kind必填modereasoncontentcreate_dirsrelative_path必填expected_sha256

project_health

Health & metrics

Server diagnostics: corehost/data dir/audit DB, capability, queue depth, cache hit-rate, running shells, p50/p95 metrics, plus a security-limit notice (guard rail, not sandbox). Use when: debugging slowness/errors, checking the backend/DB/audit before reporting, or inspecting this session's cache/metrics. Avoid when: you just need to read/write files normally. Speed: fast (~a few ms + 1 audit DB query); set include_audit=0 to skip the DB query. Output: health: notice, server, corehost, capability, queue, caches, shells, metrics, audit. Batch-safe: no

输入参数include_audit

project_cache_clear

Clear caches

Clear in-process read/search/list/recent/search/shell/graph caches. Use after a toolchain generates files outside normal write flow, or to force fresh reads. Use when: force-fresh reads after external tooling mutated files, or the cache stats show high hit/miss pressure. Avoid when: normal flow (cache invalidates on write/edit/delete). Speed: instant; clears LRU/TTL maps only (no backend call). Output: cache_clear: type, cleared per-cache entry counts. Batch-safe: no

输入参数type

project_trace_status

Trace status

Show the most recent traced tool calls from the in-memory buffer (last N) plus the trace configuration. Use when: VENIRA_TRACE=1 and you want to see what ran recently without reading the log file. Avoid when: tracing is disabled (returns an empty buffer) or you need the full on-disk log (read VENIRA_TRACE_FILE instead). Speed: instant; in-memory buffer only, no I/O. Output: trace_status: enabled, file, buffered, recent[] (newest last). Batch-safe: yes

输入参数limit

project_read_audit

Read audit log

Read recent rows from the SQLite audit log (WAL). Filter by session/operation/outcome; bounded by limit. Use when: you need to inspect what operations were recorded (audit trail) — e.g. compliance or debugging a prior action. Avoid when: you only need the live cache/metric report (project_health include_audit=1) — that one is faster. Speed: fast; one bounded SQLite read (readonly, WAL-safe). Output: audit_read: rows[] (newest first), count, truncated, db_path. Batch-safe: yes

输入参数limitverifyoutcomeoperationsession_idsince_unix

project_shell_cancel_session

Shell cancel session

Cancel ALL shell runs tracked in this session (kills every process tree). Use to cleanly tear down a session. Use when: a session is ending or a stuck session has many running commands and they must all be stopped. Avoid when: only one run needs cancelling (project_shell_cancel by run_id). Destructive: running commands are killed. Speed: fast; iterates the in-process shell run table and kills each tree. Output: shell_cancel_session: cancelled_run_ids[], count. Batch-safe: no

无需输入参数。

project_outline_symbol

Outline symbols

Parse a source file and return its symbol outline (functions, classes, types, interfaces) with line numbers. Use when: you need to see the structure / top-level symbols of a file before reading or refactoring it. Avoid when: you need every usage of a symbol (project_symbol_references) or a text-only diff (project_diff_files). Speed: fast; single-file regex scan, no external indexer. Output: outline_symbol: total_symbols, symbols[] {name, kind, line, signature}. Batch-safe: yes

输入参数languagemax_symbolsrelative_path必填include_classesinclude_functions

project_diff_files

Diff files

Unified (git-style) diff between two workspace files. Reports lines_added/lines_removed and the full hunk text. Use when: comparing two versions of a file, or reviewing changes before/after an edit. Avoid when: the two files are in different languages or one is binary; large binaries are not supported. Speed: medium; LCS-based diff over the two full texts, bounded by max_lines. Output: diff_files: lines_added, lines_removed, unified_diff, truncated. Batch-safe: yes

输入参数max_linescontext_linesrelative_path_a必填relative_path_b必填

project_symbol_references

Symbol references

Find every occurrence of a named symbol. scope=file (fast, single file) or scope=workspace (uses content search). Use when: you need to know where a symbol is used before renaming/refactoring it. Avoid when: you only need its declaration (project_outline_symbol) or an arbitrary string (project_search). Speed: fast for scope=file; medium for scope=workspace (single search call). Output: symbol_references: count, references[] {relative_path, line_number, context}. Batch-safe: yes

输入参数limitscopesymbol_name必填relative_pathmax_references

project_dependency_graph

Dependency graph

Build a deterministic file/symbol dependency graph for TypeScript/JavaScript, Python, Rust, Go, Java and Kotlin (module declarations, pub mod, use crate::/super::, extern crate, go.mod module resolution, import (...) blocks, relative imports, require(), dynamic import(), extends/implements, cross-file symbol references). Renders as JSON, DOT or Mermaid. Use when: you need the import graph, a module map to render, or the files/symbols a change can reach before refactoring. Avoid when: you only need usages of one symbol in one file (project_symbol_references) or a text search (project_search). Speed: medium; bounded walk (<=5000 files / 64 MB), parser-lite line scan, 5 s index cache invalidated on writes. No network. Output: dependency_graph: nodes[] {id, type, language, loc}, edges[] {from, to, type (import|extends|implements|references), confidence, line, via}, external[] {id, used_by}, unresolved[], stats, truncated; format=dot|mermaid returns data.graph. Batch-safe: yes

输入参数kinddepthformatlanguagesmax_edgesmax_nodesinclude_testsrelative_pathinclude_external

project_change_impact

Change impact

Answer "if I change these files/symbols, what depends on them?" with a bounded reverse (or forward) closure: affected files, distance, path, reason and confidence, plus affected symbols and a separate test count. Use when: before renaming/changing a function or file, to list the dependents you should read/test (direction=dependents), or the dependencies a module relies on. Avoid when: you need the whole graph (project_dependency_graph) or exact textual usages in one file (project_symbol_references). Speed: medium; reuses the dependency index (5 s cache, invalidated on writes), BFS bounded by depth. No network. Output: change_impact: seed {files, symbols}, affected[] {id, distance, path, reason, confidence, symbols?}, unresolved[], summary {affected_files, affected_symbols, max_distance, tests_affected}, truncated; format=mermaid returns data.graph. Batch-safe: yes

输入参数depthfilesformatsymbolsdirectionmax_nodesinclude_tests

project_detect_harnesses

Detect MCP harnesses

Detect which MCP-client harnesses (OpenCode/Claude/Cursor/Codex/Kimi/DeepSeek/Antigravity) have a config on this machine. Use when: before installing venira, to know which client configs exist and can be updated. Avoid when: you already know the config path (skip straight to project_install_self). Speed: fast; filesystem checks, no writes. Output: harness_detect: detected[] (found harnesses), harnesses[] {harness, detected, config_path, format, note}. Batch-safe: yes

无需输入参数。

project_install_self

Self-install venira MCP

Add the venira MCP entry to a target client's config (OpenCode/Claude/Cursor/Codex/Kimi/DeepSeek/Antigravity). Atomic + backup. Use when: a user asks to 'install venira into <client>' — add the MCP server block to that client's config file. Avoid when: the config path is unknown (run project_detect_harnesses first), or the user wants a dry-run (set dry_run=1). Speed: fast; one atomic write per config. Always backs up the original to <file>.venira-bak. Output: install_self: {harness, config_path, status (installed|already_present|config_missing|error), needs_restart, error?}. Batch-safe: no

输入参数dry_runharness必填data_dirworkspace

project_explain_error

Explain an error

Diagnose a failure from its error text / log tail: known signatures (errno, TypeScript, Python, git, npm, GitHub, venira codes) → likely cause + ready-to-send next tool calls. Rule-based, offline, instant. Use when: a command, test, build or provider call failed and you want the fastest route to the fix (feed it the stderr tail or the CI log tail). Avoid when: you already know the cause and only need the file contents (use project_read_file, which also accepts ranges). Speed: pure local rules, < 1 ms; no network and no model call. Output: explain_error: matched, summary, error_line, language, diagnoses[] {rule_id, title, likely_cause, suggested_fix[], retry_hint?, next_actions[]}, next_actions[]. Batch-safe: yes

输入参数languagelog_tailerror_text

project_plan_read_batch

Plan reads from a task

Plan a read: extract keywords from the task, run bounded content + file-name searches (+recent files), rank candidate source files by hits, path/name match and prose weight (build output, DB/log artifacts excluded), and return a ready project_read_batch call with a calibrated estimate. Deterministic planner, no model call. Use when: starting a task in an unfamiliar area and you do not know which files matter yet (one call instead of guess-read-repeat). Avoid when: you already know the exact files (call project_read_batch directly), or the task is a one-line lookup (project_search). Speed: 1-3 bounded content searches (~20 ms each) + local ranking; no file contents are returned. Output: plan_read_batch: task, keywords[], searched, candidates[] {relative_path, reason, hits}, steps[] {tool, arguments, why}, estimated_ms, notes. Batch-safe: yes

输入参数max_filesfiles_hintinclude_searchtask_description必填

project_snapshot

Workspace checkpoint

Checkpoint/rollback for the workspace: create a labeled, scoped snapshot before multi-file or hard-to-reverse edits; keep its returned id. For rollback, preview with restore dry_run=1 (size-based preview only; it cannot detect same-size content changes), inspect newer user edits, then restore that exact id with verify=1 and delete_extra=0. Content-addressed and deduplicated. Use when: before multi-file, cross-file, refactor/rename or hard-to-reverse edits: create with a descriptive label, scope paths to the affected area, retain the exact returned id, and confirm required files were captured. For rollback, run restore dry_run=1 to preview path/size changes (same-size content differences are not detected); inspect files with newer user edits, then restore the exact id with verify=1 and delete_extra=0. Example: checkpoint → edit 3 files → tests fail → inspect scope → restore. Avoid when: a tiny, easily recreated single-file edit, generated build output, or a commit already provides the needed recovery point; do not restore over newer user changes without inspecting them. Speed: create walks/hashes the captured files (skips .git/node_modules/dist, symlinks, huge files); repeats only store new blobs. restore is atomic per file, concurrency 4, SHA-256 verified by default; dry_run previews path/size only, not same-size content changes. Output: snapshot_create: id, label, file_count, total_bytes, new_blob_bytes, skipped[], truncated; snapshot_list: checkpoints[]; snapshot_restore: restored_count/restored[], deleted_count, skipped[]; snapshot_delete: deleted, bytes_freed; snapshot_mirror: status, copied_blobs, copied_indexes, bytes, failed[] (needs VENIRA_SNAPSHOT_MIRROR_DIR); snapshot_create adds mirror{} when configured. Batch-safe: no

输入参数idlabellimitpathsscopeactionreasonverifydry_runexcludemax_filesdelete_extra另有 2 个

project_github_connect

Connect GitHub

Connect GitHub through its Device Flow. The user authorizes at github.com; access and refresh tokens are saved in the encrypted local vault and are never returned. Use when: the user wants to connect or replace the local GitHub credential without pasting a token into chat. Avoid when: the user only needs GitHub public read access or has already configured a token. Speed: start returns a short-lived verification code; poll only at the interval GitHub specifies. Output: github_connect: start returns verification_uri, user_code, pending_id and expiry; poll returns pending, denied, expired or connected (never a token). Batch-safe: no

输入参数action必填pending_idreplace_existing

project_secret

Manage secrets

Manage API tokens/credentials without leaking them: values are encrypted at rest and never returned by default. Inject them into commands with project_shell_run secret_env=["NAME"] instead of pasting them into a command line. Rotation metadata (expiry, last use, use count) is tracked by default and expired secrets are refused. Use when: storing a non-GitHub token (action=set), checking whether one exists or is due for rotation (action=get / action=list), removing one (action=delete). Then use secret_env on project_shell_run or the built-in GitHub tools. Avoid when: the value is a normal, non-secret config (put it in .env or the config file); or you need the plaintext printed (only with reveal=1 + VENIRA_SECRET_ALLOW_REVEAL=1). Speed: fast; encrypted AES-256-GCM store, atomic writes, values decrypted only when injected. Expiry/use fields are metadata only. Output: secret_set: name, length, sha256_12, updated_at, expires_at, days_left, created, rotated; secret_get/list: metadata only (expires_at, expired, days_left, last_used_at, use_count, rotated_at); secret_delete: deleted. Batch-safe: no

输入参数namevalueactionreasonrevealvalue_envexpires_atexpires_in_days

版本历史

1
  1. v1.19.0最新Nov 8, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分