# ganesanfocus/mcp_gmail_jira_claude architecture

> Architecture diagram of the GitHub repository ganesanfocus/mcp_gmail_jira_claude, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ganesanfocus/mcp_gmail_jira_claude
- Repository: https://github.com/ganesanfocus/mcp_gmail_jira_claude

## Overview

This repository is a browser-based Gmail/Jira assistant: a user submits chat requests, Flask passes them to a Gemini tool-calling agent, and selected MCP tools reach the configured mail or issue-tracking server. The servers query or update their external services and return results for the agent to summarize. The graph also shows the MCP connection layer and the separate legacy Gmail script. Server-to-service links follow the sampled server code; app-to-server wiring is documented in the README, while the Jira server’s configuration is dynamic.

Main entry points: [`mcp_client.py`](https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/mcp_client.py) (MCP connection manager), [`app.py`](https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/app.py) (Flask routes), [`templates/index.html`](https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/templates/index.html) (Chat page), [`gmail_mcp_server.py`](https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/gmail_mcp_server.py) (Gmail MCP tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Chat interface"]
  node_browser["Chat page<br/>[index.html]"]
  node_flask["Flask routes<br/>[app.py]"]
  node_legacy_app["Earlier client variant<br/>[app copy.py]"]
end

subgraph group_orchestration["Agent and MCP client"]
  node_agent["Tool-calling agent<br/>[app.py]"]
  node_tool_adapter["MCP tool adapter<br/>[app.py]"]
  node_manager["MCP connection manager<br/>[mcp_client.py]"]
end

subgraph group_integrations["Service integrations"]
  node_gmail_server["Gmail MCP tools"]
  node_jira_server["Jira MCP tools<br/>[jira_mcp_server.py]"]
  node_legacy_gmail["Legacy Gmail helper<br/>[gmail_mcp.py]"]
end

node_user(("User"))
node_gemini{{"Gemini model"}}
node_gmail_api{{"Gmail API"}}
node_jira_api{{"Jira API"}}

node_user -->|"submits request"| node_browser
node_browser -->|"POSTs chat"| node_flask
node_flask -->|"renders page"| node_browser
node_flask -->|"invokes"| node_agent
node_agent -->|"selects tools"| node_gemini
node_agent -->|"dispatches tool"| node_tool_adapter
node_tool_adapter -->|"calls tool"| node_manager
node_manager -->|"MCP calls"| node_gmail_server
node_manager -->|"MCP calls"| node_jira_server
node_gmail_server -->|"reads or drafts"| node_gmail_api
node_jira_server -->|"searches or comments"| node_jira_api
node_legacy_gmail -->|"reads messages"| node_gmail_api
node_legacy_app -->|"uses client"| node_manager

click node_browser "https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/templates/index.html"
click node_flask "https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/app.py"
click node_agent "https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/app.py"
click node_tool_adapter "https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/app.py"
click node_manager "https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/mcp_client.py"
click node_gmail_server "https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/gmail_mcp_server.py"
click node_jira_server "https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/jira_mcp_server.py"
click node_legacy_gmail "https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/gmail_mcp.py"
click node_legacy_app "https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/app%20copy.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_browser,node_flask,node_legacy_app,node_user toneBlue
class node_agent,node_tool_adapter,node_manager toneAmber
class node_gmail_server,node_jira_server,node_legacy_gmail,node_gmail_api,node_jira_api toneMint
class node_gemini toneIndigo
```

## Components

### Chat interface

- [Chat page](https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/templates/index.html): `templates/index.html`
- [Flask routes](https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/app.py): `app.py`
- [Earlier client variant](https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/app%20copy.py): `app copy.py`

### Agent and MCP client

- [Tool-calling agent](https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/app.py): `app.py`
- [MCP tool adapter](https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/app.py): `app.py`
- [MCP connection manager](https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/mcp_client.py): `mcp_client.py`

### Service integrations

- [Gmail MCP tools](https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/gmail_mcp_server.py): `gmail_mcp_server.py`
- [Jira MCP tools](https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/jira_mcp_server.py): `jira_mcp_server.py`
- [Legacy Gmail helper](https://github.com/ganesanfocus/mcp_gmail_jira_claude/blob/main/gmail_mcp.py): `gmail_mcp.py`

### Other components

- **User**
- **Gemini model**
- **Gmail API**
- **Jira API**

## Connections

- User → Chat page: submits request (evidence: `README.md`)
- Chat page → Flask routes: POSTs chat (evidence: `README.md`)
- Flask routes → Chat page: renders page (evidence: `app.py`)
- Flask routes → Tool-calling agent: invokes (evidence: `app.py`)
- Tool-calling agent → Gemini model: selects tools (evidence: `app.py`)
- Tool-calling agent → MCP tool adapter: dispatches tool (evidence: `app.py`)
- MCP tool adapter → MCP connection manager: calls tool (evidence: `app.py`)
- MCP connection manager → Gmail MCP tools: MCP calls (evidence: `README.md`)
- MCP connection manager → Jira MCP tools: MCP calls (evidence: `README.md`)
- Gmail MCP tools → Gmail API: reads or drafts (evidence: `gmail_mcp_server.py`)
- Jira MCP tools → Jira API: searches or comments (evidence: `jira_mcp_server.py`)
- Legacy Gmail helper → Gmail API: reads messages (evidence: `gmail_mcp.py`)
- Earlier client variant → MCP connection manager: uses client (evidence: `app copy.py`)
