You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mcp: tell the model who is signed in — the asker's user and business-unit chain reach the ask route (cloud#5099) but not an MCP client #38363
area:aiAI-native — agent / tool / skill metadata, and the MCP surface an agent drivesdomain:serverDomain lane — seat card indexed by label:pm:seatpm:queueReady for the PM dispatch looppriority:p3
ObjectOS Community (self-hosted, this repository's code)
Version
19.0.0-next.2 (BrightRule app, pnpm dev)
What happened / What you expected
The MCP server knows who is signed in: every tool call is authorized as that user, and sharing narrows what they read (a BrightRule employee of the group office reads the 126 policies of their own unit chain and none of a sibling company's). But nothing tells the model who that user is:
initialize answers the generic ObjectStack instructions, with no user, organization or business-unit line;
tools/list (21 tools on this connection: list_objects, query_records, get_record, get_record_context, search_knowledge, …) has no "current user" tool, and the model does not know its own user id, so it cannot look itself up in sys_business_unit_member either.
The ask chat route gets this from the platform: the signed-in session's 提问人 block (company, unit chain) is injected into the system prompt (cloud#5099). An MCP client gets nothing, so any answer that depends on who asks (which company's standard applies, rank tiers) has the model ask "which company are you in?" even though the server already knows. In the BrightRule 制度问询 evaluation this is the main reason the MCP route cannot be compared with the ask route on 单位口径 questions.
Expected: an MCP connection can give its model the same asker facts the ask route gets, for example either
an asker paragraph in the initialize instructions (user name, organization, primary business unit and its chain up to the root), or
a read-only tool (e.g. get_current_user) answering the same facts,
limited to what the caller may read about themselves. Which shape fits the door's design (instructions are cached per connection; a tool costs tools/list weight, cf. #34689) is the maintainer's call.
Steps
Run an app with business units (BrightRule), put a user in a unit (sys_business_unit_member, is_primary).
Sign in as that user and connect to /api/v1/mcp.
initialize and tools/list: no user or unit information, and no tool that returns it.
Ask a question whose answer depends on the asker's unit: the model has to ask for the unit, while the ask route answers directly.
Triage: lands in packages/mcp (the initialize instructions, or a read-only "who am I" tool) · area:ai · domain:server · Feature · p3 · pm:queue · size M. Rationale: an MCP client's model is never told who is signed in, so it cannot answer "my unit's policies" without guessing, though every call is already authorized as that user. The ask route gets this from the platform (the cloud asker block). A new capability on the MCP surface is a Feature, and a fleet-sourced Feature is p3: it goes on triage's weekly Feature list for the maintainer to pick, and it is not dispatched before that. Not a security item: it widens what the model is told, not what the user may read.
Path: none
Source: fleet (filed by a seat account through the issue template; no maintainer words on the card).
Adopted under topic #38346 as a sub-issue, on the maintainer's words (2026-11-29, this session): 「相关任务都加入知识专题」. Labels, grade and queue state are unchanged; #38412 (declared retrieval ranking by the asker) is Blocked-by: this card, because its affinity reads the same platform-resolved identity.
Measured since this card was filed (policy Q&A evaluation on 19.0.0-next.2: 132 questions; a small model answering over MCP, a separate model grading blind; one run; the asker's facts simulated in the prompt): 86.7% → 92.4% over the whole set; 59.4% → 93.8% on the questions whose answer depends on the asker's unit; turns ending in a clarifying question 41 → 2. One run, so a direction, not an interval.
Scope notes for whoever takes it (read on main 3511432):
The initialize answer has two construction sites, packages/mcp/src/mcp-server-runtime.ts:2184 and :3066-3068 (with hostInstructions at line 1832 and openServerInstructions at line 2045). An asker paragraph is per signed-in user, so it cannot ride a per-connection cache keyed on the grant alone.
A read-only "who am I" tool is still wanted beside it as the fallback: a client that drops or truncates initialize instructions otherwise has nothing. Both answer the same facts, limited to what the caller may read about themselves: user id and name, organization, primary business unit and its chain to the root, teams, positions.
Filter placeholders: query_records already teaches {current_user_id} (packages/mcp/src/mcp-http-tools.ts:4291-4292, resolved by the engine). The same door for the caller's units and teams (for example {current_business_unit_ids}, {current_team_ids}) lets the model write "my unit's records" without first reading and copying ids. This is new filter vocabulary, so it is a separate decision from points 1 and 2 and can be split off.
None of this is specific to one app: any app with business units (a CRM's territories, a contract's signing entity, a policy's owning unit) asks the same question.
area:aiAI-native — agent / tool / skill metadata, and the MCP surface an agent drivesdomain:serverDomain lane — seat card indexed by label:pm:seatpm:queueReady for the PM dispatch looppriority:p3
Activity
objectstack-fleet commentedon Nov 28, 2026
triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t
Triage: lands in
packages/mcp(theinitializeinstructions, or a read-only "who am I" tool) · area:ai · domain:server · Feature · p3 · pm:queue · size M. Rationale: an MCP client's model is never told who is signed in, so it cannot answer "my unit's policies" without guessing, though every call is already authorized as that user. The ask route gets this from the platform (the cloud asker block). A new capability on the MCP surface is a Feature, and a fleet-sourced Feature is p3: it goes on triage's weekly Feature list for the maintainer to pick, and it is not dispatched before that. Not a security item: it widens what the model is told, not what the user may read.Path: none
Source: fleet (filed by a seat account through the issue template; no maintainer words on the card).
Recorded 2026-11-28T15:48Z.
os-project-manager commentedon Nov 29, 2026
maintainer · os-project-manager · session_01FEkQ5oW6SeQkzCccNxEc83
Adopted under topic #38346 as a sub-issue, on the maintainer's words (2026-11-29, this session): 「相关任务都加入知识专题」. Labels, grade and queue state are unchanged; #38412 (declared retrieval ranking by the asker) is
Blocked-by:this card, because itsaffinityreads the same platform-resolved identity.Measured since this card was filed (policy Q&A evaluation on 19.0.0-next.2: 132 questions; a small model answering over MCP, a separate model grading blind; one run; the asker's facts simulated in the prompt): 86.7% → 92.4% over the whole set; 59.4% → 93.8% on the questions whose answer depends on the asker's unit; turns ending in a clarifying question 41 → 2. One run, so a direction, not an interval.
Scope notes for whoever takes it (read on main 3511432):
initializeanswer has two construction sites,packages/mcp/src/mcp-server-runtime.ts:2184and:3066-3068(withhostInstructionsat line 1832 andopenServerInstructionsat line 2045). An asker paragraph is per signed-in user, so it cannot ride a per-connection cache keyed on the grant alone.initializeinstructions otherwise has nothing. Both answer the same facts, limited to what the caller may read about themselves: user id and name, organization, primary business unit and its chain to the root, teams, positions.query_recordsalready teaches{current_user_id}(packages/mcp/src/mcp-http-tools.ts:4291-4292, resolved by the engine). The same door for the caller's units and teams (for example{current_business_unit_ids},{current_team_ids}) lets the model write "my unit's records" without first reading and copying ids. This is new filter vocabulary, so it is a separate decision from points 1 and 2 and can be split off.None of this is specific to one app: any app with business units (a CRM's territories, a contract's signing entity, a policy's owning unit) asks the same question.
Generated by Claude Code