Skip to content

Upgrade codegen MCP server - remove codemods, add docs #1162

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

Merged
merged 4 commits into from
Jun 30, 2025

Conversation

codegen-sh[bot]
Copy link
Contributor

@codegen-sh codegen-sh bot commented Jun 30, 2025

This PR upgrades the codegen mcp command as requested in CG-18866:

Changes Made

🧹 Cleanup

  • Removed all codemod-related functionality including:
    • ask_codegen_sdk tool
    • generate_codemod tool
    • improve_codemod tool
  • Removed legacy imports and dependencies
  • Deleted resource files:
    • system_prompt.py
    • system_setup_instructions.py
    • Removed entire resources/ directory
  • Updated server description to focus on API integration rather than codemods

🚀 Improvements

  • Added port display - MCP server now shows what port/transport it's running on when it starts
  • Enhanced startup messages with clear transport information

📚 Documentation

  • Added comprehensive MCP documentation at docs/integrations/mcp.mdx
  • Updated docs.json to include MCP in the integrations section
  • Covers installation, configuration, usage, and troubleshooting
  • Includes examples for Cline and Claude Desktop integration

🔧 Configuration

  • Cleaned up ruff.toml - removed exception for deleted system_prompt.py

Testing

  • ✅ MCP server imports successfully
  • ✅ CLI help command works correctly
  • ✅ All legacy codemod functionality removed
  • ✅ Documentation properly integrated

The MCP server now provides a clean, focused interface for AI agents to interact with Codegen platform APIs without the legacy codemod functionality.

Fixes CG-18866


💻 View my workAbout Codegen

- Remove all codemod-related functionality and legacy imports
- Remove ask_codegen_sdk, generate_codemod, and improve_codemod tools
- Delete system_prompt.py and system_setup_instructions.py resources
- Update server description to focus on API integration
- Add port information display when server starts
- Add comprehensive MCP documentation in docs/integrations/mcp.mdx
- Update docs.json to include MCP in integrations section
- Clean up ruff.toml configuration

The MCP server now focuses on Codegen platform API integration
rather than codemod generation, providing a cleaner interface
for AI agents to interact with Codegen services.
@codegen-sh codegen-sh bot requested review from codegen-team and a team as code owners June 30, 2025 14:02
Copy link
Contributor Author

codegen-sh bot commented Jun 30, 2025

I see a check failed - I'm on it! 🫡

💻 View my work

Copy link

codecov bot commented Jun 30, 2025

Codecov Report

Attention: Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/codegen/cli/mcp/server.py 0.00% 3 Missing ⚠️
src/codegen/cli/commands/mcp/main.py 0.00% 2 Missing ⚠️
src/codegen/git/clients/git_repo_client.py 50.00% 1 Missing ⚠️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor Author

codegen-sh bot commented Jun 30, 2025

I see a check failed - I'm on it! 🫡

💻 View my work

codegen-sh bot added 2 commits June 30, 2025 14:10
- Remove unused pytest import
- Fix f-string formatting for better readability
- Clean up empty __init__.py files
- Fix end-of-file formatting
- Fix type annotations to use X | Y syntax instead of Optional[X]
- Fix f-string usage in exception messages
- Fix datetime.min timezone issue by using datetime.UTC
Copy link
Contributor Author

codegen-sh bot commented Jun 30, 2025

✅ Fixed the failing pre-commit checks in commit 019822b.

The issues were ruff linting errors:

  • Fixed type annotations to use X | Y syntax instead of Optional[X]
  • Fixed f-string usage in exception messages
  • Fixed datetime.min timezone issue by using datetime.UTC

The pre-commit checks should now pass! 🎉

💻 View my work • React 👍 or 👎

The mcp[cli] package was listed as a dependency but not actually used in the codebase. The current MCP implementation uses fastmcp directly. This fixes the deptry dependency check failure.
Copy link
Contributor Author

codegen-sh bot commented Jun 30, 2025

✅ Fixed the failing check suite for PR #1162!

Issues Resolved:

🔧 Pre-commit failures - Fixed multiple linting and formatting issues:

  • Removed unused pytest import
  • Fixed f-string formatting for better readability
  • Cleaned up empty __init__.py files
  • Fixed end-of-file formatting

🗑️ Dependency cleanup - Removed unused mcp[cli]==1.9.4 dependency:

  • The package was listed in pyproject.toml but not actually used in the codebase
  • Current MCP implementation uses fastmcp directly
  • This fixed the deptry dependency check failure

Commits pushed:

  • 9f18d6b - Fix pre-commit linting issues
  • 4c87fba - Remove unused mcp dependency

All pre-commit checks should now pass! 🎉

💻 View my work • React 👍 or 👎

@jayhack jayhack merged commit d31e69a into develop Jun 30, 2025
16 of 18 checks passed
@jayhack jayhack deleted the codegen-cg-18866-codegen-mcp-upgrades branch June 30, 2025 14:24
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.

1 participant