About Keen Pbr
Keen Pbr is an MCP server published by maksimkurb in the Maps category: keen-pbr is a Policy Based Routing toolkit for Keenetic and OpenWRT routers / Инструменты для выборочной маршрутизации на роутерах Keenetic и OpenWRT. Conduid read 21 tools from its source: add_domain_to_list, create_list, create_rule, delete_rule, diagnose, discard_config and 15 more. No package is published for it, so it installs from a source checkout.
The repository has 149 stars and 11 forks, and its last commit was on 22 Nov 2026. Conduid has no tagged release on record for it. Its topics include dnsmasq, entware, keen-pbr, keenetic, keenetic-pbr and keenetic-routers.
Install
git clone https://github.com/maksimkurb/keen-pbrTools (21)
add_domain_to_listAdds one or more domains to a named list in the config draft (read-modify-write). Creates an inline list when it does not exist and create_if_missing is true. Duplicates are skipped; wildcards such as *.example.com are accepted. Nothing is persisted until save_config is called, unless save=true.| Parameter | Type | Description |
|---|---|---|
| create_if_missing | boolean | Create an inline list when it does not exist |
| domains * | array | Domains to add |
| list * | string | List name (lowercase, digits, underscore; max 24 chars) |
create_listCreates a new named list in the config draft from inline domains, IP CIDRs, a local file or a URL. At least one source is required. URL lists can be populated with refresh_lists after saving. Nothing is persisted until save_config, unless save=true.| Parameter | Type | Description |
|---|---|---|
| detour | string | Outbound tag used to download a URL list |
| domains | array | Inline domains or *.wildcards |
| file | string | Path to a local list file on the router |
| ip_cidrs | array | Inline IP addresses or CIDRs |
| name * | string | New list name (lowercase, digits, underscore; max 24 chars) |
| ttl_ms | number | Per-list dynamic set TTL floor in milliseconds |
| url | string | HTTP(S) URL of a remote list |
create_ruleAppends (or prepends) a route rule to route.rules in the config draft. Typical use: route list Y via outbound Z. Rules are evaluated in order, so put catch-all default_gateway rules last. Outbound tags and list names are validated. Nothing is persisted until save_config, unless save=true.| Parameter | Type | Description |
|---|---|---|
| dest_addr | string | Destination CIDR(s), comma separated or !-negated |
| dscp | number | DSCP value to match |
| enabled | boolean | Whether the rule is active |
| lists | array | List names this rule matches; required unless another match condition is given |
| outbound * | string | Outbound tag that matched traffic is routed through |
| position | string | Insert at the start or append at the end of route.rules |
| src_addr | string | Source CIDR(s), comma separated or !-negated |
delete_ruleRemoves a route rule from the config draft by 0-based index (see list_rules). Later rule indexes shift down by one. Lists and outbounds are left untouched. Nothing is persisted until save_config, unless save=true.| Parameter | Type | Description |
|---|---|---|
| index * | number | 0-based rule index from list_rules |
diagnoseOne-call health check. Reads service health, routing health, classified issues, runtime outbounds and interfaces, then returns a compact prioritised verdict: what is failing, which outbound/interface/list is affected, warning codes with human titles, and a suggested next step. Start here when routing is broken.discard_configThrows away the staged in-memory draft and restores the last saved config (POST /api/config/discard). The saved file and running routing are not changed. Fails when there is no draft.dns_check_serversProbes every DNS server of the applied config (not the staged draft) for known domains and reports working servers, servers that do not answer, and servers whose answers look tampered with (block-page addresses, false NXDOMAIN, made-up names resolving). Use it when DNS-based lists are empty or domains resolve to wrong addresses.| Parameter | Type | Description |
|---|---|---|
| custom_domains | array | Your own domains; missing records are not warned about |
| domains | array | Domains that certainly exist; an NXDOMAIN for them is suspicious |
| servers | array | Server tags to check; default all dns.servers |
dns_testCollects events from the daemon's DNS test stream (GET /api/dns/test) for a bounded time window. Shows DNS/TLS-SNI/HTTP-Host/QUIC events and whether a domain matched a configured list, including list names, resolved IPs, set-add counts and hold time. An empty result means nothing matched in that window; test the domain from a LAN client while this runs. show=all requires API authentication.| Parameter | Type | Description |
|---|---|---|
| domain | string | Optional marker domain to observe for the default view |
| duration_ms | number | How long to listen, in milliseconds |
| max_events | number | Stop after this many events |
| show | string | keen-pbr: marker events only; all (alias full): every observed event |
get_command_failureMost recent privileged-command failures from GET /api/diagnostics/command-failure. Returns a message when the daemon has no failure log. Useful after routing checks fail or a config apply reports an error.get_configReads the editable config from GET /api/config. Without a section it returns the whole document plus is_draft. With a section it returns only that part. Edits are draft-then-save: this reflects the staged draft when one exists.| Parameter | Type | Description |
|---|---|---|
| section | string | Optional config section to return instead of the whole document |
get_healthRaw service health from GET /api/health/service: daemon version, OS, runtime state and reason, draft/rollback flags, lifecycle operation, interception and dnsmasq state. Use diagnose first for a prioritised summary.get_metricsFetches /metrics and returns a summary instead of the raw dump: family/sample counts, build info, active rules, reload errors, and non-zero error counters or down probes. Use filter to inspect families whose name contains a substring (for example 'dns_proxy_upstream' or 'list'); matching samples are capped by max_samples.| Parameter | Type | Description |
|---|---|---|
| filter | string | Case-insensitive substring of metric family names to include |
| max_samples | number | Maximum number of matching samples to return when filter is set |
get_runtime_interfacesSystem interface inventory from GET /api/runtime/interfaces: up/down state, carrier, operstate, IPv4/IPv6 addresses and Keenetic descriptions. Use it to check whether an outbound's interface exists and is up.get_runtime_outboundsLive outbound and candidate-interface state from GET /api/runtime/outbounds: which outbound is healthy, degraded or unavailable, its active/backup members, latencies and mismatch details.list_rulesCompact, indexed view of route rules, DNS rules, lists and outbound tags. Rule indexes are 0-based and are what update_rule and delete_rule expect. Use this before creating or editing a rule.refresh_listsRe-downloads one URL-backed list, or every URL-backed list when name is omitted, from the applied config (POST /api/lists/refresh). When contents change and the runtime is active it is rebuilt automatically. Fails while a config draft exists, so save or discard the draft first.| Parameter | Type | Description |
|---|---|---|
| name | string | List name; omit to refresh all URL-backed lists |
remove_domain_from_listRemoves domains from a list's inline domains in the config draft (read-modify-write). A wildcard entry *.example.com and example.com are treated as the same domain. Lists backed only by a URL or file cannot be edited this way. Nothing is persisted until save_config, unless save=true.| Parameter | Type | Description |
|---|---|---|
| domains * | array | Domains to remove |
| list * | string | List name |
rollback_configRestores the previous config inode retained by the daemon after a failed apply (POST /api/config/rollback). Only available when get_health reports rollback_available=true. The rollback itself is asynchronous.routing_testAsk the daemon where a domain or IP actually goes: POST /api/routing/test returns expected outbound (from config and cached lists), actual outbound (from live kernel sets), the matched list entry and rule index. Set include_rule_diagnostics to get the full rule-by-rule matrix.| Parameter | Type | Description |
|---|---|---|
| dest_port | number | Optional destination port |
| dscp | number | Optional DSCP value |
| include_rule_diagnostics | boolean | Include the full per-rule diagnostics matrix (larger response) |
| proto | string | Optional packet protocol used to evaluate rules |
| src_addr | string | Optional source IP address |
| src_port | number | Optional source port |
| target * | string | Domain name or IP address to test, for example youtube.com or 1.1.1.1 |
save_configPersists the staged draft to disk and applies it to the running routing runtime (POST /api/config/save). This is the only step that makes earlier list/rule edits take effect. Waits for the apply lifecycle by default and reports the final status.| Parameter | Type | Description |
|---|---|---|
| wait_seconds | number | How long to wait for the async apply to finish; 0 returns immediately |
update_ruleUpdates fields of an existing route rule in the config draft by 0-based index (see list_rules). Only supplied fields are changed; pass null for an optional match field to remove it from the rule. Outbound tags, list names and the remaining match conditions are validated. Nothing is persisted until save_config, unless save=true.| Parameter | Type | Description |
|---|---|---|
| dest_addr | string | New destination CIDR(s); null removes it |
| dscp | number | New DSCP match; null removes it |
| enabled | boolean | Enable or disable the rule; null restores the active default |
| index * | number | 0-based rule index from list_rules |
| lists | array | New list names; null removes the list condition |
| outbound | string | New outbound tag |
| src_addr | string | New source CIDR(s); null removes it |
Security checks
6 checks have not been run yet.