Skip to content

Add enterprise config-dir sync (config-as-code) and ConfigFile tracking#167

Open
duaraghav8 wants to merge 1 commit intomainfrom
codex/load-entity-configurations-from-directory
Open

Add enterprise config-dir sync (config-as-code) and ConfigFile tracking#167
duaraghav8 wants to merge 1 commit intomainfrom
codex/load-entity-configurations-from-directory

Conversation

@duaraghav8
Copy link
Member

Motivation

  • Provide configuration-as-code for MCPJungle by loading desired-state entity configs from a directory (default ~/.mcpjungle).
  • Ensure config-managed entities are reflected in the DB and in-memory state and kept in sync live when files change.
  • Track which entities are managed via files (vs created by CLI/API) so only those are reconciled by the sync manager.
  • Enable this behavior only in enterprise mode to limit scope to enterprise deployments.

Description

  • Introduces a ConfigFile model to track config-managed files and adds auto-migration for it (internal/model/config_file.go, internal/migrations/migration.go).
  • Adds a configsync.Manager that loads JSON files from ~/.mcpjungle subdirectories (mcp_servers, mcp_clients, tool_groups, users), applies desired state via existing services, watches for changes with fsnotify, debounces events, and prunes removed files (internal/service/configsync/manager.go).
  • Adds config-driven upsert helpers for MCP clients and users so file configs can create/update entities (internal/service/mcpclient/mcp_client.go, internal/service/user/user.go).
  • Wires startup to enable the config sync manager in enterprise mode and cleanly stop it on shutdown, and adds github.com/fsnotify/fsnotify to go.mod (cmd/start.go, go.mod).

Testing

  • No automated tests were executed for this change.

Codex Task

@duaraghav8
Copy link
Member Author

addresses #142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant