Skip to content

CMP-241 Add credential prompts and feature flag check for AI Features#17

Open
jah-leanix wants to merge 4 commits intomainfrom
feature/CMP-241-conditionally-ship-agents.md
Open

CMP-241 Add credential prompts and feature flag check for AI Features#17
jah-leanix wants to merge 4 commits intomainfrom
feature/CMP-241-conditionally-ship-agents.md

Conversation

@jah-leanix
Copy link
Contributor

Introduce checks for credentials (host, API token, and proxy) during initialization.
Implement a feature flag check to determine if custom report mcp tools are enabled in the LeanIX workspace.
Conditionally deliver the AGENTS.md.

@jah-leanix jah-leanix requested a review from a team as a code owner February 17, 2026 16:08
Copy link

@mal-leanix mal-leanix left a comment

Choose a reason for hiding this comment

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

Thoroughly tested locally, works nicely, file is included when ff is enabled, ignored when disabled ✅

Left two comments, one that we should include about the missed symlink CLAUDE.md, the other a nicer way to include the user, when we run into a problem.

Hope the comments make sense.

}

// Check feature flag from LeanIX workspace
mcpCustomReportsEnabled = await checkFeatureFlag({

Choose a reason for hiding this comment

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

What if we added some graceful failing here, because if this check fails, due to some network error, or any other reason, the scaffolding fails, and the user gets no feedback. We could include:

Suggested change
mcpCustomReportsEnabled = await checkFeatureFlag({
try {
mcpCustomReportsEnabled = await checkFeatureFlag({
host,
tokenResponse,
featureFlagId: 'mcpserver.custom-reports',
proxyURL
});
console.log(`✓ MCP custom reports ${mcpCustomReportsEnabled ? 'enabled' : 'disabled'} for this workspace`);
} catch (error) {
console.log(`${red('⚠')} Could not check feature flags: ${error instanceof Error ? error.message : 'Unknown error'}`);
console.log('AGENTS.md will not be included in the generated project.\n');
mcpCustomReportsEnabled = false;
}

const templateFiles = readdirSync(templateDir);
for (const file of templateFiles /* .filter(f => f !== 'package.json') */) {
// Skip AGENTS.md if MCP custom reports feature is not enabled
if (file === 'AGENTS.md' && !mcpCustomReportsEnabled) {

Choose a reason for hiding this comment

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

We might have to also include the symlink CLAUDE.md file here

Suggested change
if (file === 'AGENTS.md' && !mcpCustomReportsEnabled) {
if ((file === 'AGENTS.md' || file === 'CLAUDE.md') && !mcpCustomReportsEnabled) {

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.

2 participants

Comments