Connect VS Code and GitHub Copilot through the hosted OAuth configuration when the host supports it.
Prerequisite
Use VS Code with GitHub Copilot Chat and MCP support. This route is the editor OAuth path; Copilot CLI is a separate direct-token route below.
- Auth mode: OAuth.
- Config file: %APPDATA%\Code\User\mcp.json.
- Uses the servers key rather than mcpServers.
- Endpoint: https://xmemo.dev/mcp.
Install / setup
Edit %APPDATA%\Code\User\mcp.json under the servers key and add the hosted XMemo URL. Do not use the Copilot CLI config here; its direct path has its own route.
- Keep the editor entry URL-only.
- The first tool call opens browser OAuth.
- Do not add an Authorization header to this VS Code entry.
Set the credential
No key — complete browser OAuth in VS Code / GitHub Copilot Chat. Do not set XMEMO_KEY or paste a bearer token into mcp.json.
No XMEMO_KEY
Complete browser OAuth in VS Code / GitHub Copilot Chat
Generate / confirm XMEMO_AGENT_INSTANCE_ID
The reviewed VS Code OAuth listing has no client-side identity header. Do not add XMEMO_AGENT_INSTANCE_ID to mcp.json; confirm that this OAuth path uses its grant-managed attribution.
Preserve the existing config block
Use the existing VS Code / GitHub Copilot XMemo configuration block rendered on this page. Preserve the servers key and URL-only OAuth shape; do not copy the Copilot CLI bearer configuration into it.
Restart the client
Reload the VS Code window or restart the MCP connection after saving mcp.json so Copilot reads the current server definition.
Test with a real recall call
Make the first MCP call read-only. This is an actual recall invocation, not a health-check placeholder, and it does not write memory.
recall({ query: "connection check", limit: 1 })
Expected response (literal shape)
A successful call returns the public ranked text shape below; the reference and content are real values from the authorized memory space.
### XMemo Memory Results:
1. Reference: <opaque-memory-id> | Location: <location>
> <memory content>
Common Errors
VS Code / GitHub Copilot Chat uses the browser OAuth path and should not be debugged with Copilot CLI token settings.
- invalid_grant — the OAuth authorization code is invalid, expired, or already used: reconnect the VS Code MCP server and authorize again.
- invalid_target — the OAuth resource does not match this MCP server: reconnect using https://xmemo.dev/mcp.
- 403 insufficient_scope — the grant does not include memory:read: approve the required scope and reconnect.
Copilot CLI is a separate, direct path
Use /docs/mcp/copilot-cli for the bearer-token Copilot CLI flow. The editor OAuth flow documented here and the CLI direct flow do not share a credential session.