# pawankumar94/jira_mcp_streamlit architecture

> Architecture diagram of the GitHub repository pawankumar94/jira_mcp_streamlit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pawankumar94/jira_mcp_streamlit
- Repository: https://github.com/pawankumar94/jira_mcp_streamlit

## Overview

##### Project Type & Purpose
- This project is a full-stack application with a single-page web interface built using Streamlit.
- It integrates with an MCP (Model Control Panel) server that provides tool-calling capabilities for Jira ticket operations.
- In addition to the web-based UI, there’s a command-line tool for direct interactions with the Jira system.

##### Analyzing the File Structure
- Key files include:
- streamlit_app.py: The main Streamlit application entry point that renders the UI.
- direct_jira_tool.py: A CLI script that provides direct ticket-related operations.
- debug_mcp.py & test_mcp_client.py: Scripts to debug or test the connection between the application and the MCP server.
- start_jira_assistant.sh & restart_streamlit.sh: Shell scripts to initiate or restart the application.
- requirements.txt and README.md: Indicate dependencies and provide an overview of usage.
- The absence of traditional separate “frontend” and “backend” directories means that while the UI (Streamlit) is client-facing, the application is designed as a cohesive monolithic solution that mixes interactive scripts with web interface operations.

##### Key Components & Their Interactions
a. Main Components to Include:
- Streamlit Frontend: The user interface that presents multiple tabs (Chat, Create Ticket, Search Tickets) for interacting with Jira.
- MCP Server: Acts as the middleware for tool-calling functions that manage interactions with Jira (e.g., ticket creation, search).
- Jira API: The external service that receives requests from the MCP server and processes ticket operations.
- CLI Tool: The direct_jira_tool.py script providing command-line access to create, search, and retrieve Jira tickets.
- Testing & Debug Modules: debug_mcp.py and test_mcp_client.py are used for troubleshooting connections and validating MCP integration.
- Environment & Configuration: Managed via the .env file (not included in the file tree but referenced) to support authentication with Jira.

b. Relationships and Data Flows:
- The Streamlit UI sends user interactions (ticket creation requests, searches, chat messages) to the MCP server.
- The MCP server then communicates with the Jira API, acting as an intermediary that encapsulates tool-calling logic.
- The CLI tool provides alternative interfaces to directly trigger similar operations as the Streamlit interface.
- Debug and test scripts interface directly with the MCP server to validate connectivity and functionality.

##### Architectural Patterns & Design Principles
- A clear separation between the presentation layer (Streamlit UI) and the service integration layer (MCP calls/Jira interactions).
- The design follows a modular approach where each script or module handles a distinct responsibility.
- Using command-line and web interfaces demonstrates design flexibility and separation of concerns.
- The use of environment variables, shell scripts, and dedicated testing modules reflects principles for deployment, configuration, and maintainability.

##### Detailed Steps for the Principal Software Engineer
- Testing/debug scripts connected to the MCP server to indicate that they monitor and verify the service functionality.
- Finally, consider including annotations that mention the relevant scripts or configuration dependencies (e.g., environment variables).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "User Interface Layer"
        A["Streamlit Web UI"]:::ui
    end

    subgraph "CLI and Deployment Tools"
        B["CLI Tool for Jira Ops"]:::cli
        C["Restart Streamlit"]:::script
        D["Start Jira Assistant"]:::script
    end

    subgraph "Service Integration Layer"
        E["MCP Server Integration"]:::service
        F["Debug MCP"]:::debug
        G["Test MCP Client"]:::debug
    end

    subgraph "External Services"
        H["Jira API Service"]:::external
    end

    %% Data Flow Connections
    A -->|"sendsRequests"| E
    B -->|"calls"| E
    F -->|"tests"| E
    G -->|"tests"| E
    E -->|"calls"| H
    C ---|"triggers"| A
    D ---|"triggers"| A

    %% Click Events
    click A "https://github.com/pawankumar94/jira_mcp_streamlit/blob/main/streamlit_app.py"
    click B "https://github.com/pawankumar94/jira_mcp_streamlit/blob/main/direct_jira_tool.py"
    click F "https://github.com/pawankumar94/jira_mcp_streamlit/blob/main/debug_mcp.py"
    click G "https://github.com/pawankumar94/jira_mcp_streamlit/blob/main/test_mcp_client.py"
    click C "https://github.com/pawankumar94/jira_mcp_streamlit/blob/main/restart_streamlit.sh"
    click D "https://github.com/pawankumar94/jira_mcp_streamlit/blob/main/start_jira_assistant.sh"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef service fill:#FFD700,stroke:#000,stroke-width:1px;
    classDef cli fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef external fill:#FFB6C1,stroke:#000,stroke-width:1px;
    classDef debug fill:#EE82EE,stroke:#000,stroke-width:1px;
    classDef script fill:#D3D3D3,stroke:#000,stroke-width:1px;
```
