Skip to content

Conversation

@jonaslagoni
Copy link
Contributor

@jonaslagoni jonaslagoni commented Jan 18, 2026

Note

Introduces an MCP server for The Codegen Project with HTTP endpoint and supporting assets.

  • Adds app/api/mcp/route.ts exposing tools: create_config, add_generator, list_generators, validate_config, get_usage_example, get_imports; registers codegen://docs* resources and a codegen-guidelines prompt
  • Implements tool logic and data in lib/tools/*, lib/data/* and bundles docs in lib/resources/bundled-docs.ts
  • Adds minimal Next.js UI (app/page.tsx, layout.tsx, not-found.tsx) and config (next.config.js, eslint.config.mjs), plus project README.md and .gitignore

Written by Cursor Bugbot for commit 730205f. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Jan 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
the-codegen-project Ready Ready Preview, Comment Jan 18, 2026 1:25pm
the-codegen-project-mcp Error Error Jan 18, 2026 1:25pm

@netlify
Copy link

netlify bot commented Jan 18, 2026

Deploy Preview for the-codegen-project canceled.

Name Link
🔨 Latest commit 730205f
🔍 Latest deploy log https://app.netlify.com/projects/the-codegen-project/deploys/696cdf37e51a5f0008a50e36

@jonaslagoni jonaslagoni merged commit 4b3e121 into main Jan 18, 2026
12 of 16 checks passed
@jonaslagoni jonaslagoni deleted the enable_mcp branch January 18, 2026 13:26
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

\`\`\`

${deps}`;
}).join('');
Copy link

Choose a reason for hiding this comment

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

Examples joined without separator breaks markdown formatting

Low Severity

When the get_usage_example tool returns multiple examples, they're joined with an empty string via .join(''). Each example template ends with ${deps} (dependencies or empty string) and the next starts with ## ${example.title}. Without a proper separator like '\n\n', the Markdown heading of the second example runs directly into the first example's content, breaking the heading formatting and making the output difficult to read.

Fix in Cursor Fix in Web

const entries = Object.entries(g)
.map(([key, value]) => {
if (typeof value === 'string') {
return ` ${key}: '${value}'`;
Copy link

Choose a reason for hiding this comment

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

Unescaped strings in generated config produce invalid output

Low Severity

The generateMjsConfig function wraps string values in single quotes without escaping embedded single quotes (lines 137, 152). If inputPath or outputPath contains a ' character (e.g., ./test's/spec.yaml), the generated JavaScript is syntactically invalid. Similarly, generateYamlConfig directly interpolates strings without quoting (lines 173, 184), so paths containing # or : produce invalid YAML where content after # becomes a comment.

Additional Locations (2)

Fix in Cursor Fix in Web

// Check if preset is valid
if (!generators[preset]) {
errors.push(`Generator at index ${i}: unknown preset "${preset}"`);
} else if (inputType && !availablePresets.includes(preset)) {
Copy link

Choose a reason for hiding this comment

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

validateConfig crashes on invalid inputType values

Medium Severity

The validateConfig function crashes when config.inputType is a truthy but invalid value (e.g., "invalid"). Line 364-365 adds an error for invalid inputType but continues processing. At line 380, inputTypeGenerators[inputType] returns undefined for invalid types. Then at line 391, the condition inputType && !availablePresets.includes(preset) calls .includes() on undefined, throwing a TypeError. A validation function shouldn't crash on invalid input.

Fix in Cursor Fix in Web

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