ask-matt
MAmattpocock/skills336k4,217 new stars in the last 7 days
Adding, removing or changing a tool on RedAmon's INBOUND MCP server, where external agents connect in with a personal access token. The wiki API reference is generated from the server's live tools/list and goes stale silently, and each tool's annotations and declared scopes are published to connected clients. Trigger: editing a registerTool call in webapp/src/lib/mcp/server.ts; editing tools.ts, writeTools.ts, scopeCopy.ts or apiReference.ts in webapp/src/lib/mcp/; changing the scope list, default scopes, expiry presets or token prefix in webapp/src/lib/mcpAuth.ts.
For a tool RedAmon's OWN agent calls (outbound, mcp/servers/), use
agentic-tool-integration. For making a recon setting writable over MCP, use
project-settings-cascade. The tools that exist are listed by the server itself and by
the generated reference page, never by this skill.
npm run docs:mcp in webapp/ after any change this skill's trigger
names, and commit MCP-API-Reference.md inside the redamon.wiki repo. A main-repo
commit moves only the submodule pointer. The page is rendered by
apiReference.ts; a hand edit is overwritten
by the next run.destructiveHint: false on a tool that overwrites or aborts existing
state. In the MCP spec false means only additive updates, and clients use it to
decide when to ask the user first. No test checks this.EXAMPLE_EXTRA_ARGS entry in
apiReference.ts when a tool's body requires
an argument its JSON Schema marks optional. The generated example sends only
schema-required arguments, and the test calls every example.ONBOARDING_PLAYBOOK entry and a capability area in
playbook.ts. The Agent Onboarding pack is
generated from the live tools/list, and a coverage test in
onboarding.test.ts fails the moment a
tool ships without whenToUse + gotchas, or sits in zero or two capability areas. Also
decide whether any profile in profiles.ts should
leansOn it; that half is editorial and is not enforced.BACKEND_FREE_TOOLS in
apiReference.test.ts. That file proves a
tool's declared scopes are enough by calling it and expecting the generic database failure,
because every Prisma model is mocked away. A tool derived purely from constants
(describe_recon_settings, list_recon_presets) SUCCEEDS instead, and would otherwise read
as a failure. Do not relax the assertion; name the tool.STALE_CLAIMS in
toolNameDrift.test.ts, and make sure
every file carrying agent-facing strings is in its AGENT_FACING list: the "nothing here
can mute" lines outlived the feature in server.ts and profiles.ts, which were outside it.TOOL_SHAPED only knows the verbs it
lists, so a new tool's verb goes there; an op literal such as list_muted or mute_many
in an agent-facing file then reads as an unknown tool. Wrap ops in
triageGraph.ts helpers instead.write and loop limits
(MCP_RATE_WRITE_PER_MIN, MCP_RATE_LOOP_PER_MIN); a new tool on a tighter bucket
(exec, query, start, compare) that overflows must raise that test's limit, not drop a call.MCP_KALI_EXEC_ENABLED also stub
AGENT_IN_THE_LOOP_ENABLED; a new switch joins both lists, or its tools vanish from
tools/list, the counts and the generated reference.EXAMPLE_EXTRA_ARGS entry. placeholderFor has no
array branch, so the generated example would name no item (mute_findings' findingIds).ScopeAccess in
scopeCopy.ts is read or write except kali:exec,
the one read-write scope. A tool that only reads what a write needs (get_finding_evidence
for submit_finding_review) belongs under the read scope, so a read-only token can see
what an agent would act on. A new scope also needs a registry permission whose mcpScopes
names it (permissions.ts): every call keeps only
the scopes the token's owner may use now (usableScopes,
scopePermissions.ts), and an unmapped scope is
never usable with the permissions switch on.assertMcpProjectAccess(ctx.token, projectId, level)
(mcpAuth.ts). Pass the whole token (a bare user id never
reaches a shared project) and the level of the permission behind the tool, as the app's route
asks it; the default 'O' keeps the tool the owner's. The returned userId is the project's
owner: the tenant of every graph, finding, mute and triage call, never ctx.token.userId
(sharedTenant.test.ts). To tell the owner from a
collaborator read mcpProjectAccess()'s access.level; an id comparison fails
authzStaticGuard.test.ts (b54b78fe). The rest is the rbac-authz skill.requireScope first, then no McpToolError before the first
backend read. The apiReference test proves declared scopes by calling each example and
expecting the mocked database failure; a refusal on the example's placeholder arguments
ahead of that read looks like a scope gap. A tool that STARTS something checks access (and
its own caps) before it spends a rate token, so a refused start costs the caller nothing.UNAUDITED_ARGS in
server.ts. auditDetail copies every other string
argument into the audit row, which also prints as a console line; a quote is target text,
and a reason is recorded, better, by the tool that owns it.Copy the shape of an existing registerTool call in
server.ts: annotations,
_meta: scopesMeta({ required, conditional }) naming exactly the scopes the tool body
enforces with requireScope, and inputSchema. A scope that applies only to a
particular argument goes under conditional, and the arguments that trigger it need a
CONDITIONAL_TRIGGERS entry in
apiReference.test.ts.
cd webapp
npm run docs:mcp # rewrites ../redamon.wiki/MCP-API-Reference.md
npx vitest run src/lib/mcp/ # scope, example-call, onboarding-coverage and stale-page checks
cd ../redamon.wiki
git add MCP-API-Reference.md
git commit -m "docs: regenerate MCP API reference"
agentic-tool-integration, project-settings-cascade, rbac-authz, redamon-testingMAmattpocock/skills336k4,217 new stars in the last 7 days
MAmattpocock/skills336k4,217 new stars in the last 7 days
MAmattpocock/skills336k4,217 new stars in the last 7 days
OBobra/superpowers331k5,030 new stars in the last 7 days
AFaffaan-m/ECC314k3,503 new stars in the last 7 days
AFaffaan-m/ECC314k3,503 new stars in the last 7 days