Skip to content

Comments

Add Variables Management System with Automatic Substitution#4

Draft
codegen-sh[bot] wants to merge 2 commits intomainfrom
codegen-bot/add-variables-system-1754770481
Draft

Add Variables Management System with Automatic Substitution#4
codegen-sh[bot] wants to merge 2 commits intomainfrom
codegen-bot/add-variables-system-1754770481

Conversation

@codegen-sh
Copy link

@codegen-sh codegen-sh bot commented Aug 9, 2025

🔧 Variables Management System

This PR implements a comprehensive Saved Variables system that allows users to store environment variables (like API keys) and automatically substitute them in server configurations.

Key Features

Backend Implementation

  • Variable Controller: Full CRUD API endpoints (/variables)
  • Variable Service: File-based storage in variables.json with automatic substitution logic
  • Server Integration: Automatic variable substitution during server creation/update

Frontend Implementation

  • Variables Page: Complete management interface with Add/Edit/Delete functionality
  • Navigation Integration: New "Saved Variables" tab with tag icon
  • Secure Display: Masked values with show/hide toggle for sensitive data
  • Validation: Proper key format validation (uppercase with underscores)

Automatic Substitution

  • Environment Variables: Automatically replaces matching keys in server.env
  • Command Arguments: Also substitutes variables in server args
  • Real-time: Works during both server creation and updates

🎯 User Experience

  1. Save Variables: GEMINI_API_KEYyour_actual_api_key_here
  2. Create Server: Environment variable GEMINI_API_KEY=placeholder
  3. Automatic Magic: System substitutes with real saved value
  4. Secure Storage: Values masked in UI, stored in variables.json

📁 Files Added/Modified

Backend:

  • src/controllers/variableController.ts - CRUD endpoints
  • src/services/variableService.ts - Core logic & substitution
  • src/routes/index.ts - API routes
  • src/controllers/serverController.ts - Integration

Frontend:

  • frontend/src/pages/VariablesPage.tsx - Main interface
  • frontend/src/components/AddVariableDialog.tsx - Add dialog
  • frontend/src/components/EditVariableDialog.tsx - Edit dialog
  • frontend/src/App.tsx - Route configuration
  • frontend/src/components/layout/Sidebar.tsx - Navigation

🔒 Security Features

  • Masked value display with toggle visibility
  • Secure file-based storage
  • Input validation and sanitization
  • No sensitive data in logs

This sets the foundation for the GitHub installation system by providing secure variable management that will be essential for storing API keys and tokens needed by installed MCP servers.


💻 View my work • 👤 Initiated by @ZeeeepaAbout Codegen
⛔ Remove Codegen from PR🚫 Ban action checks

Description by Korbit AI

What change is being made?

Add a Variables Management System to the application, enabling automatic substitution of variables within server configurations.

Why are these changes being made?

To allow users to manage environment variables such as API keys directly from the application, facilitating secure and consistent variable usage across server configurations by automating their substitution. This enhancement provides a structured and user-friendly interface for variable management and integrates substitution logic to replace variable placeholders in both server environment variables and command-line arguments.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

- Created backend variable controller and service for CRUD operations
- Added frontend VariablesPage with Add/Edit/Delete functionality
- Integrated Variables tab in navigation with tag icon
- Added variable substitution logic in server creation/update
- Variables stored in variables.json with secure display in UI
- Automatic substitution of environment variables in server configs

Co-authored-by: Zeeeepa <zeeeepa@gmail.com>
@korbit-ai
Copy link

korbit-ai bot commented Aug 9, 2025

By default, I don't review pull requests opened by bots. If you would like me to review this pull request anyway, you can request a review via the /korbit-review command in a comment.

@coderabbitai
Copy link

coderabbitai bot commented Aug 9, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Join our Discord community for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

- Add GitHub installation service with repository cloning and analysis
- Add GitHub installation endpoints to server controller and routes
- Create GitHubInstallDialog component for frontend installation
- Enhance ServerCard with GitHub badges and uninstall functionality
- Add Install from GitHub button to ServersPage
- Support for Node.js and Python project detection and building
- Automatic server configuration generation from installed projects
- Visual indicators for GitHub-installed servers with yellowish background

Co-authored-by: Zeeeepa <zeeeepa@gmail.com>
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.

1 participant