# 마이그레이션

legacy 또는 direct-client setup을 옮기면서 scope, identity, 삭제 경계를 유지합니다.

- Canonical: https://docs.xmemo.dev/ko/docs/migration
- Locale: ko-KR
- Content-Locale: ko-KR
- Canonical-Content-Digest: fb66f83d45da488fee5cccfe9563c1ab56211a358d339b0f73df16cfed352b5f
- Edition-Digest: 7464b71ec87c7d9a19e5d521f42608c1a56d61b09b1d1aca09219ae3b935b436
- Source-Revision: sha256:a9d9383136b66e379e92a66eabd971c6ca172b426fff3067024039b4e2ec6f2e

## direct-token client에서 OAuth로 이동

client가 OAuth를 지원한다면 전환으로 local configuration에 저장된 bearer token을 제거할 수 있습니다. Memory, scope와 attribution은 그대로이고 credential 경로만 이동합니다.

- XMEMO_KEY를 제거하기 전에 client가 OAuth-capable인지 확인합니다.
- 다시 연결하고 memory:read 및 memory:write를 승인합니다.
- 무해한 recall을 실행한 뒤 무엇이든 기록합니다.
- 이전 configuration 파일과 환경에서 token을 제거합니다.

## 이전: direct token 구성

```json
{
  "mcpServers": {
    "XMemo": {
      "type": "http",
      "url": "https://xmemo.dev/mcp",
      "headers": { "Authorization": "Bearer ${env:XMEMO_KEY}" }
    }
  }
}
```

## 이후: OAuth 구성

호스팅된 server URL만 남고 grant가 scope를 제공합니다.

```json
{
  "servers": {
    "XMemo": {
      "type": "http",
      "url": "https://xmemo.dev/mcp"
    }
  }
}
```

## 이동 검증

먼저 읽어서 broken credential이 저장된 memory를 바꾸지 않고 드러나게 합니다.

```ts
await client.recallContext('current task and recent decisions', {
  preferWorking: true,
});
```

