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
Expose the session id to MCP servers in _meta of tools/call #5652
Hooks receive sessionId on stdin, but an MCP server has no per-request way to know which Copilot CLI session is calling it.
Today (1.0.119) the only source is the environment variable COPILOT_AGENT_SESSION_ID of the stdio server process. It works because Copilot restarts stdio servers on /new, but it ties identity to the process: it cannot work for HTTP/SSE servers, and it would break if a server process were ever shared or kept across sessions (e.g. /resume).
_meta of tools/call already carries com.github.copilot/toolCallId and com.github.copilot/turnId. Could it also carry com.github.copilot/sessionId, equal to the sessionId hooks receive?
Use case: an MCP server that keeps per-session state (e.g. message delivery between agent sessions) and must match a tool call to the session its hooks report. Other clients already do this (Antigravity CLI sends antigravity.google/root_conversation_id in _meta).
Activity