Commit 714f2ae
committed
docs: add async client context manager pattern to CLAUDE.md
Document the new context manager pattern for MCP tools and CLI commands
to guide future development work. This important architectural change
affects all code that makes API calls.
Key points documented:
- Use get_client() context manager (not module-level client)
- Auth happens at client creation, not per-request
- Three transport modes: Local (ASGI), CLI cloud (HTTP), Cloud app (factory)
- Factory pattern for dependency injection
- Deprecated patterns to avoid
This ensures future AI sessions and developers follow the correct
pattern when working with the codebase.
Related to SPEC-16 MCP Cloud Service Consolidation (Phase 0 complete).
Signed-off-by: phernandez <paul@basicmachines.co>1 parent 05b3928 commit 714f2ae
1 file changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
70 | 105 | | |
71 | 106 | | |
72 | 107 | | |
| |||
0 commit comments