Abid Ali Awan
Enhance README with detailed local setup instructions, clarify integration with MCP clients, and update code quality score description. Remove outdated sections and improve formatting for better readability.
d1e576c
import gradio as gr | |
from code_analyzer.analysis import code_analysis_report | |
from code_analyzer.scoring import code_analysis_score | |
# Create Gradio interfaces for code analysis | |
analysis_report_demo = gr.Interface( | |
fn=code_analysis_report, | |
inputs=gr.Textbox(label="Enter Code Here", lines=10), | |
outputs=gr.Textbox(label="Analysis Report", lines=10), | |
description="Generate a detailed code analysis report with top fixes. Please read the [documentation](https://huggingface.co/spaces/Agents-MCP-Hackathon/code-analysis-mcp/blob/main/README.md) for more details.", | |
) | |
code_score_demo = gr.Interface( | |
fn=code_analysis_score, | |
inputs=gr.Textbox(label="Enter Code Here", lines=10), | |
outputs=gr.JSON(label="Code Score"), | |
description="Generate a vulnerability, style, and quality code score. Please read the [documentation](https://huggingface.co/spaces/Agents-MCP-Hackathon/code-analysis-mcp/blob/main/README.md) for more details.", | |
) | |
# Create tabbed interface | |
demo = gr.TabbedInterface( | |
[analysis_report_demo, code_score_demo], | |
["🧐Code Analysis", "🥇Code Score"], | |
title="Code Scoring & Analysis MCP Server", | |
theme=gr.themes.Soft(), | |
) | |
if __name__ == "__main__": | |
# Launch the Gradio interface | |
demo.launch(share=False, mcp_server=True, debug=True) | |