Skip to content

chore: הוספת שרת MCP של ContextStream ל-.mcp.json - #3208

Merged
amirbiron merged 1 commit into
mainfrom
claude/contextstream-mcp
Aug 6, 2026
Merged

amirbiron merged 1 commit into
mainfrom
claude/contextstream-mcp

Conversation

@amirbiron

@amirbiron amirbiron commented Aug 6, 2026 •

Copy link
Copy Markdown
Owner

✨ תיאור קצר

מוסיף את ContextStream כשרת MCP שני ב‑.mcp.json, לצד Render. שרת HTTP, כלומר אין מה להתקין ואין מה לאנדקס בכל סשן — זה URL ומפתח. המפתח מוזרק כמשתנה סביבה ולא נכתב לקובץ.

📦 שינויים עיקריים

  • DevOps/CI/CD

פירוט:

  • .mcp.json: ערך contextstream מסוג http, מול https://mcp.contextstream.io/mcp?default_context_mode=fast
  • הכותרת X-ContextStream-API-Key מקבלת ${CONTEXTSTREAM_API_KEY} — הרחבת משתנה, לא ערך
  • אין שינוי בערך render הקיים

🧪 בדיקות

  • Manual

מה נבדק:

  • הקובץ נטען כ‑JSON תקין אחרי המיזוג, ושני השרתים קיימים בו
  • type, url ושם הכותרת אומתו מול מה שהספק מפרסם
  • סריקת טקסט על הקובץ עצמo מול מחרוזות באורך של מפתח — אין ערך סודי, ואין YOUR_API_KEY שנשאר מהתבנית
  • git check-ignore מאשר שהקובץ אכן מגיע לריפו ולא מסונן, כלומר ההגנה היחידה על המפתח היא שהוא לא שם

📝 סוג שינוי

  • chore/ci: תשתית/CI

✅ צ'קליסט

  • אין סודות/מפתחות בקוד
  • אין מחיקות מסוכנות
  • הודעת הקומיט תואמת Conventional Commits
  • docs/environment-variables.rst ו‑services/config_inspector_service.py — לא עודכנו, במכוון

לגבי הסעיף האחרון: RENDER_API_KEY, שכבר יושב באותו קובץ באותה תבנית, לא מופיע באף אחד משני המקומות האלה. התיעוד הזה מתאר משתני ריצה של CodeBot עצמו, ו‑CONTEXTSTREAM_API_KEY נצרך על ידי לקוח ה‑MCP ולא על ידי האפליקציה — היא לעולם לא קוראת אותו.

שווה לשים לב לבלבול: המילה MCP ב‑docs/environment-variables.rst מתייחסת לשירות ה‑MCP ש‑CodeBot מספק, לא ללקוח שצורך שרתים חיצוניים. שתי משמעויות שונות לאותו שם, ולכן מי שיקרא את הצ'קליסט בעתיד עלול "לתקן" את זה בטעות.

🧩 השפעות/סיכונים

אין השפעה על פרודקשן — הקובץ נקרא רק על ידי Claude Code בסביבת פיתוח, ולא נטען בזמן ריצה.

הסיכון היחיד הוא תפעולי: המלצת הספק היא להדביק את המפתח לקובץ ולשמור אותו מחוץ לגיט. בסביבת ענן זה בדיוק הפוך — ~/.claude/mcp.json לא שורד קונטיינר חדש, ו‑.mcp.json שבריפו הוא זה שנטען. ללכת לפי ההוראות כלשונן פירושו לקומיט מפתח חי.

🧯 סיכון / החזרה לאחור

מחיקת ערך contextstream מהקובץ. אין מיגרציה, אין מצב שמור, ואין תלות של קוד בשינוי.

🔗 קישורים

מה שנדרש ממך לפני שזה יעבוד: להגדיר את CONTEXTSTREAM_API_KEY בהגדרות הסביבה. שים לב למצב הכשל — משתנה שלא הוגדר לא מונע טעינה: Claude Code מזהיר ב‑claude mcp list ומעביר את הטקסט ${CONTEXTSTREAM_API_KEY} כמו שהוא ככותרת, כך שמשתנה שנשכח נראה כמו מפתח שגוי ולא כמו מפתח חסר.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DDLdj814WHKMXD4sbS2rDr


Generated by Claude Code

Summary by Sourcery

Add ContextStream as an additional MCP HTTP server configuration alongside Render in .mcp.json, using an environment-injected API key and avoiding any impact on runtime behavior.

Enhancements:

  • Configure a new ContextStream MCP HTTP server entry in .mcp.json with URL-based access.
  • Inject the ContextStream API key via environment variable expansion instead of committing secrets to the repository.
  • Preserve the existing Render MCP server configuration unchanged.

Build:

  • Adjust MCP client configuration used by development tooling without affecting production deployment.

ContextStream is an HTTP MCP, so unlike a stdio server there is nothing
to install and nothing to index per session. That matters here: every
cloud session starts from a fresh container, and a server that needs a
toolchain installed pays that cost on every single one. This one is a
URL and a key.

The vendor's own setup snippet inlines the API key and then says to keep
the file out of version control. That advice does not survive contact
with this setup: in a cloud session it is precisely the repo's .mcp.json
that gets loaded, since ~/.claude/mcp.json does not outlive the
container. Following the instructions literally would mean committing a
live key to GitHub.

So the key is referenced, not written. Claude Code expands ${VAR} inside
both url and headers for http-type entries, which is the pattern the
render entry already uses in this same file — this is the second server
to follow it, not a new convention.

Worth knowing about the failure mode: an unset variable does not stop
the config from loading. Claude Code warns in `claude mcp list` and
passes the literal ${CONTEXTSTREAM_API_KEY} through as the header value,
so a forgotten variable surfaces as an auth rejection that reads like a
bad key rather than a missing one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDLdj814WHKMXD4sbS2rDr
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sourcery-ai

sourcery-ai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

.mcp.json is updated to add a second MCP server configuration for ContextStream as an HTTP-based MCP endpoint, using an environment-injected API key header, while leaving the existing Render configuration unchanged.

File-Level Changes

Change Details Files
Add ContextStream as a second MCP HTTP server configuration using an env-var-based API key header.
  • Introduce a new MCP server entry named contextstream with type set to http and URL https://mcp.contextstream.io/mcp?default_context_mode=fast.
  • Configure the X-ContextStream-API-Key header to expand the CONTEXTSTREAM_API_KEY environment variable instead of hardcoding a key.
  • Ensure the existing render MCP server configuration remains unchanged in .mcp.json.
.mcp.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🧯 Dangerous deletes guard report

Policy: see .cursorrules — dangerous deletions are blocked unless wrapped safely.

Summary:

  • Flagged findings (blocking): 0
    0
  • Excluded matches (not blocking): 15
  • Total matches (all files): 129

Flagged findings (file:line:snippet):
(none)

Excluded matches (by path pattern)
./node_modules/mermaid/dist/mermaid.js.map:4:  "sourcesContent": ["/**\n* Default values for dimensions\n*/\nconst defaultIconDimensions = Object.freeze({\n\tleft: 0,\n\ttop: 0,\n\twidth: 16,\n\theight: 16\n});\n/**\n* Default values for tr … [truncated]
./node_modules/mermaid/dist/mermaid.min.js.map:4:  "sourcesContent": ["/**\n* Default values for dimensions\n*/\nconst defaultIconDimensions = Object.freeze({\n\tleft: 0,\n\ttop: 0,\n\twidth: 16,\n\theight: 16\n});\n/**\n* Default values fo … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.core/chunk-KS23V3DP.mjs.map:4:  "sourcesContent": ["{\n  \"name\": \"mermaid\",\n  \"version\": \"11.12.0\",\n  \"description\": \"Markdown-ish syntax for generating flowcharts, mindmaps, sequence  … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.esm/chunk-2M32CCKP.mjs.map:4:  "sourcesContent": ["{\n  \"name\": \"mermaid\",\n  \"version\": \"11.12.0\",\n  \"description\": \"Markdown-ish syntax for generating flowcharts, mindmaps, sequence d … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.esm.min/chunk-4HFYJGYH.mjs.map:4:  "sourcesContent": ["{\n  \"name\": \"mermaid\",\n  \"version\": \"11.12.0\",\n  \"description\": \"Markdown-ish syntax for generating flowcharts, mindmaps, sequen … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.esm.min/chunk-4HFYJGYH.mjs:1:var r={name:"mermaid",version:"11.12.0",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graph … [truncated]
./node_modules/mermaid/dist/mermaid.min.js:1524:`,"getStyles"),c1e=RQe});var h1e={};dr(h1e,{diagram:()=>NQe});var NQe,f1e=N(()=>{"use strict";$ge();a1e();l1e();u1e();NQe={parser:Fge,db:n1e,renderer:o1e,styles:c1e}});var m1e,g1e=N(()=>{"use  … [truncated]
./node_modules/katex/package.json:153:    "build": "rimraf dist/ && mkdirp dist && cp README.md dist && rollup -c --failAfterWarnings && webpack && node update-sri.js package dist/README.md",
./node_modules/katex/src/fonts/Makefile:139:	rm -rf pfa ff otf ttf woff woff2
./Dockerfile:42:    rm -rf /var/lib/apt/lists/*
./Dockerfile:121:    rm -rf /var/lib/apt/lists/*
./webapp/static/js/md_preview.bundle.js.map:4:  "sourcesContent": ["// Markdown-it plugin to render GitHub-style task lists; see\n//\n// https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments\n// https://github.com/blog/1825-t … [truncated]
./docs/DOCUMENTATION_GUIDE.md:453:rm -rf _build
./docs/Makefile:24:	rm -rf $(BUILDDIR)
./README.md:842:find . -name "__pycache__" -exec rm -rf {} +

@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fb22c73e-9033-44ba-b7d3-4bced25873f1

📥 Commits

Reviewing files that changed from the base of the PR and between 4a2115b and 12ce90f.

📒 Files selected for processing (1)
  • .mcp.json

📝 Walkthrough

Walkthrough

נוסף לקובץ .mcp.json שרת MCP בשם contextstream. החיבור משתמש ב-HTTP, במצב fast, ובמפתח API ממשתנה הסביבה CONTEXTSTREAM_API_KEY.

Changes

חיבור שרת MCP

Layer / File(s) Summary
הגדרת חיבור contextstream
.mcp.json
הוגדר endpoint מסוג HTTP עבור contextstream, עם מצב fast וכותרת אימות המבוססת על CONTEXTSTREAM_API_KEY.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

Claude Code הוסיף חיבור קטן ומדויק,
contextstream זורם בנתיב מהיר.
המפתח נשמר במשתנה סביבה,
והשרת מוכן לעבודה.
CodeKeeper forever 💫

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed הכותרת קצרה, ברורה ומתארת במדויק את הוספת שרת MCP של ContextStream לקובץ .mcp.json.
Description check ✅ Passed התיאור כולל את מטרת השינוי, פרטי התצורה, בדיקות ידניות, סיכונים ותוכנית rollback, ומכסה את עיקר תבנית ה-PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/contextstream-mcp

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

⏱️ Performance report

(No performance test durations collected. Mark tests with @pytest.mark.performance.)

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add ContextStream MCP HTTP server config to .mcp.json

⚙️ Configuration changes ✨ Enhancement 🕐 Less than 10 minutes

Grey Divider

AI Description

• Add ContextStream as a second MCP HTTP server alongside the existing Render entry
• Inject the ContextStream API key via environment-variable expansion in request headers
• Keep existing Render MCP configuration unchanged
Diagram

graph TD
  dev["Developer"] --> client["Claude Code (MCP client)"] --> cfg[".mcp.json"] --> servers["MCP server configs"]
  servers --> render{{"Render MCP"}}
  servers --> ctx{{"ContextStream MCP"}}
  env["Env vars"] --> cfg
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Local-only MCP config (~/.claude/mcp.json) + ignore repo file
  • ➕ Keeps all server config and secrets outside the repository
  • ➖ Doesn't survive ephemeral cloud/dev containers unless separately provisioned
  • ➖ Harder to ensure consistent tooling setup across contributors
2. Add a preflight check for missing MCP env vars
  • ➕ Makes missing CONTEXTSTREAM_API_KEY fail fast (avoids confusing auth failures)
  • ➕ Can be documented or automated via a simple script/task
  • ➖ Extra maintenance/complexity for a dev-only configuration
  • ➖ May not be portable across all environments where Claude Code runs

Recommendation: The chosen approach (commit .mcp.json with ${CONTEXTSTREAM_API_KEY} substitution) is appropriate for ephemeral dev environments and matches the existing Render pattern, while avoiding committing secrets. Consider a follow-up lightweight preflight/doc note to reduce the failure mode where an unset variable is passed literally.

Files changed (1) +7 / -0

Other (1) +7 / -0
.mcp.jsonAdd ContextStream HTTP MCP server entry with env-var API key +7/-0

Add ContextStream HTTP MCP server entry with env-var API key

• Adds a new "contextstream" MCP server configuration of type "http" pointing to the ContextStream MCP endpoint. Configures the request header "X-ContextStream-API-Key" to use environment-variable expansion via ${CONTEXTSTREAM_API_KEY}, leaving the existing Render entry unchanged.

.mcp.json

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Missing env var docs 🐞 Bug ⚙ Maintainability
Description
.mcp.json now references ${CONTEXTSTREAM_API_KEY} for the new ContextStream MCP server, adding a
new environment-variable dependency for developers. The repo’s env-var reference explicitly requires
documenting any added/changed env vars in code/infra, but this new variable is not documented,
making setup error-prone.
Code

.mcp.json[R13-15]

+      "headers": {
+        "X-ContextStream-API-Key": "${CONTEXTSTREAM_API_KEY}"
+      }
Relevance

●●● Strong

Prior PRs accepted documenting newly introduced env vars in docs/config inspector per checklist
expectations.

PR-#3155

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR adds a new header value sourced from ${CONTEXTSTREAM_API_KEY} in the committed .mcp.json,
creating a new env-var dependency. The env-var reference documentation explicitly says any
added/changed env vars in code/infra must be documented, but no such documentation change exists in
this PR.

.mcp.json[10-16]
docs/environment-variables.rst[1-6]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The repo now contains a committed MCP client config (`.mcp.json`) that depends on `CONTEXTSTREAM_API_KEY`, but the env-var reference documentation states env-var additions/changes must be documented.

## Issue Context
Developers pulling the repo will see a configured `contextstream` MCP server, but without documentation they may not know they must set `CONTEXTSTREAM_API_KEY` (and what it’s for / where it’s used).

## Fix Focus Areas
- docs/environment-variables.rst[1-11]
- .mcp.json[10-15]

## Implementation notes
- Add a short entry documenting `CONTEXTSTREAM_API_KEY` (purpose, where it is consumed: `.mcp.json`/Claude Code MCP client, and that it is not used by the app runtime).
- If you want to avoid future confusion, explicitly distinguish “MCP server (this repo)” env vars from “MCP client (Claude Code)” env vars in the documentation.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context used
✅ Compliance rules (platform): 37 rules

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment thread .mcp.json
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@amirbiron
amirbiron merged commit 06fe837 into main Aug 6, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants