Skip to content

mcp: the host cannot pass server instructions per request, so the authoring door answers initialize with the default sentence — add instructions to McpAuthoringInjection #31022

Closed

Description

@objectstack-fleet

repo:cloud#3 · hotlong · session_01Q4EjjRhUZjdy8VXs6Kkur2

Filing gate: (b) a contract gap with a named consumer, measured by the objectstack-ai/cloud#3658 dev (PR objectstack-ai/cloud#3684). Platform gaps go to the platform: 「平台的问题应该在平台处理」 (objectstack#30765).

维护者速读

MCP 客户端连上来时,服务器会先发一段「说明」,Claude 等客户端会把它放进上下文。现在这段说明只有一句默认话,平台没法按入口给不同的说明,所以 cloud 的搭建入口没法告诉客户端「规则在哪、有哪些」。cloud 已经先用「不带参数调用 get_authoring_rules」把规则交给客户端,这张卡让平台支持按请求传说明,cloud 随后接上:传一个指引加规则索引,约 9 KB。

Measured (objectstack pin c50e0dfa and main 1aeeafd9d3)

  • MCPServerRuntime.handleHttpRequest builds the per-request server with this.config.instructions, falling back to the default (packages/mcp/src/mcp-server-runtime.ts:1937-1939).
  • McpAuthoringInjection carries only registry, principal and environmentId (packages/mcp/src/types.ts:100-115), and handleHttpRequest's opts have no instructions.
  • MCPServerPluginOptions.instructions is server-wide, set once at init (plugin.ts:317, :379), so it would also reach data:read tokens that get no build tools.
  • Cloud constructs new MCPServerPlugin() with no options (objectos-runtime/src/artifact-kernel-factory.ts:1317).

Expected

  • An optional instructions on McpAuthoringInjection (or on handleHttpRequest opts), used in the initialize answer when the authoring family is registered for that request; otherwise the default.

Acceptance

  • Tests: a request with an authoring injection carrying instructions gets them at initialize; a data:read request gets the default.

Consumer: objectstack-ai/cloud#3658 (follow-up wiring after the pin moves).

Suggested-grade: p2.

Dedupe (2026-11-06): MCP instructions per request, McpAuthoringInjection instructions → none.

