Skip to content

Config typos are handled inconsistently: a misspelled --exclude-tools or --features entry is silently ignored #3761

Open

Description

@rafe-walker

Describe the bug

A misspelled name gets one of three different outcomes, depending on which option it is in:

input result
--tools=not_a_tool startup fails: unknown tools specified in WithTools: not_a_tool
--toolsets=not_a_toolset (or Repos, case-sensitive) WARN unrecognized toolsets ignored, then the server runs with 0 tools
--exclude-tools=delete_fil no log line; delete_file stays enabled (46 tools)
--features=not_a_feature no log line

A misspelled --exclude-tools entry gives no signal, so the tool stays enabled. An operator who misspells a tool they meant to disable is not told, and the model can still call it.

Ignoring unknown toolsets is deliberate (PR #1202, docs PR #1398), and so is erroring on unknown tools (PR #1776). Open PR #2184 adds an opt-in strict mode for toolsets. This issue is about the two options that give no signal at all. ResolveFeatureFlags documents this as intentional for request input; the ask here is only a startup log line for the --features CLI flag.

Code (main 99d6d65, unchanged since v2.1.0):

  • pkg/inventory/builder.go:154-175: WithExcludeTools / CreateExcludeToolsFilter never check names against the inventory. Compare :247-249 for WithTools.
  • pkg/github/feature_flags.go:105-125: ResolveFeatureFlags drops names outside AllowedFeatureFlags without logging.
  • pkg/github/server.go:114: the toolset warning.

Affected version

v2.1.0 (image sha256:f6056fc1…0f8a, commit 4bcdcdf) and main nightly (image sha256:48bc16d0…338f, revision 99d6d65). stdio.

Steps to reproduce the behavior

Each step is docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN <image> stdio <flags>, then initialize + tools/list (a dummy token is enough, since no API call is needed):

  1. no flags: 46 tools, including delete_file
  2. --exclude-tools=delete_file: 45, no delete_file
  3. --exclude-tools=delete_fil: 46, delete_file present, and stderr has no warning about the unknown name (only the token-scope WARN from the dummy token)
  4. --features=not_a_feature: 46, and stderr has no warning about the unknown name (only the token-scope WARN from the dummy token)
  5. --toolsets=not_a_toolset: 0 tools, and stderr has level=WARN msg="Warning: unrecognized toolsets ignored" toolsets=not_a_toolset
  6. --tools=not_a_tool: the process exits with failed to create MCP server: failed to build inventory: unknown tools specified in WithTools: not_a_tool

Expected vs actual behavior

Expected: unknown names in --exclude-tools and --features are at least logged, as unknown toolsets are. For --exclude-tools, an error would match --tools, since a typo there leaves enabled a tool the operator meant to disable.

Actual: silent.

Suggested fix: in WithExcludeTools, collect names not present in the inventory (including deprecated aliases) and warn or error. In ResolveFeatureFlags (CLI path), warn on names outside AllowedFeatureFlags.

Logs

--exclude-tools=delete_fil  -> 46 tools, delete_file listed; stderr: only the token-scope WARN
--features=not_a_feature    -> 46 tools; stderr: only the token-scope WARN
--toolsets=not_a_toolset    -> 0 tools; WARN "Warning: unrecognized toolsets ignored" toolsets=not_a_toolset
--tools=not_a_tool          -> exit; "unknown tools specified in WithTools: not_a_tool"

Same on v2.1.0 and main.

Found during an independent audit of v2.1.0 on a throwaway org and private test repo. Prepared with AI assistance (Claude Code); reproduced by two independent test runs before filing.

Activity

  1. SalyyS1 commented on Nov 11, 2026

    @SalyyS1

    This is a nasty footgun when hardening an agent setup: if an operator passes --exclude-tools=delete_fil expecting destructive file deletion to be blocked, having the typo silently ignored leaves delete_file exposed in tools/list and callable on tools/call.

    Until github-mcp-server adds unknown-tool validation on --exclude-tools to match --tools (#1776), anyone running github-mcp-server over stdio can enforce strict allowlist/denylist globs at the JSON-RPC boundary and verify the resulting exposed tool catalog offline using mcp-slim:

    # 1. Inspect the exact tools/list catalog exposed after filtering (no LLM session required):
    mcp-slim inspect -- github-mcp-server stdio --exclude-tools=delete_file
    
    # 2. Or enforce wildcard allow/deny filters at the stdio proxy boundary:
    mcp-slim run --deny-tools "delete_*,merge_*,create_*" -- github-mcp-server stdio

    Because mcp-slim intercepts both tools/list and tools/call, any denied tool is stripped from the advertised schema catalog and rejected if the model attempts to invoke it directly.

  2. rafe-walker commented on Nov 12, 2026

    @rafe-walker
    Author

    I read #3771 against the steps above. This is from reading the change, not a test run.

    • Step 3 (--exclude-tools=delete_fil): startup now logs Warning: unrecognized excluded tools ignored; these tools are not disabled tools=delete_fil, on both stdio and http. The names are checked against the full tool set, so a filtered inventory doesn't produce false warnings.
    • Step 4 (--features=not_a_feature): startup now logs Warning: unrecognized features ignored. Request headers in HTTP mode stay silent, which matches the intent of ResolveFeatureFlags.
    • The PR also warns when a deprecated alias is passed to --exclude-tools, which is a good catch: the exclude filter compares exact names, so excluding an alias disables nothing today.
    • delete_file still stays enabled after a typo; the operator is now told. Whether a misspelled --exclude-tools entry should be a startup error, as with --tools, is the open question from the issue. That could be a follow-up if you want it.

    Happy to re-run the original reproduction once a maintainer is happy with the approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions