feat: robust MCP env var detection, config gen fixes, and submit UX improvements#326
Merged
ShaanNarendran merged 4 commits intomainfrom Apr 16, 2026
Merged
Conversation
…ixes Overhaul env var detection in both CLI analyzer and server validator with a 4-tier system: server.json manifest → README → .env.example → source scanning. Adds Go and TypeScript regex patterns, filters test/internal dirs, and includes an allowlist for user-facing vars behind filtered prefixes (GITHUB_TOKEN, GITHUB_PERSONAL_ACCESS_TOKEN, DOCKER_HOST). Fix config generation for Go/Docker MCP servers: pass docker_image and env vars through the Claude Code agent config path, prompt for Docker image on Go framework submissions, and use docker_image presence (not framework name) to decide whether to generate docker run commands. Signed-off-by: Shaan Narendran <shaannaren06@gmail.com>
Users were blocked by a 409 conflict when re-submitting an MCP with the same name after a failed or rejected attempt. Now pending and rejected listings are automatically replaced, while approved listings remain protected and require the update flow. Signed-off-by: Shaan Narendran <shaannaren06@gmail.com>
The submit-time prompt "GITHUB_PERSONAL_ACCESS_TOKEN [required]:" was ambiguous — it looked like it was asking for the actual secret value when it was really asking for a review action (keep/remove/optional). Reword to "— keep? [Enter=keep / r=remove / o=optional]" so publishers don't accidentally paste credentials into a field that discards them. Signed-off-by: Shaan Narendran <shaannaren06@gmail.com>
Contributor
Author
|
I used ai for pr gen cause I was lazy |
Fix existing TestConfigGenerator._make_listing mock to set docker_image, framework, and environment_variables explicitly (avoids MagicMock truthy bug with the new docker_image check). Add test_env_detection_and_config.py covering: - Env var filtering (internal, CI prefix, allowlist, server/CLI parity) - Test file/directory filtering - 4-tier detection cascade (server.json, README, .env.example, source) - _build_run_command with docker_image and env vars - generate_config for Docker-based listings - Agent config generator passing docker_image to Claude Code path - MCP submit auto-replace of pending/rejected listings Signed-off-by: Shaan Narendran <shaannaren06@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
server.jsonmanifest → README →.env.example→ source code scanning. Adds Go (os.Getenv) and TypeScript (process.env) regex patterns, filters test/internal dirs, and includes an allowlist for user-facing vars behind filtered prefixes (GITHUB_TOKEN,GITHUB_PERSONAL_ACCESS_TOKEN,DOCKER_HOST).docker_imageand env vars through the Claude Code agent config path, prompts for Docker image on Go framework submissions, and usesdocker_imagepresence (not framework name) to decide whether to generatedocker runcommands.Test plan
https://github.com/github/github-mcp-server) — should detectGITHUB_PERSONAL_ACCESS_TOKENas the only env var--ide claude-code— config should includedocker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN=<value> ghcr.io/github/github-mcp-serverserver.jsonmanifest