Skip to content

Add MCP server configuration and initialization to TUI #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 315 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
315 commits
Select commit Hold shift + click to select a range
98f74c3
feat: Add K8s health data to service state updates and improve messag…
teemow May 26, 2025
7fd4a0c
refactor: Consolidate K8s state management into central StateStore an…
teemow May 26, 2025
4113644
feat: Implement service state interceptor for handling service restar…
teemow May 27, 2025
e3bae02
feat: Add mock implementations and tests for KubeManager and StateSto…
teemow May 27, 2025
b0bc731
feat: implement Phase 1 of service abstraction architecture
teemow May 27, 2025
466fa8c
feat: implement Phase 1 and partial Phase 2 of service architecture
teemow May 27, 2025
f6e0d89
feat: implement Phase 2 - service implementations and APIs
teemow May 27, 2025
48f86bc
feat: implement new orchestrator using service registry architecture
teemow May 27, 2025
f57fdc4
feat: implement TUI model and controller for new service architecture
teemow May 27, 2025
6c38689
feat: complete service architecture refactoring foundation
teemow May 27, 2025
54cff35
feat: complete TUI integration for new service architecture
teemow May 27, 2025
63d9e78
feat: unify orchestrator setup between TUI and non-TUI modes
teemow May 27, 2025
f3f77c8
fix: improve service shutdown handling in v2 architecture - Update po…
teemow May 27, 2025
557c193
fix: resolve v2 TUI initialization stuck issue - Fix startOrchestrato…
teemow May 27, 2025
42c79ca
fix: complete v2 TUI implementation to match v1 functionality - Fix e…
teemow May 27, 2025
f50bbc5
fix: resolve v2 TUI width and layout issues - Rewrite MCP servers ren…
teemow May 27, 2025
5a65b06
fix: resolve v2 TUI status updates and UI issues - Fix port forward h…
teemow May 27, 2025
10f257a
fix: resolve remaining v2 TUI issues - Fix quit functionality in over…
teemow May 27, 2025
14416f4
fix: improve state/health visualization with proper icons and colors …
teemow May 27, 2025
1c5a414
fix: filter debug logs in TUI when not in debug mode - Add log level …
teemow May 27, 2025
0bcf771
fix: consolidate debug flags and properly initialize v2 TUI debug mod…
teemow May 27, 2025
cb3f774
fix: restart dependent MCP servers when port forward is reactivated i…
teemow May 27, 2025
5b75fad
refactor: remove unused TUI components and consolidate API types for …
teemow May 27, 2025
8218235
test: add comprehensive test coverage across all packages
teemow May 27, 2025
e86212a
feat: implement MCP tools overlay with proper text wrapping
teemow May 27, 2025
78e18ed
docs: comprehensive documentation update for service-based architectu…
teemow May 28, 2025
633019f
refactor: remove unused kube package and clean up MCP server definitions
teemow May 30, 2025
7686e55
refactor: remove port field from MCPServerInfo and related tests
teemow May 30, 2025
048700e
feat: implement ProcessClient for managing process connections and ad…
teemow May 31, 2025
1d62f81
feat: add MCPClientProvider interface and implement mcpClientProvider…
teemow Jun 2, 2025
caa3b4e
refactor: remove PID references from MCPServerService and related tes…
teemow Jun 2, 2025
1914f7f
feat: implement SSE server for HTTP transport in AggregatorServer
teemow Jun 2, 2025
717d907
feat: implement smart prefixing for tool and prompt names in Aggregat…
teemow Jun 2, 2025
bd2e9f1
feat: enhance aggregator service with global state change callback an…
teemow Jun 2, 2025
ec686c2
feat: enhance aggregator service with global state change callback ap…
teemow Jun 3, 2025
1c69050
feat: enable custom kube.Manager injection for testing and enhance sh…
teemow Jun 3, 2025
c7bcfe7
feat: simplify subsystem naming in port-forwarding logger
teemow Jun 3, 2025
8288b70
feat: add tests for orchestrator service management and dependency ha…
teemow Jun 3, 2025
2e6c779
feat: update documentation guidelines and enhance aggregator service …
teemow Jun 3, 2025
0d62d3a
feat: implement adapters for orchestrator and MCP service APIs in agg…
teemow Jun 3, 2025
ece2388
feat: remove PID references from MCP server status and simplify relat…
teemow Jun 3, 2025
8b2e687
style: format code for consistency in orchestrator configuration
teemow Jun 3, 2025
c4aa27a
feat: integrate AggregatorAPI into TUI model and services, enhance ag…
teemow Jun 3, 2025
bfb61b9
feat: add debug logging for aggregator and MCP server operations to e…
teemow Jun 3, 2025
fa7787c
feat: add ServiceType field to ServiceStateChangedEvent for enhanced …
teemow Jun 3, 2025
42218f1
refactor: simplify health check logic and improve event subscription …
teemow Jun 4, 2025
ae24436
feat: add envctl agent command for debugging MCP aggregator and enhan…
teemow Jun 4, 2025
c4925c8
feat: update MCP-go dependency and enhance logging for resource and p…
teemow Jun 4, 2025
213e08b
feat: implement NameTracker for managing tool and prompt name conflic…
teemow Jun 4, 2025
1e748bb
feat: enhance dependency handling in Orchestrator to skip failed serv…
teemow Jun 4, 2025
7691c31
feat: add support for 'Waiting' service state and enhance cluster con…
teemow Jun 4, 2025
c0a9f8e
feat: implement CheckAPIHealth method for Kubernetes API health check…
teemow Jun 4, 2025
b0bd88c
feat: update CheckAPIHealth method to return API version and enhance …
teemow Jun 4, 2025
eef6ede
feat: add Go guidelines and implement REPL mode for agent with enhanc…
teemow Jun 5, 2025
0dc4416
fix: redirect agent logger output to TUI viewport instead of stdout -…
teemow Jun 5, 2025
f52ab47
feat: add --yolo flag to disable denylist for destructive MCP tool calls
teemow Jun 5, 2025
b4e51ef
feat: enhance tool management by adding ToolWithStatus type and updat…
teemow Jun 5, 2025
5339989
feat: add MCPToolsList to model and initialize in render functions fo…
teemow Jun 5, 2025
ce2e370
feat: implement workflow management system with user-defined workflow…
teemow Jun 6, 2025
18291c3
docs: add workflow_spec tool to workflows documentation
teemow Jun 6, 2025
f3906fa
docs: add workflow_spec usage examples for agents
teemow Jun 6, 2025
06de61b
feat: add toolPrefix support to MCP services and update related confi…
teemow Jun 6, 2025
e1e0496
feat: implement workflow update monitoring and adjust tool naming con…
teemow Jun 6, 2025
12b273a
feat: implement design system and refactor TUI components for improve…
teemow Jun 6, 2025
e8334a3
feat: add API adapters for aggregator, port forward, and k8s services
teemow Jun 7, 2025
cb50944
feat: add API tools for programmatic control of envctl services and c…
teemow Jun 7, 2025
82b24b8
feat: integrate MCP server mode into envctl agent command - MCP serve…
teemow Jun 7, 2025
4b6ce98
Add debugging guide for envctl-agent MCP server
teemow Jun 7, 2025
f0f328c
feat: refactor MCP client registration in aggregator manager - Simpli…
teemow Jun 7, 2025
3af1711
feat: remove built-in default configuration in favor of YAML configs
teemow Jun 7, 2025
9d86769
fix: keep aggregator enabled by default even without MCP servers
teemow Jun 7, 2025
655825e
feat: add configuration management APIs and tools - Introduced Config…
teemow Jun 9, 2025
8902cc1
feat: implement capability management framework - Added capability re…
teemow Jun 9, 2025
8527e85
fix: Fix TestCapabilityMatching test and apply formatting - Fixed tes…
teemow Jun 9, 2025
3f4d998
feat: add documentation and guidelines for rules management - Introdu…
teemow Jun 10, 2025
aac6bb1
feat: rename capability tools for consistency and add Kubernetes conn…
teemow Jun 10, 2025
3676e7e
feat: update .gitignore, remove outdated documentation, and enhance c…
teemow Jun 10, 2025
bd3d981
feat: update capability adapter to use api.ToolCaller and add capabil…
teemow Jun 10, 2025
ed75dc5
feat: introduce capability-driven port forwarding implementation and …
teemow Jun 10, 2025
8c7d135
feat: add ReloadConfig method to ConfigServiceAPI and implement funct…
teemow Jun 10, 2025
ad394f1
feat: add architecture rules file and remove outdated self-improve an…
teemow Jun 11, 2025
75a4946
feat: add task complexity analysis report for project Taskmaster
teemow Jun 11, 2025
af06b33
feat: remove unused CapabilityTypeCluster from capability types
teemow Jun 11, 2025
0e5cb65
feat: refactor Orchestrator to be domain-agnostic and remove legacy c…
teemow Jun 11, 2025
e683231
feat(aggregator): implement centralized tool naming convention system…
teemow Jun 11, 2025
7307d4d
feat: remove Kubernetes-related functionality and refactor context ha…
teemow Jun 11, 2025
eee5507
feat: clean up code formatting and remove unused integration test - S…
teemow Jun 11, 2025
bb42e64
feat: refactor configuration loading and remove unused cluster parame…
teemow Jun 11, 2025
1eb87db
feat: update documentation to reflect new aggregator functionality - …
teemow Jun 11, 2025
557125d
feat: clean up code formatting and remove unnecessary whitespace - St…
teemow Jun 11, 2025
cc904fb
feat(capability): Complete ServiceOrchestrator implementation for tas…
teemow Jun 12, 2025
5749a9b
feat(capability): integrate orchestrator with aggregator - Replace pl…
teemow Jun 12, 2025
3e5eb20
feat(api): implement comprehensive API layer for service orchestrator…
teemow Jun 12, 2025
b30b066
feat(docs): update configuration file references in documentation and…
teemow Jun 12, 2025
2624fdc
feat(docs): introduce ServiceClass architecture refactoring proposal …
teemow Jun 12, 2025
035b979
feat(docs): update PRD to reflect architectural refactoring and produ…
teemow Jun 12, 2025
e33fe90
feat(serviceclass): introduce ServiceClass management package and def…
teemow Jun 12, 2025
ccae1e7
feat(api): enhance ServiceClassManagerHandler with lifecycle tool acc…
teemow Jun 12, 2025
851d3aa
feat(api): implement ServiceClass instance management methods - Add m…
teemow Jun 12, 2025
1c8f6ea
feat(api): integrate ServiceClass manager into tool factory - Add sup…
teemow Jun 12, 2025
bd1414c
refactor(api): clean up whitespace and formatting in handler and orch…
teemow Jun 12, 2025
a0669a2
feat(serviceclass): Complete comprehensive integration testing for Ph…
teemow Jun 12, 2025
1043057
refactor(serviceclass): update tool naming conventions and capability…
teemow Jun 12, 2025
18d9c49
feat(serviceclass): update lifecycle tool definitions and add restart…
teemow Jun 12, 2025
904a699
feat(envctl): add systemd service and setup scripts for envctl - Crea…
teemow Jun 14, 2025
1108110
feat(aggregator): add transport protocol configuration to AggregatorC…
teemow Jun 14, 2025
1605e1f
docs(envctl): update testing procedures for Go code in envctl service…
teemow Jun 14, 2025
ac53e5c
feat(workflow): introduce WorkflowDefinition and related types - Defi…
teemow Jun 14, 2025
699464a
feat(capability): refactor tool availability checks and enhance workf…
teemow Jun 14, 2025
0692a6a
feat(workflows): add new workflows for authentication, discovery, and…
teemow Jun 14, 2025
e334d38
feat(capability): enhance configuration loading with error handling a…
teemow Jun 14, 2025
a2e41ee
refactor(workflow): clean up whitespace and remove unused init files …
teemow Jun 14, 2025
8791b5f
feat(config): update fallback provider and model ID in configuration …
teemow Jun 14, 2025
85451cf
refactor(mcpserver): replace config.MCPServerDefinition with mcpserve…
teemow Jun 14, 2025
cce5574
feat(mcpserver): implement MCP server management interface and adapte…
teemow Jun 14, 2025
7204b5e
feat(mcpserver): add Kubernetes MCP server configuration example and …
teemow Jun 15, 2025
de434fd
refactor(api): rename orchestrator references to service manager - Up…
teemow Jun 15, 2025
83c0b4c
refactor(services): remove MCPServiceAPI references and update relate…
teemow Jun 15, 2025
03cfccb
feat(cli): add aggregator endpoint detection and server health check …
teemow Jun 15, 2025
25780d9
test: fix failing tests after API refactoring - Remove obsolete mcp_s…
teemow Jun 15, 2025
423dea5
docs: enhance troubleshooting and configuration documentation for CLI…
teemow Jun 15, 2025
006b2dc
feat(cli): comprehensive UX overhaul with professional table formatti…
teemow Jun 15, 2025
91ba105
feat(cli): implement list and create commands for resource management…
teemow Jun 15, 2025
e39b463
feat(docs): add PRD for dynamic entity persistence - outline requirem…
teemow Jun 15, 2025
6738562
feat(config): update model provider and ID, add default tag to config…
teemow Jun 15, 2025
a8dcb9c
feat(config): implement DynamicStorage service for dynamic entities -…
teemow Jun 15, 2025
f65c12a
refactor(workflow): remove WorkflowStorage implementation - Remove le…
teemow Jun 15, 2025
62ea695
feat(workflow): integrate DynamicStorage for persistence - Refactor w…
teemow Jun 15, 2025
a7eddd6
feat(capability): complete DynamicStorage integration with CRUD opera…
teemow Jun 15, 2025
8825eb1
refactor(loader): simplify YAML loading functions and enhance error h…
teemow Jun 15, 2025
125a5d5
refactor(capability): update references from dynamic storage to gener…
teemow Jun 15, 2025
fbe4550
refactor(manager): clean up whitespace in capability, config, and wor…
teemow Jun 15, 2025
cf31270
refactor(validation): enhance validation error messages for capabilit…
teemow Jun 15, 2025
dbf4b23
refactor(validation): remove unnecessary whitespace in validation fun…
teemow Jun 15, 2025
5ca8a77
feat(config): Implement comprehensive integration tests for unified e…
teemow Jun 15, 2025
daddd25
refactor(tests): clean up whitespace in validation integration tests …
teemow Jun 15, 2025
4422681
refactor(storage): replace DynamicStorage with Storage in multiple co…
teemow Jun 15, 2025
1b85e34
docs: Add comprehensive documentation for entity storage system - Cre…
teemow Jun 15, 2025
e9fc3ed
feat(orchestrator): Add minimal service instance persistence without …
teemow Jun 15, 2025
4737c74
feat(config): Add functions to mock OS user home directory and curren…
teemow Jun 17, 2025
7171250
Created a comprehensive testing PRD
teemow Jun 17, 2025
70b418f
Refined the testing plan
teemow Jun 17, 2025
bae251b
refactor(serviceclass): Rename serviceclass commands for consistency …
teemow Jun 17, 2025
8fdf4eb
chore: Remove task-master
teemow Jun 17, 2025
c8d2b2b
Behavioral test scenarios Task 12: Create Behavioral Test Scenarios f…
teemow Jun 18, 2025
6a06fc2
feat: Add GitHub workflow guidelines and tools usage documentation
teemow Jun 18, 2025
2238a1a
feat(tests): Add comprehensive behavioral testing framework for Servi…
teemow Jun 18, 2025
9de87eb
feat(tests): Implement MCP test client and integrate with test framework
teemow Jun 18, 2025
751f051
refactor(test): Simplify endpoint detection logic by using CLI comman…
teemow Jun 18, 2025
4d9c51b
feat(test): Add shell completion for test command flags
teemow Jun 18, 2025
2431ff4
refactor(debug): Update endpoint detection to use CLI logic and impro…
teemow Jun 18, 2025
338b47a
feat(docs): Enhance issue management best practices in GitHub workflo…
teemow Jun 18, 2025
aefdfbd
Feat: Expose Test Framework as MCP Server (closes #86)
teemow Jun 18, 2025
893e9d8
Docs: Comprehensive Test Framework Documentation (closes #87)
teemow Jun 18, 2025
ff16f39
Docs: Create comprehensive MCP testing guide (closes #88)
teemow Jun 18, 2025
ca2a520
remove wrong behavioral test scenarios
teemow Jun 19, 2025
d45c8f5
Feat: Add support for custom configuration path in application and ma…
teemow Jun 19, 2025
7c16b45
Feat: Introduce managed test framework with configurable base port an…
teemow Jun 19, 2025
531301c
Feat: Implement Mock MCP Server for Behavioral Testing (closes #101)
teemow Jun 19, 2025
198787d
Docs: Update MCP testing guide to reflect automatic instance manageme…
teemow Jun 19, 2025
f528142
Docs: Remove outdated CI/CD pipeline examples from MCP testing guide
teemow Jun 19, 2025
525c78a
Refactor test step structure to use 'id' instead of 'name' and update…
teemow Jun 19, 2025
11ab71f
Refactor MCP server types and update mock server configuration handling
teemow Jun 19, 2025
355c1af
Feat: Enhance EnvCtlInstance with expected tools tracking and improve…
teemow Jun 20, 2025
2cb88ae
Feat: Enhance test framework with verbose logging and update tool nam…
teemow Jun 20, 2025
c32ff76
Feat: Implement tool update event system with subscription and notifi…
teemow Jun 20, 2025
50a16b6
Docs: Update testing documentation to include mocked MCP server tools…
teemow Jun 20, 2025
e04da3f
Feat: Introduce structured logging and argument merging for MCP serve…
teemow Jun 20, 2025
6589578
Feat: Enhance service instance information with additional attributes…
teemow Jun 20, 2025
c218d05
Feat: Introduce mock MCP server functionality with configurable tools…
teemow Jun 20, 2025
7752871
Feat: Refactor instance manager creation to use logger in test framew…
teemow Jun 20, 2025
886eeed
Fix: Refactor the ToolCaller interface into the api layer
teemow Jun 20, 2025
4946626
Refactor error handling to use custom error types for not found scena…
teemow Jun 20, 2025
2174460
Refactor tool call error handling and expectation validation in test …
teemow Jun 20, 2025
a4dc181
Refactor mock workflow configuration to use input parameters for name…
teemow Jun 20, 2025
917e14e
Refactor testing documentation to enhance clarity on mock MCP server …
teemow Jun 20, 2025
bb01b16
Refactor MCP client connection handling to ensure isolation per scena…
teemow Jun 20, 2025
034a6b8
Refactor testing examples to standardize step identifiers and enhance…
teemow Jun 20, 2025
677917d
Refactor capability handling to remove dynamic capability validation …
teemow Jun 20, 2025
d3c1718
Add behavioral test scenarios for service and MCPServer operations
teemow Jun 20, 2025
b61c138
Refactor capability scenarios to standardize operation structures and…
teemow Jun 20, 2025
6543732
Refactor testing scenarios to standardize YAML structure and enhance …
teemow Jun 21, 2025
f967104
Refactor API and capability management by removing obsolete methods a…
teemow Jun 21, 2025
53a666a
Add validation methods for service class and MCP server definitions, …
teemow Jun 21, 2025
9f3a26c
Remove obsolete workflow_spec tool and associated specification metho…
teemow Jun 21, 2025
29568a1
Remove Icon and Category fields from MCPServer and ServiceClass defin…
teemow Jun 21, 2025
0f2cf71
Refactor code to remove unused K8s and PortForward references, simpli…
teemow Jun 21, 2025
00ede6c
Update workflow and debugging rules to always apply; remove obsolete …
teemow Jun 21, 2025
53caac6
Refactor code to remove unused capability registry and streamline wor…
teemow Jun 22, 2025
356eb24
Refactor service class and instance handling; remove deprecated type …
teemow Jun 22, 2025
ec21980
Fix missing newline at end of file in MCPWithDepsItemDelegate render …
teemow Jun 22, 2025
b05398c
Refactor service class validation and request handling; streamline pa…
teemow Jun 22, 2025
96975fa
Remove deprecated golden test files and refactor service label to nam…
teemow Jun 22, 2025
e6642fd
Refactor service commands to use 'name' instead of 'label' for resour…
teemow Jun 22, 2025
bed3083
Remove deprecated parameters and refactor scenario configurations for…
teemow Jun 22, 2025
f08c009
Enhance 'test_validate_scenario' tool with optional API schema valida…
teemow Jun 22, 2025
9bdfd07
Add validation scenarios for services, MCP servers, capabilities, and…
teemow Jun 22, 2025
7c0330f
Remove deprecated MCP server creation scenarios and update existing s…
teemow Jun 23, 2025
f90abdf
Refactor envctl server definition to use 'localCommand' type and stre…
teemow Jun 23, 2025
dd20d42
Rename LoadServiceDefinitions to LoadDefinitions for consistency and …
teemow Jun 23, 2025
1fae348
Normalize state and health checks to lowercase for consistency across…
teemow Jun 23, 2025
b5bb2e3
Refactor MCP server components: reduce default timeout for initializa…
teemow Jun 23, 2025
892cd5f
Reduce resource timeout to 5 seconds and enhance log collection in te…
teemow Jun 23, 2025
a293ec3
Clean up code formatting: remove unnecessary blank lines and ensure c…
teemow Jun 23, 2025
6471db5
Update configuration rules to not always apply and refactor ConfigSer…
teemow Jun 23, 2025
554666c
Refactor test response validation: simplify error checking for CallTo…
teemow Jun 23, 2025
2042654
Add parallel mode support to test reporters: implement SetParallelMod…
teemow Jun 23, 2025
8038583
Add ListToolsWithSchemas method to MCPTestClient: implement functiona…
teemow Jun 23, 2025
64d14d1
Add descriptions to MCP server test scenarios: enhance clarity by pro…
teemow Jun 23, 2025
91cc999
Publish tool update event during capability updates: notify dependent…
teemow Jun 23, 2025
3c1594a
Implement timeout handling for test execution and add MCP client time…
teemow Jun 23, 2025
f2ab2b5
Refactor test reporter to display instance logs in debug mode for all…
teemow Jun 23, 2025
3c06600
Enhance service management: add state checks before starting/stopping…
teemow Jun 23, 2025
d74c2b7
Enhance service testing scenarios: add versioning, improve error hand…
teemow Jun 23, 2025
00b8621
Add versioning to service class scenarios and improve error handling
teemow Jun 23, 2025
9f4f6b6
Add parameter validation to ServiceClass for service creation
teemow Jun 23, 2025
18a9375
Enhance test reporter for parallel execution: add mutex for concurren…
teemow Jun 23, 2025
8a8e3ea
Refactor service initialization: set ToolCaller directly and remove r…
teemow Jun 23, 2025
3dad8e5
Enhance logging in workflow execution and tool handling: add error an…
teemow Jun 23, 2025
aada3a5
Add capability management to aggregator: implement UpdateCapabilities…
teemow Jun 23, 2025
6ab6257
Enhance workflow scenarios: add inputSchema to various workflows and …
teemow Jun 23, 2025
7399d76
Enhance workflow validation tests: add scenario for invalid workflow …
teemow Jun 23, 2025
5cbdba8
Rename debug command to agent and update related functionality for im…
teemow Jun 23, 2025
c526dd4
Rename debug command to agent and update related functionality for im…
teemow Jun 23, 2025
083bdb3
Add core tools listing and filtering functionality to REPL
teemow Jun 24, 2025
c2dcd59
Implement core tools listing and filtering functionality in REPL
teemow Jun 24, 2025
628fbd2
Refactor CLI client to use agent package and update related tests
teemow Jun 24, 2025
0c9f80f
Add REPL command handling and tab completion for tools, resources, an…
teemow Jun 24, 2025
43926eb
Add TableBuilder for enhanced cell formatting and styling in CLI output
teemow Jun 24, 2025
673813a
Add CLI client and agent implementation with auto-detected aggregator…
teemow Jun 24, 2025
c433359
Add unified formatting and command interface for CLI and agent compon…
teemow Jun 24, 2025
c4fbace
Implement exit and notifications commands; refactor formatters access…
teemow Jun 24, 2025
80dbe07
Fix formatting issues by removing trailing whitespace and ensuring ne…
teemow Jun 24, 2025
9d584f0
Refactor logging and command output handling; introduce OutputLogger …
teemow Jun 24, 2025
002d938
Fix formatting issues by ensuring newlines at end of files and removi…
teemow Jun 24, 2025
780834c
Enhance streamable HTTP transport with notification support; update r…
teemow Jun 24, 2025
e9e2807
Enforce workflow validation by requiring at least one step; update re…
teemow Jun 24, 2025
614515b
Enhance core tools listing by filtering tools that start with "core_"…
teemow Jun 24, 2025
8106a3e
Refactor agent client connection handling; enhance notification suppo…
teemow Jun 24, 2025
579d71a
Add support for a no-op logger in agent mode; improve signal handling…
teemow Jun 24, 2025
2afd20f
Refactor agent connection handling for REPL mode; implement separate …
teemow Jun 24, 2025
ef92cf1
Enhance capability testing scenarios by adding descriptions for opera…
teemow Jun 24, 2025
7c16c60
Refactor developer onboarding journey scenarios; update service class…
teemow Jun 24, 2025
82492c0
Enhance user journey scenarios by adding descriptions for operations,…
teemow Jun 24, 2025
26ddbeb
Refactor MCP server management; update status checks and remove avail…
teemow Jun 25, 2025
8fb2848
Refactor agent command execution; remove unnecessary context paramete…
teemow Jun 25, 2025
c8b0f8d
Refactor MCP server management; remove health check interval handling…
teemow Jun 25, 2025
315d578
Refactor MCP client and test runner; reduce default timeout, simplify…
teemow Jun 25, 2025
48a7453
Refactor MCP server lifecycle tests; update descriptions, tool names,…
teemow Jun 25, 2025
408fc0c
Enhance test runner and scenarios; allow increased parallel test work…
teemow Jun 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .cursor/rules/closing-issue-workflow.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
description:
globs:
alwaysApply: true
---
When closing an issue:

1. Confirm with the user that the issue is ready to be closed.
2. Make sure to run `goimports -w .` and `go fmt ./...` before your commit any code.
3. Run tests by executing the `make test` command in the terminal using `run_terminal_cmd`.
4. **If tests fail:**
* You have to fix the tests.
* DO NOT proceed with closing the issue.
5. **If tests pass:**
* Proceed with committing and pushing the changes, follow the `commit-and-push-workflow`.
* After the `commit-and-push-workflow` is successful, then use the `mcp_github_update_issue` tool to change the state of the issue to 'closed'. Make sure to specify the `owner` as `giantswarm`, `repo` as `envctl`, and the correct `issue_number`.
23 changes: 23 additions & 0 deletions .cursor/rules/commit-and-push-workflow.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
description:
globs:
alwaysApply: false
---
When committing and pushing changes after an issue is successfully closed and tests have passed:

1. **Get current Git branch:**
* Run `git rev-parse --abbrev-ref HEAD` using `run_terminal_cmd` to get the current branch name. Let this be `current_branch`.
2. Let the closed issue number be `issue_num` and its title be `issue_title`.
3. **Branch Management:**
* Set `target_branch` to `current_branch`.
* If `current_branch` is `main` or `master`:
* Generate a new branch name. The suggested pattern is `<type>/issue-<issue_num>-<slugified_issue_title>`, where `<type>` could be `feature`, `fix`, `refactor`, etc., based on the nature of the work. I will generate a slug from the issue title (e.g., lowercase, hyphens for spaces, remove special characters). Example: `refactor/issue-37-getpodnameforportforward-context-handling`.
* Run `git checkout -b <new_branch_name>` using `run_terminal_cmd`.
* Set `target_branch` to this `<new_branch_name>`.
* Inform the user that a new branch `<new_branch_name>` has been created and checked out.
4. **Stage changes:** Run `git add .` using `run_terminal_cmd`.
5. **Commit changes:**
* Construct a commit message. The suggested pattern is: `<CommitType>: <issue_title> (closes #<issue_num>)`. Example: `Refactor: Refactor getPodNameForPortForward for clarity, scope, and context handling (closes #37)`. The `<CommitType>` (e.g., Refactor, Fix, Feat) should match the nature of the work.
* Run `git commit -m "<commit_message>"` using `run_terminal_cmd`.
6. **Push changes:** Run `git push origin <target_branch>` using `run_terminal_cmd`.
7. Inform the user that the changes have been committed to `<target_branch>` and pushed to origin.
10 changes: 10 additions & 0 deletions .cursor/rules/creating-issue-workflow.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
description:
globs:
alwaysApply: true
---
When creating a new issue:

1. Gather the necessary information for the issue: `title` and `body`. `labels` and `assignees` can also be included if provided.
2. Use the `create_issue` tool to create the new issue in the `giantswarm/envctl` repository. Set `owner` to `giantswarm` and `repo` to `envctl`.
3. Announce the new issue (title and number) in the chat after it has been created.
13 changes: 13 additions & 0 deletions .cursor/rules/next-issue-workflow.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
description:
globs:
alwaysApply: true
---
When beginning work on a new task:

1. Use the `list_issues` tool to fetch the list of open issues from the `giantswarm/envctl` repository, ordered by issue number descending (newest first).
2. Decide which is the next best issue in that list (still open issue) and use the `get_issue` tool with its issue number to retrieve full details.
3. Summarize that issue (title, number, body, key tasks) in the chat before starting implementation steps.
4. After summarizing, outline the approach for addressing the issue and continue with the implementation.

This rule ensures every new coding session starts with up-to-date context from the roadmap.
17 changes: 17 additions & 0 deletions .cursor/rules/testing-guidelines.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
description:
globs:
alwaysApply: true
---
## Testing Guidelines

When implementing new features or fixing bugs, ensure the following testing criteria are met:
To run all tests and linters, use the `make test` command in your terminal. If you changed or added view tests use the terminal to execute 'NO_COLOR=true go test ./internal/tui/view/... -update' so that the view tests have been updated not to use any colors.

- New functionality must be covered by appropriate unit, integration, or end-to-end tests.
- Existing tests must be updated to reflect any changes in behavior.
- If the changes affect the TUI views:
- Corresponding golden files (located in `internal/tui/view/testdata/*.golden`) must be generated or updated.
- This is typically done by running `go test ./internal/tui/view/... -update`.
- The updated golden files must be carefully reviewed and verified to ensure they reflect the intended visual changes.
- Strive to meet or improve test coverage for the modified packages. There should be a minimum of 80% test coverage.
14 changes: 14 additions & 0 deletions .envctl/config.yaml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Project-specific configuration for envctl
# Copy this to .envctl/config.yaml and update with your values

mcpServers:
- name: grafana
type: localCommand
enabledByDefault: true
icon: "📊"
category: "Monitoring"
command: ["mcp-grafana"]
env:
GRAFANA_URL: "http://localhost:3000"
GRAFANA_API_KEY: "YOUR_GRAFANA_SERVICE_ACCOUNT_TOKEN_HERE"
requiresPortForwards: ["mc-grafana"]
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

### What is needed from the reviewers?

### Testing

- [ ] New functionality is covered by unit/integration tests.
- [ ] Existing tests have been updated to reflect changes.
- [ ] For UI changes involving golden files (e.g., in `internal/tui/view/testdata/`), new files have been generated/updated (e.g., by running `go test ./internal/tui/view/... -update`) and meticulously verified.

### Do the docs need to be updated?

### Should this change be mentioned in the release notes?
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/docker-mcp-servers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Build MCP Server Docker Images

on:
push:
branches:
- main
- master
paths:
- 'docker/mcp-servers/**'
- '.github/workflows/docker-mcp-servers.yaml'
pull_request:
paths:
- 'docker/mcp-servers/**'
- '.github/workflows/docker-mcp-servers.yaml'
release:
types: [published]

env:
REGISTRY: ghcr.io
IMAGE_PREFIX: ${{ github.repository_owner }}/mcp-server

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
server: [kubernetes, prometheus, grafana]

permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}-${{ matrix.server }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: docker/mcp-servers/${{ matrix.server }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Test image (if built)
if: github.event_name == 'pull_request'
run: |
docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}-${{ matrix.server }}:pr-${{ github.event.pull_request.number }} --version || echo "No version command available"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
envctl
dist/
.envctl/config.yaml
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changelog

## [Unreleased]

### Added
- Support for containerized MCP servers (#41)
- New `type: container` option for MCP server definitions
- Docker runtime implementation in `internal/containerizer` package
- Container lifecycle management (pull, start, stop, logs, port detection)
- Example Dockerfiles for kubernetes, prometheus, and grafana MCP servers
- GitHub Actions workflow for building and publishing container images
- Documentation for containerized MCP server configuration

### Changed
- Updated `MCPServerDefinition` to support container-specific fields
- Modified `StartAllMCPServers` to handle both local command and container types
- Enhanced startup logic to initialize container runtime when needed

## [Previous versions...]
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ check: lint-yaml ## Run YAML linter

##@ Testing

.PHONY: test
test: ## Run go test and go vet
@echo "Running Go tests (with NO_COLOR=true)..."
@NO_COLOR=true go test -cover ./...
@echo "Running go vet..."
@go vet ./...

# Note: These targets require Docker and 'act' to be installed.
# See: https://github.com/nektos/act#installation

Expand Down
92 changes: 58 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ It automates the process of logging into clusters via Teleport (`tsh`) and setti
## Features ✨

* **Simplified Connection:** Connect to management and workload clusters with a single command.
* **Automatic Context Switching:** Sets your `kubectl` context correctly.
* **Automatic Context Switching:** Sets your Kubernetes context correctly.
* **Port-Forwarding Management:**
* Prometheus and Grafana services (always from the Management Cluster)
* Alloy Metrics (from the Workload Cluster if specified, otherwise from the Management Cluster)
Expand All @@ -31,7 +31,12 @@ Before using `envctl`, ensure you have the following installed and configured:

1. **Go:** Version 1.21 or later ([Installation Guide](https://go.dev/doc/install)).
2. **Teleport Client (`tsh`):** You need `tsh` installed and logged into your Giant Swarm Teleport proxy.
3. **`kubectl`:** The Kubernetes command-line tool.
3. **`mcp-proxy`:** This tool is used by `envctl` to proxy your actual MCP servers. ([Installation Guide](https://github.com/sparfenyuk/mcp-proxy#installation)).
4. **Underlying MCP Server Executables:** `envctl` expects specific MCP server commands to be available in your PATH, as it will invoke them via `mcp-proxy`. These are typically:
* For Kubernetes: `npx mcp-server-kubernetes` (requires Node.js and `npx`)
* For Prometheus: `uvx mcp-server-prometheus` (requires `uv` and the Python-based `mcp-server-prometheus`)
* For Grafana: `uvx mcp-server-grafana` (requires `uv` and the Python-based `mcp-server-grafana` - if you use a Grafana MCP).
Copy link
Member

Choose a reason for hiding this comment

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

Fix installation method for prometheus and grafana MCPs

Suggested change
* For Prometheus: `uvx mcp-server-prometheus` (requires `uv` and the Python-based `mcp-server-prometheus`)
* For Grafana: `uvx mcp-server-grafana` (requires `uv` and the Python-based `mcp-server-grafana` - if you use a Grafana MCP).
* For Prometheus: `uvx prometheus-mcp-server` (requires `uvx` and the Python-based `prometheus-mcp-server`)
* For Grafana: `go install github.com/grafana/mcp-grafana/cmd/mcp-grafana@latest` (requires `go`).

(Ensure `uv` is installed if you intend to use `uvx` for these servers: [uv Installation](https://github.com/astral-sh/uv#installation)).

## Installation 🛠️

Expand Down Expand Up @@ -90,7 +95,7 @@ envctl self-update
# Use the CLI mode without TUI (for scripts or CI environments)
# This mode will:
# - Log into the specified cluster(s) via tsh.
# - Set the kubectl context.
# - Sets the Kubernetes context.
# - Start port-forwarding for:
# - Prometheus (MC) on localhost:8080
# - Grafana (MC) on localhost:3000
Expand All @@ -116,7 +121,7 @@ envctl connect <management-cluster> [workload-cluster-shortname] --no-tui

* Launches an interactive terminal UI
* Logs into `myinstallation` via `tsh kube login myinstallation`.
* Sets the current `kubectl` context to `teleport.giantswarm.io-myinstallation`.
* Sets the current Kubernetes context to `teleport.giantswarm.io-myinstallation`.
* Starts port-forwarding for Prometheus (MC) on `localhost:8080`, Grafana (MC) on `localhost:3000`, and Alloy Metrics (MC) on `localhost:12345`.
* Displays cluster health and connection status
* Allows management of port-forwards and contexts
Expand All @@ -129,7 +134,7 @@ envctl connect <management-cluster> [workload-cluster-shortname] --no-tui

* Logs into `myinstallation` via `tsh kube login myinstallation`.
* Logs into the *full* workload cluster name (`myinstallation-myworkloadcluster`) via `tsh`.
* Sets the current `kubectl` context to the *full* workload cluster name (`teleport.giantswarm.io-myinstallation-myworkloadcluster`).
* Sets the current Kubernetes context to the *full* workload cluster name (`teleport.giantswarm.io-myinstallation-myworkloadcluster`).
* Starts port-forwarding for Prometheus using the *management cluster* context (`teleport.giantswarm.io-myinstallation`) to `localhost:8080`.
* Starts port-forwarding for Grafana using the *management cluster* context (`teleport.giantswarm.io-myinstallation`) to `localhost:3000`.
* Starts port-forwarding for Alloy metrics using the *workload cluster* context (`teleport.giantswarm.io-myinstallation-myworkloadcluster`) to `localhost:12345`.
Expand All @@ -153,17 +158,19 @@ When running `envctl connect`, the Terminal User Interface (TUI) provides a visu

| Key | Action |
|--------------|------------------------------------------|
| Tab | Navigate to next panel |
| Shift+Tab | Navigate to previous panel |
| Tab / j / ↓ | Navigate to next panel |
| Shift+Tab / k / ↑ | Navigate to previous panel |
| q / Ctrl+C | Quit the application |
| r | Restart port forwarding for focused panel|
| s | Switch Kubernetes context |
| N | Start new connection |
| h | Toggle help overlay |
| L | Toggle log overlay |
| C | Toggle MCP config overlay |
| D | Toggle dark/light mode |
| z | Toggle debug information |
| Esc | Close help/log overlay |
| y | Copy logs/config (when in overlay) |
| Esc | Close help/log/config overlay |

For more details on the implementation and architecture of the TUI, see the [TUI documentation](docs/tui.md).

Expand Down Expand Up @@ -201,34 +208,51 @@ Now you can use TAB to complete cluster names:
envctl connect myinstallation <TAB> # Shows short names of workload clusters for myinstallation
```

## Flexible Configuration via YAML ⚙️

`envctl` supports a powerful YAML-based configuration system to customize its behavior, define new MCP servers, and manage port-forwarding rules. This allows you to tailor `envctl` precisely to your development needs.

Configurations are loaded in layers (default, user-global, project-specific), with later layers overriding earlier ones. You can manage global settings, define how MCP servers are run (as local commands or containers), and specify detailed port-forwarding rules, including dynamic Kubernetes context targeting (`"mc"`, `"wc"`, or explicit contexts).

For a detailed explanation of the configuration file structure, all available options, and comprehensive examples, please see the [**Flexible Configuration Documentation (docs/configuration.md)**](docs/configuration.md).

## MCP Integration Notes 💡

* After running `envctl connect`, services should be available at:
* Prometheus: `http://localhost:8080/prometheus` (context: Management Cluster)
* Grafana: `http://localhost:3000` (context: Management Cluster)
* Alloy Metrics: `http://localhost:12345` (context depends on your connection type):
* If you specified both a Management Cluster and a Workload Cluster, the Alloy Metrics port-forward uses the Workload Cluster context.
* If you specified only a Management Cluster, the Alloy Metrics port-forward uses that Management Cluster context.
* Ensure your `mcp.json` (e.g., `~/.cursor/mcp.json`) has the correct `PROMETHEUS_URL` for the Prometheus MCP server:
```json
{
"mcpServers": {
"kubernetes": {
"command": "npx",
"args": ["mcp-server-kubernetes"]
},
"prometheus": {
"command": "uv", // Or your specific command
"args": [ ... ], // Your specific args
"env": {
"PROMETHEUS_URL": "http://localhost:8080/prometheus"
}
}
// ... other servers ...
}
}
```
* You may need to **restart your MCP servers** or your IDE after running `envctl connect` for them to pick up the new Kubernetes context and Prometheus connection.
* `envctl connect` uses `mcp-proxy` to manage connections for the following predefined MCP services:
* **Kubernetes**: Proxied on `http://localhost:8001/sse` (underlying command: `npx mcp-server-kubernetes`)
* **Prometheus**: Proxied on `http://localhost:8002/sse` (underlying command: `uvx mcp-server-prometheus`, expects Prometheus port-forward on `localhost:8080` via `PROMETHEUS_URL` env var)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* **Prometheus**: Proxied on `http://localhost:8002/sse` (underlying command: `uvx mcp-server-prometheus`, expects Prometheus port-forward on `localhost:8080` via `PROMETHEUS_URL` env var)
* **Prometheus**: Proxied on `http://localhost:8002/sse` (underlying command: `uvx prometheus-mcp-server`, expects Prometheus port-forward on `localhost:8080` via `PROMETHEUS_URL` env var)

* **Grafana**: Proxied on `http://localhost:8003/sse` (underlying command: `uvx mcp-server-grafana`, expects Grafana port-forward on `localhost:3000` via `GRAFANA_URL` env var - this is started if you have a Grafana MCP server with this name and command).
* `envctl` no longer reads `~/.cursor/mcp.json` to determine how to start these servers. The commands listed above are hardcoded.
Copy link
Member

Choose a reason for hiding this comment

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

This makes no sense

Suggested change
* `envctl` no longer reads `~/.cursor/mcp.json` to determine how to start these servers. The commands listed above are hardcoded.

* You must have `mcp-proxy` installed and the respective underlying MCP server executables (e.g., `mcp-server-kubernetes`, `mcp-server-prometheus`) available in your system's PATH.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* You must have `mcp-proxy` installed and the respective underlying MCP server executables (e.g., `mcp-server-kubernetes`, `mcp-server-prometheus`) available in your system's PATH.
* You must have `mcp-proxy` installed and the respective underlying MCP server executables (e.g., `mcp-server-kubernetes`, `mcp-grafana`) available in your system's PATH.

* **IDE Configuration (Cursor/VSCode):** Update your IDE's MCP settings to point to these SSE endpoints:
* Kubernetes: `http://localhost:8001/sse`
* Prometheus: `http://localhost:8002/sse`
* Grafana: `http://localhost:8003/sse` (if you use a Grafana MCP server)
* Port-forwarded services (like Prometheus on `localhost:8080` and Grafana on `localhost:3000`) are started by `envctl` as before. The `mcp-proxy` instances for Prometheus and Grafana will use these via environment variables.
* You may need to **restart your IDE** after running `envctl connect` and configuring these `mcp-proxy` SSE endpoints for changes to take effect.

### Customizing MCP Server Configuration

If you need to customize how MCP servers are run, you can use environment variables to override the default configurations:

* Each MCP server's configuration can be customized using environment variables with the pattern:
* `ENVCTL_MCP_<SERVER>_COMMAND`: Override the command (e.g., `ENVCTL_MCP_PROMETHEUS_COMMAND=uvx`)
* `ENVCTL_MCP_<SERVER>_ARGS`: Override the command arguments (e.g., `ENVCTL_MCP_PROMETHEUS_ARGS="mcp-server-prometheus --debug"`)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* `ENVCTL_MCP_<SERVER>_ARGS`: Override the command arguments (e.g., `ENVCTL_MCP_PROMETHEUS_ARGS="mcp-server-prometheus --debug"`)
* `ENVCTL_MCP_<SERVER>_ARGS`: Override the command arguments (e.g., `ENVCTL_MCP_PROMETHEUS_ARGS="prometheus-mcp-server --debug"`)

* `ENVCTL_MCP_<SERVER>_ENV_<KEY>`: Set an environment variable for the command (e.g., `ENVCTL_MCP_PROMETHEUS_ENV_PROMETHEUS_URL=http://localhost:9090`)

For example, to use a custom Prometheus MCP server installation:

```bash
export ENVCTL_MCP_PROMETHEUS_COMMAND="python3"
export ENVCTL_MCP_PROMETHEUS_ARGS="-m custom_prometheus_mcp_server"
export ENVCTL_MCP_PROMETHEUS_ENV_PROMETHEUS_URL="http://localhost:9090"
export ENVCTL_MCP_PROMETHEUS_ENV_DEBUG="true"

# Then run envctl as usual
envctl connect myinstallation
```

These environment variables will be detected automatically at startup, allowing you to customize the MCP server configurations without modifying the source code.

## Future Development 🔮

Expand Down
Loading