Skip to content

Add opt-in tool allowlists for local-model clients - #32

Draft
dylanoliverdo-coder wants to merge 1 commit into
Praket7:mainfrom
dylanoliverdo-coder:feat/local-model-tool-allowlist
Draft

dylanoliverdo-coder wants to merge 1 commit into
Praket7:mainfrom
dylanoliverdo-coder:feat/local-model-tool-allowlist

Conversation

@dylanoliverdo-coder

Copy link
Copy Markdown

Clients currently receive the full registered tool catalog even when a task needs only a few tools. This adds an optional MASTERCAM_MCP_TOOLS comma-separated allowlist, passed through both stdio and HTTP server creation. Help and capability discovery describe the same selected catalog, and omitted tools have no registered call handler.

The approach comes from the explicit allowlists and bounded MCP discovery used in my Journeyman local assistant, where the shop-side model runs on an 8 GB GPU. This is a new TypeScript implementation of the allowlist portion; it contains no Journeyman source, customer data, SDK files, or credentials.

The setting only narrows the existing backend surface. It cannot enable a hidden native mapping or override profile, read-only, or approval policy. Unset preserves existing behavior; explicitly empty registers zero tools; unknown or unregistered names reject server creation. Existing resources and internal tool dependencies retain their current behavior.

Validation

  • 158 tests pass, including real MCP stdio and HTTP checks for selected discovery, rejected omitted calls, and read-only enforcement.
  • Lint, TypeScript checks, and build pass.
  • node work/local-model-catalog.mjs measures the synthetic fixture's serialized tool arrays: full catalog 59 tools / 87,555 bytes; documented example 4 tools / 7,339 bytes.
  • The patch applies cleanly to main at b41ab3f9db37544b9941ec3c8b88b3b2a54d5a9c.

This is a schema-payload measurement. Local-model inference accuracy, latency, GPU memory use, and licensed live Mastercam behavior remain untested by this PR. The local-model guide records how to evaluate those separately.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant