c / README.md
kimhyunwoo's picture
Update README.md
14f1277 verified
metadata
title: The True C-Codestral IDE Agent
emoji: πŸš€
colorFrom: red
colorTo: red
sdk: gradio
sdk_version: 5.33.1
app_file: app.py
pinned: true
license: mit
tags:
  - agent-demo-track
  - mcp-server-track

πŸš€ The True C-Codestral IDE Agent

An intelligent, multi-step AI agent that transforms natural language instructions into compiled C code, acting as a complete, interactive C development environment.

Hackathon Track Hackathon Track

This project is a submission for the Agents & MCP Hackathon 2025, participating in both the Agentic Demo Showcase and the MCP Tool / Server tracks.


πŸŽ₯ Demo Video

C-Codestral Agent Demo Video (Click the image to watch the demo on YouTube)


✨ Core Features / 핡심 κΈ°λŠ₯

This agent is more than a simple code generator; it's a true AI development partner that understands and executes complex, sequential tasks.

  • 🧠 Multi-Step Agentic Workflow

    • EN: Understands and sequentially executes chained commands like "Refactor this code for readability, and then compile it."
    • KR: "μ½”λ“œλ₯Ό λ¦¬νŒ©ν† λ§ν•˜κ³ , κ·Έ λ‹€μŒμ— μ»΄νŒŒμΌν•΄μ€˜"와 같은 λ³΅μž‘ν•˜κ³  μ—°κ²°λœ λͺ…령을 μ΄ν•΄ν•˜κ³  순차적으둜 μž‘μ—…μ„ μˆ˜ν–‰ν•©λ‹ˆλ‹€.
  • πŸ€– Powered by Codestral

    • EN: Utilizes Mistral AI's latest specialized model for code, Codestral, to generate and analyze high-quality C code.
    • KR: Mistral AI의 μ΅œμ‹  μ½”λ“œ μ „λ¬Έ λͺ¨λΈμΈ Codestral을 μ‚¬μš©ν•˜μ—¬ μ •ν™•ν•˜κ³  ν’ˆμ§ˆ 높은 C μ½”λ“œλ₯Ό μƒμ„±ν•˜κ³  λΆ„μ„ν•©λ‹ˆλ‹€.
  • ⚑ On-the-Fly Compilation & Execution

    • EN: Instantly compiles and runs code using gcc on the backend. It provides real-time feedback on the console, including success status, output, or compilation errors.
    • KR: λ°±μ—”λ“œμ—μ„œ gccλ₯Ό 톡해 μ½”λ“œλ₯Ό μ¦‰μ‹œ μ»΄νŒŒμΌν•˜κ³  μ‹€ν–‰ν•©λ‹ˆλ‹€. 성곡 μ—¬λΆ€, κ²°κ³Ό, 컴파일 였λ₯˜κΉŒμ§€ μ‹€μ‹œκ°„μœΌλ‘œ μ½˜μ†”μ— ν‘œμ‹œν•˜μ—¬ μ™„λ²½ν•œ C 개발 κ²½ν—˜μ„ μ œκ³΅ν•©λ‹ˆλ‹€.
  • ↔️ Dual-Mode Interface

    • EN: Features both a conversational IDE Agent for users and MCP Tools API endpoints for other agents.
    • KR: μ‚¬μš©μžλ₯Ό μœ„ν•œ λŒ€ν™”ν˜• IDE Agent와 λ‹€λ₯Έ μ—μ΄μ „νŠΈλ“€μ΄ μ‚¬μš©ν•  수 μžˆλŠ” MCP Tools APIλ₯Ό λͺ¨λ‘ μ œκ³΅ν•©λ‹ˆλ‹€.
  • 🌍 Bilingual Instruction Support

    • EN: Capable of understanding and processing instructions given in both English and Korean.
    • KR: ν•œκ΅­μ–΄μ™€ μ˜μ–΄λ‘œ μž‘μ„±λœ λͺ…λ Ήμ–΄λ₯Ό λͺ¨λ‘ μ΄ν•΄ν•˜κ³  μ²˜λ¦¬ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

🎯 Hackathon Tracks Contribution / 해컀톀 νŠΈλž™ κΈ°μ—¬

This project makes clear contributions to two separate tracks.

πŸ€– Track 3: Agentic Demo Showcase

The IDE Agent tab is a complete demonstration of a powerful AI agent.

  1. Stateful Interaction: The agent maintains the code (state) throughout the conversation, building upon previous steps.
  2. Complex Command Parsing: It deconstructs user requests based on connectors like "and" or "then" to create a multi-step execution plan.
  3. Autonomous Tool Use: Based on its plan, the agent autonomously selects and uses its internal tools: generate_code, compile_and_run, and analyze_and_refactor.

These capabilities prove it is a true "agent," moving beyond the limitations of a simple chatbot.

πŸ”§ Track 1: MCP Tool / Server

The MCP Tools API tab demonstrates how a Gradio app can function as an MCP (Model Context Protocol) server.

  • Each function in this tab (Generate C Code, Compile & Run C Code, etc.) acts as a discrete API endpoint that can be called by any MCP client or other agents.
  • This exposes the agent's powerful C language processing capabilities as modular tools, allowing other AI services to easily integrate them.

πŸ› οΈ How It Works & Technical Details / 기술 μŠ€νƒ 및 μž‘λ™ 방식

  • Frontend: Built with Gradio to create a modern, interactive web UI. The interface is cleanly separated into two tabs for its distinct purposes (IDE and MCP).
  • LLM Backend: Leverages Mistral AI's Codestral-latest model via API calls to handle the core intelligence of code generation, analysis, and refactoring.
  • Execution Backend: Uses Python's subprocess module to run the gcc compiler in a secure environment, allowing it to feed actual C code execution results back to the user.
  • Agent Logic: The agent's core logic parses user commands with regular expressions to create a task queue. It then iterates through this queue, executing each task sequentially. Results and logs from each step are streamed to the user in real-time for full transparency.

πŸš€ How to Use / μ‚¬μš© 방법

  1. IDE Agent Tab:

    • EN: Write your C code in the C Code Editor on the left, or leave it empty to ask the agent to generate new code. In the Instruction box on the right, type your command in natural language (English or Korean), e.g., "Create a program that prints 'Hello World' and then run it." Click Execute. The agent will perform the tasks, stream its progress to the Console / Output, and update the code editor automatically if needed.
    • KR: μ™Όμͺ½μ˜ C Code Editor에 μ½”λ“œλ₯Ό μž‘μ„±ν•˜κ±°λ‚˜, λΉ„μ›Œλ‘κ³  μƒˆλ‘œμš΄ μ½”λ“œ 생성을 μš”μ²­ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 였λ₯Έμͺ½ Instruction λ°•μŠ€μ— μ›ν•˜λŠ” μž‘μ—…μ„ μžμ—°μ–΄(ν•œκ΅­μ–΄ λ˜λŠ” μ˜μ–΄)둜 μž…λ ₯ν•©λ‹ˆλ‹€. (예: "Hello Worldλ₯Ό 좜λ ₯ν•˜λŠ” μ½”λ“œλ₯Ό λ§Œλ“€κ³  μ‹€ν–‰ν•΄μ€˜"). Execute λ²„νŠΌμ„ λˆ„λ₯΄λ©΄ μ—μ΄μ „νŠΈκ°€ μž‘μ—…μ„ μˆ˜ν–‰ν•˜λ©° Console / Output에 μ§„ν–‰ κ³Όμ •κ³Ό μ΅œμ’… κ²°κ³Όλ₯Ό ν‘œμ‹œν•˜κ³ , ν•„μš”μ‹œ μ½”λ“œ νŽΈμ§‘κΈ° λ‚΄μš©μ„ μžλ™μœΌλ‘œ μ—…λ°μ΄νŠΈν•©λ‹ˆλ‹€.
  2. MCP Tools API Tab:

    • EN: This tab is designed for other agents or services to use this Space as an API. You can open each tool's accordion to test its functionality individually.
    • KR: 이 탭은 λ‹€λ₯Έ μ—μ΄μ „νŠΈλ‚˜ μ„œλΉ„μŠ€κ°€ 이 Spaceλ₯Ό API처럼 μ‚¬μš©ν•  λ•Œλ₯Ό μœ„ν•œ κ²ƒμž…λ‹ˆλ‹€. 각 도ꡬ(Tool) μ„Ήμ…˜μ„ μ—΄μ–΄ κ°œλ³„ κΈ°λŠ₯을 ν…ŒμŠ€νŠΈν•΄λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€.