Claude/mcp codekeeper webapp ldnzsg - #3178
Conversation
מסמך תכנון לחיבור Claude.ai לקבצי המשתמש ב-CodeKeeper דרך שרת MCP מרוחק. - ממפה את הקיים: שכבת DB in-process (database/repository.py), אימות סשן (webapp/app.py:3204), וגשרי טוקנים קיימים (webapp_tokens/remember_tokens). - מציע ארכיטקטורה: שירות MCP נפרד (ASGI) שניגש ישירות ל-database, מסונן user_id. - אימות בשתי פאזות: PAT (MVP) → OAuth 2.1 מעל זהות טלגרם הקיימת. - כלים: list_files/search_code/get_file/list_versions (+ save_file בהמשך). - אבטחה: read-only כברירת מחדל, בידוד user_id מהטוקן, Smart Projection. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WNFuSyshwpRcxozVZEui5K
מימוש פאזה 0 מהתוכנית: שרת MCP מרוחק (Streamable HTTP) קריאה-בלבד שחושף את קבצי הקוד והאוספים של המשתמש ל-Claude Code/Desktop. - mcp_server/: חבילת FastMCP עם 7 כלים (list_files, search_code, get_file, list_versions, list_collections, get_collection, get_collection_items). ניגש ישירות ל-database.db + CollectionsManager, מסונן user_id, מכבד את חוק ה-Smart Projection (בלי code ברשימות/חיפוש). - אימות PAT: token_store.py מנהל טוקנים (hash בלבד) בקולקשן mcp_tokens; auth.py מאמת Bearer ומזריק user_id ל-request.state; ה-user_id נגזר תמיד מהטוקן, לעולם לא מקלט הלקוח. get_file בודק בעלות גם לפי file_id. - scripts/mcp_issue_token.py: הנפקת טוקן ל-CLI/בדיקות. - tests/test_mcp_*.py: 27 טסטים (fakes ידניים, בלי MongoDB אמיתי) — token store, בעלות/סריאליזציה, clamping, middleware, ורישום כלים. - requirements/base.txt: mcp==1.28.1 (תואם לפינים הקיימים). - מסמך התכנון עודכן לסטטוס "פאזה 0 מומשה" + README ל-mcp_server. פאזות הבאות (בתכנון): פקודת בוט /connect_claude, OAuth 2.1 ל-Claude.ai, כתיבה. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WNFuSyshwpRcxozVZEui5K
… docs תיקוני סקירה (כל ההערות היו תקפות): - backend.get_collection_items: הגנת עומק — מסנן שדות כבדים (code/content) מפריטי אוסף לפני החזרה, כדי שלא ידלפו גם אם CollectionsManager ישתנה. - mcp_server/wiring.py: חילוץ resolve_mongo המשותף; הוסרו ההעתקים מ-app.py ומ-scripts/mcp_issue_token.py. - auth.py: לוג לחריגה שנבלעה ב-verify (בלי הטוקן) לצורך אבחון בפרודקשן. - Markdown: שפת code fence (text) לדיאגרמות ולבלוק ההרצה, ושורות ריקות לפני טבלאות (MD040/MD058) ב-README ובמסמך התכנון. - טסט חדש: מוודא שפריטי אוסף מסוננים משדות כבדים. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WNFuSyshwpRcxozVZEui5K
מוסיף פקודת בוט /connect_claude שמנפיקה למשתמש טוקן MCP אישי מתוך טלגרם (במקום להריץ סקריפט CLI), ומחזירה פקודת חיבור מוכנה ל-Claude Code. - main.py: connect_claude_command (מודול-לבל), רישום ב-setup_handlers, וכניסה ב-HELP_SECTIONS. אבטחה: מונפק בצ'אט פרטי בלבד (שלא ידלוף בקבוצה); fallback לטקסט אם פרסום HTML נכשל (לא לאבד את הטוקן). - files_facade.issue_mcp_token: עוטף את MCPTokenStore (import עצל) כדי לשמור את החיווט במקום אחד ולא לגעת ב-PyMongo גולמי מה-handler. - README + מסמך התכנון עודכנו: /connect_claude זמין, + ENV MCP_SERVER_URL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WNFuSyshwpRcxozVZEui5K
…ecrets מבהיר בדיוק אילו ENV שירות ה-MCP צריך: MONGODB_URL+DATABASE_NAME זהים לבוט/וובאפ (אותו DB, אחרת הטוקן מ-/connect_claude לא יימצא), BOT_TOKEN רק כדי שה-config המשותף ייטען, ולא צריך את סודות הוובאפ. MCP_SERVER_URL מוגדר על שירות הבוט. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WNFuSyshwpRcxozVZEui5K
לפי תבנית ה-PR: תיעוד משתני הסביבה החדשים ששירות ה-MCP/הבוט משתמשים בהם. - docs/environment-variables.rst: שתי שורות בטבלת התפעול (URL ציבורי + שם תצוגה). - services/config_inspector_service.py: ConfigDefinition לשניהם תחת category="mcp", כדי שיופיעו ב-Config Inspector. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WNFuSyshwpRcxozVZEui5K
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 42 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧯 Dangerous deletes guard reportPolicy: see .cursorrules — dangerous deletions are blocked unless wrapped safely. Summary:
Flagged findings (file:line:snippet): Excluded matches (by path pattern) |
⏱️ Performance report(No performance test durations collected. Mark tests with |
📖 Documentation PreviewThe documentation has been built successfully!
To view locally:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Render defaulted the new native Python MCP service to 3.14, where greenlet (pulled in by gevent) fails to compile — its C++ uses CPython frame internals that changed in 3.14. The project targets 3.11 (Dockerfile python:3.11-slim; CI runs 3.11/3.12), so pin the native runtime to a supported version. - .python-version = 3.11 -> Render uses the latest 3.11 patch. - No effect on CI (explicit python-version in workflows) or Docker services; services that set PYTHON_VERSION explicitly still win over this file. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WNFuSyshwpRcxozVZEui5K
מתקן כפילות שנוצרה במיזוג/squash: שורת פתיחה ישנה + פסקת ENV כפולה בסעיף הפריסה. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WNFuSyshwpRcxozVZEui5K
תבנית Pull Request
✨ תיאור קצר
📦 שינויים עיקריים
פירוט נקודות (רשימת תבליטים):
🧪 בדיקות
🧪 בדיקות נדרשות ב‑PR
📝 סוג שינוי
דוגמאות Conventional Commits
✅ צ'קליסט
services/register_jobs.py(כולל Callback/Trigger להפעלה ידנית — למשלcallback_name/trigger_funcלפי המבנה) כדי שיופיעו בדשבורדdocs/environment-variables.rstוגםservices/config_inspector_service.pydocs/webapp/theming_and_css.rst+FEATURE_SUGGESTIONS/theme_matrix.md🧩 השפעות/סיכונים
🔗 קישורים
🧯 סיכון / החזרה לאחור (Rollback)