Activity

  1. added
    enhancementNew feature or request
    pm:queueReady for the PM dispatch loop
    repo:cloudCard routed whole to the cloud PM: needs cloud code, a producer or a fact (cloud owns it to closure)
    domain:serverDomain lane — seat card indexed by label:pm:seat
    on Nov 6, 2026
  2. objectstack-fleet commented on Nov 6, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: audit · p2 kept · domain:server · 2026-11-06T18:57Z

    ⛔ Not a claim.

    • The MCP host cannot pass server instructions per request. McpAuthoringInjection carries no instructions, so the authoring door answers initialize with the default sentence. Measured by the cloud#3658 dev.
    • p2, domain:server, pm:queue kept: an optional field on a host injection type, with no spec key and no new tool. The instructions reach only requests where the authoring family is registered, never a data:read token.

    Generated by Claude Code

  3. added
    pm:dispatchedDispatched to a dev agent by /pm-dispatch
    and removed
    pm:queueReady for the PM dispatch loop
    on Nov 7, 2026
  4. objectstack-fleet commented on Nov 7, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#4 · marchtian · session_017ihL2dLQEXWGsE2SZ3Qn5F

    Claim: PM loop round 1
    Session: session_017ihL2dLQEXWGsE2SZ3Qn5F
    Account: marchtian
    Branch: claude/issue-31022-mcp-per-request-instructions
    Worktree: objectstack-issue-31022
    Domain: domain:server
    Seat: domain:server#4
    File surface: packages/mcp/src/** (types.ts, mcp-server-runtime.ts, tests), the runtime/host call site only if the injection is built there, .changeset/ (stop on breach; explain in the report)
    Container & model: M, mode:subagent (in-seat background subagent, the project's standing dev form), model: default (dispatch-gates --tier: no path-derived mandate; PM judgment, default tier), effort: high
    Clause-②: yes
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Thread-read: 6692920691
    Premise: holds
    Serial constraints cleared: last same-package landing e1dac19 (#31042) is merged; no open pm:dispatched claim on packages/mcp

  5. objectstack-fleet commented on Nov 7, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#4 · marchtian · session_017ihL2dLQEXWGsE2SZ3Qn5F
    os-dev-report

    {
      "pr": "https://github.com/objectstack-ai/objectstack/pull/31141 (draft, head e5540c8fdccbf43495ef331b840ee8b8d8adc027, assignee marchtian, no reviewers)",
      "premise_still_valid": true,
      "files_changed": [
        ".changeset/mcp-per-request-authoring-instructions.md",
        "packages/mcp/src/types.ts",
        "packages/mcp/src/mcp-server-runtime.ts",
        "packages/mcp/src/mcp-server-runtime.authoring-scope.test.ts"
      ],
      "line_budget": "153 changed lines (+152 / -1, 4 files) vs the 3000 human-merge threshold: under; all inside the claim's file surface",
      "gates": {
        "head": "e5540c8f",
        "merge_origin_main": "git merge origin/main :: exit 0 (Already up to date; origin/main == 5f003744 == branch point, read by ls-remote)",
        "local": [
          "pnpm --filter '@objectstack/mcp^...' build :: exit 0 (lock VERDICT command-exit 0)",
          "pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2 src/mcp-server-runtime.authoring-scope.test.ts :: exit 0 (Tests 24 passed (24))",
          "pnpm --filter @objectstack/mcp test :: exit 0 (Test Files 60 passed (60), Tests 767 passed (767))",
          "pnpm --filter @objectstack/mcp typecheck :: exit 0",
          "eslint packages/mcp --no-inline-config (repo pnpm lint scoped to the touched package) :: exit 0",
          "pnpm build --concurrency=2 :: exit 0 (to clear the missing-dist exit 3s)"
        ],
        "derived": "dispatch-gates --commands: 60 derived; 56 exit 0 first pass; 4 exit 3 then re-run exit 0: check:dual-build-cjs-loads and check:lean-entry-closure (missing dist, after full build), check:type-check-debt (lock queue-timeout, re-run under lock), check-plugin-teardown-shape --self-test (pinned fixture commit absent from the shallow clone, re-run once the object was present)",
        "ran_reconciliation": "dispatch-gates --ran :: exit 0 - 60 derived famil(ies) accounted for, 60 run, 0 NOT-MEASURED (a DERIVED zero, all 60 carry an exit code)",
        "ablation": "grant gate in authoringInstructions removed via scripts/ablation-replace.mjs (anchor 1->0, blob f68539a8ec22 -> 83181ec01751): 3 failed / 21 passed (24); restored blob == HEAD, git diff HEAD empty",
        "ci": "in_progress - PR check-runs not yet concluded at report time"
      },
      "deviations": [
        "the mcp package has no lint script, so the repo lint command (eslint --no-inline-config) ran scoped to packages/mcp",
        "Clause-② copied from the claim as a bare yes, with no (widening) arm; the change is additive",
        "test:repo not run locally (diff touches no repo-project test); left to CI Test Core"
      ],
      "open_questions": [],
      "out_of_scope_findings": [],
      "mcp_calls": "0",
      "api_writes": "2 relay-mediated plus 1 comment: fleet-write dispatch fw-20261107T141258Z-b3692e (POST /repos/objectstack-ai/objectstack/pulls draft -> #31141, POST /repos/objectstack-ai/objectstack/issues/31141/assignees); POST /repos/objectstack-ai/objectstack/issues/31022/comments (this report, via post-stamped.mjs)",
      "security_findings": "none"
    }
  6. objectstack-fleet commented on Nov 7, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#4 · marchtian · session_017ihL2dLQEXWGsE2SZ3Qn5F

    Landed · PR #31141 merged by the merge queue as 56baf78e0c422b6555238043cc7d4c1a22db3568 (second queue entry, after one inherited-row ejection from the #31120 stack; audit 6708650017).

    Reading Value
    PR state merged, merged_at from the pulls API
    Card state closed completed by Fixes #31022

    pm:dispatched removed with this record.

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

Metadata

Metadata

Assignees

Labels

domain:serverDomain lane — seat card indexed by label:pm:seatenhancementNew feature or requestpriority:p2Medium: important, M3repo:cloudCard routed whole to the cloud PM: needs cloud code, a producer or a fact (cloud owns it to closure)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions