feat(mcp): stage 3 context and bounded selector candidates - #337
Draft
hmishra2250 wants to merge 7 commits into
Draft
feat(mcp): stage 3 context and bounded selector candidates#337hmishra2250 wants to merge 7 commits into
hmishra2250 wants to merge 7 commits into
Conversation
hmishra2250
force-pushed
the
feat/stage3-context-selectors
branch
2 times, most recently
from
July 26, 2026 22:36
5eddb99 to
9a53c34
Compare
hmishra2250
force-pushed
the
feat/stage3-context-selectors
branch
from
July 27, 2026 01:37
9a53c34 to
83cd47b
Compare
hmishra2250
force-pushed
the
feat/stage3-context-selectors
branch
from
July 27, 2026 01:38
83cd47b to
bc9becf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
One ordered Stage-3 candidate train on top of
c524c5a:8dd2ec0): audited copy-only reductions from Enhance tool descriptions and validations #330 plus the Stage-1 keyless Search/Scrape/Parse wording correction. No schemas, validation, routing, or tool registration changed. Its initialize text is selector-safe: it never names a tool outside@core-v1.bef51ef): adds the inert-for-other-clientsanthropic/alwaysLoadmetadata only to Search/Scrape/Parse on the hosted primary full profile. Account, search (including the in-process companion), and stdio profiles remain unchanged; B is independently merge-safe.bc9becf): enables?tools=only for hosted/v2/mcp; validates single, bounded selectors; supports immutable@core-v1/@full-v1; intersects with actual registrations; prevents keyless escalation; and rejects direct calls to omitted tools.Selectors are deliberately request-scoped because the current hosted FastMCP transport is stateless. A request without
?tools=is an ordinary default session; clients that select must retain the configured URL on each request./v2/mcp-oauthand/v2/mcp-searchnow reject any selector explicitly with HTTP 400 /TOOL_SELECTOR_UNSUPPORTED; they never silently ignore it. Search remains six-tool frozen without a selector.Corrections folded before review
@core-v1initialize instructions no longer name tools it omits.CREDENTIAL_INVALID) takes precedence over selector rejection.[MCP_SELECTOR]): outcome, reason, auth mode, selected-tool count, and fixed resource only — never selector text, URLs, credentials, IPs, or identifiers.@core-v1values below the independent 1024-byte cap.alwaysLoadwrappers from search registration paths.Contract coverage
@core-v1is exactly Search/Scrape/Parse;@full-v1equals the full default tool definitions.@core-v1contains no unavailable feedback/crawl/extract tool names.TOOL_NOT_SELECTED) cause no backend scrape, upload, or parse call.CREDENTIAL_INVALIDeven when a selector would omit the requested tool.@full-v1escalation -> 403.TOOL_SELECTOR_UNSUPPORTED.Validation
pnpm install --frozen-lockfilepnpm lintpnpm test— 49/49 passedpnpm pack --pack-destination /tmp/mcp337-pack-rebaseddocker build -f Dockerfile.service -t firecrawl-mcp-server:stage3-selector-review-83cd47b .Package-manager note
Use pnpm for local validation.
patches/fastmcp@4.3.2.patchis referenced bypnpm-lock.yaml; annpm installdoes not apply it and produces false tool-list failures. The production service Dockerfile and the validation above use pnpm.AX gate — not run
No paid AX traces were run. A durable local A+C candidate exists for the factorial:
8dd2ec0bef51efbc9becfexperiment/stage3-context-selectors-a-c, commit97dc37f, tagax-candidate-a-c-20260727, local imagefirecrawl-mcp-server:ax-a-c-97dc37f(sha256:b10eb456cd34dbe35180909bcca6b04be74d7679916e1a44e707d977f54b760c)AX remains blocked until those exact immutable candidates are reachable from the approved E2B sandbox. Do not treat production-baseline traces as candidate results. The protocol must use a scorer-emitted metric verified on current AX main, a powered no-drop decision rule, and a positive control before B/C merge eligibility.
Required gates before merge
@core-v1instructions arm.