Skip to content

[enhancement] Support MCP environment variable configuration for agent sessions #17

@github-actions

Description

@github-actions

Background

The Copilot SDK v0.1.25 (Feb 18, 2026) includes important MCP (Model Context Protocol) environment variable improvements in PR #484 authored by Steve Sanderson. The change fixes MCP environment variable handling by sending envValueMode: direct across all SDK implementations.

Key changes:

  • Updated @github/copilot to 0.0.411-1 with MCP env var fixes
  • CLI now supports direct environment variable mode for MCP servers
  • Ensures environment variables are properly passed to MCP tools

Related SDK commits:

Proposal

Add support for configuring MCP environment variables when creating Copilot agent sessions in Planeteer. This would allow users to:

  1. Specify environment variables needed by MCP tools (e.g., API keys, database URLs, service endpoints) in the plan definition or a configuration file
  2. Pass these environment variables to agent sessions via SessionConfig when executing tasks
  3. Support both global environment variables (apply to all tasks) and task-specific environment variables

Implementation approach:

  • Extend the Task model to include optional env field (key-value pairs)
  • Update src/services/executor.ts to merge global and task-specific env vars when creating sessions
  • Add UI in the refine screen for users to configure environment variables for tasks
  • Store environment variables in the persisted plan JSON (with warnings about sensitive data)

Benefit

This enhancement enables Planeteer to work with Copilot agents that rely on MCP tools requiring configuration:

  • MCP tool support: Many MCP servers need API keys, database credentials, or service endpoints passed as environment variables
  • Task customization: Different tasks can use different configurations (e.g., dev vs. prod database URLs)
  • Professional workflows: Supports real-world scenarios where agents need access to external services (databases, APIs, cloud providers)
  • SDK alignment: Takes advantage of the recent SDK fixes ensuring environment variables are properly propagated

Acceptance Criteria

  • Add env?: Record<string, string> field to the Task interface in src/models/plan.ts
  • Update src/services/executor.ts to accept environment variables in session configuration when creating agent sessions
  • Display environment variables in the refine screen task editor (with masking for sensitive values)
  • Save environment variables to plan JSON with a warning comment about not committing secrets
  • Add a settings file (.planeteer/settings.json) for global environment variables that apply to all plans
  • Update SDK dependency to ^0.1.25 in package.json to ensure MCP env var fixes are available
  • Document environment variable configuration in README with examples
  • Add validation to warn users when environment variables look like secrets (contain "key", "token", "password", etc.)

AI generated by Weekly Enhancement Suggestions

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions