How deepak-menan-r/jiraresolver works
Purpose and Runtime Entry Points
This is a Python 3.10+ agentic Jira resolver: given a Jira ticket ID, it discovers the relevant GitHub repository, proposes a fix, obtains human approval, then creates a PR and updates Jira. It runs as two local processes:
• Agent CLI: src/jira_resolver_mcp/__main__.py, src/jira_resolver_mcp/main.py
• MCP HTTP server: mcp_server/__main__.py, mcp_server/run.py
Agent Orchestration
LangGraph is the control-plane runtime. build_workflow() wires a stateful graph beginning with ticket intake and ending in either rejection, clarification, retry exhaustion, or GitHub operations.
• Graph and conditional routing: src/jira_resolver_mcp/workflow.py
• Per-stage logic: src/jira_resolver_mcp/nodes.py
• Cross-node state/checkpoint payload: src/jira_resolver_mcp/state.py
The graph pauses through a human-approval interrupt before any write to GitHub.
Ticket Intake and Repository Navigation
The ticket stage fetches Jira data, validates required details, extracts repository/file hints, marks the ticket Working, and terminates early for missing information. Navigation resolves a repo without a supplied URL: it lists accessible repositories, searches code across them, identifies the likely match, reads architecture files, searches within the target repository, ranks candidates, and loads source content.
• Agent stages: src/jira_resolver_mcp/nodes.py
• LLM-assisted extraction/selection: src/jira_resolver_mcp/llm_router.py
• Jira/repository server tools: mcp_server/tools_jira.py, mcp_server/tools_repo.py
Ambiguous repository selection is a boundary: the system posts a Jira clarification and waits rather than modifying code.
Planning, Implementation, and Review Loop
Once candidate file contents are in graph state, the planner produces an implementation plan. The implementer generates complete updated file contents, while the reviewer independently assesses the proposal. Rejected reviews increment retries and route back to implementation; acceptance requires reviewer confidence of at least 0.75 and transitions Jira to In Review.
• LLM interface and placeholder provider bodies: src/jira_resolver_mcp/llm_router.py
• Workflow stages/retry behavior: src/jira_resolver_mcp/nodes.py, src/jira_resolver_mcp/workflow.py
LLM integration is intentionally incomplete; configured OpenRouter and Google API credentials are expected future provider options.
Approval and GitHub Write Boundary
Human approval separates read/analysis operations from repository mutation. On approval, GitHub operations create a timestamped jira/<ticket>-... branch, apply generated file changes or patch, create a PR, checkpoint state for resume paths, post the PR URL to Jira, and mark the ticket PR Created.
• Approval and finalization stages: src/jira_resolver_mcp/nodes.py
• GitHub mutation handlers: mcp_server/tools_github.py
• Resume-oriented CLI flow: src/jira_resolver_mcp/main.py
MCP Service Boundary
The agent never calls Jira or GitHub directly. Its typed client wraps the MCP server’s single tool-dispatch API (POST /tools/call), while FastAPI registers and dispatches Jira, repository-discovery, and GitHub tools. Health and tool-list endpoints support local operation.
• Agent-side HTTP abstraction: src/jira_resolver_mcp/mcp_client.py
• FastAPI app/tool registry: mcp_server/app.py
• MCP server configuration: mcp_server/config.py
Infrastructure and External Services
The MCP server runs under Uvicorn/FastAPI, normally at http://localhost:8080. It requires Jira Cloud REST credentials and a GitHub PAT with repository access; repository discovery can be scoped to a GitHub organization or user. Environment-driven configuration covers service URLs, credentials, default branch, host/port, and optional LLM provider keys.
• Server process: mcp_server/run.py
• Agent configuration: src/jira_resolver_mcp/config.py
• Environment contract: .env.example
Main entry points: nodes.py Workflow stages · app.py Tool dispatch API · workflow.py LangGraph workflow · main.py Resume flow
Components 19
Agent process
Local LangGraph CLI runtime.
- Agent CLI
src/jira_resolver_mcp/__main__.py - Resume flow · Starts and resumes workflow runs.
src/jira_resolver_mcp/main.py - LangGraph workflow · Routes ticket resolution, review retries, and terminal outcomes.
src/jira_resolver_mcp/workflow.py - Workflow stages · Ticket, navigation, planning, review, approval, and finalization logic.
src/jira_resolver_mcp/nodes.py - Workflow state · Cross-stage state retained for approval and resume.
src/jira_resolver_mcp/state.py - LLM router · Extracts hints, selects repositories, plans, implements, and reviews.
src/jira_resolver_mcp/llm_router.py - Typed MCP client · Agent's sole Jira and GitHub access path.
src/jira_resolver_mcp/mcp_client.py - Agent configuration
src/jira_resolver_mcp/config.py
MCP server
Local HTTP tool boundary.
- MCP server process
mcp_server/__main__.py - Uvicorn runner · Runs FastAPI locally, normally on port 8080.
mcp_server/run.py - Tool dispatch API · Exposes POST /tools/call plus health and tool-list endpoints.
mcp_server/app.py - Server configuration
mcp_server/config.py - Jira tools · Fetches, updates, and clarifies tickets.
mcp_server/tools_jira.py - Repository discovery · Lists repositories and searches architecture, code, and source files.
mcp_server/tools_repo.py - GitHub mutation · Creates branch, applies changes, and opens pull requests.
mcp_server/tools_github.py
External services
- Jira Cloud
- GitHub
- Human approver · Must approve before repository writes.
- LLM providers · OpenRouter and Google credentials are supported as future options.
Connections 21
- Agent CLI → Resume flow: starts
- Resume flow → LangGraph workflow: runs or resumes
- LangGraph workflow → Workflow stages: executes stages
- LangGraph workflow → Workflow state: reads and checkpoints
- Workflow stages → LLM router: delegates extraction, planning, implementation, review
- Workflow stages → Typed MCP client: requests tools
- Workflow stages → Human approver: approval interrupt
- Human approver → Workflow stages: approval or rejection
- Agent configuration → Resume flow: configures
- LLM router → LLM providers: provider calls
- Typed MCP client → Tool dispatch API: POST /tools/call
- MCP server process → Uvicorn runner: starts
- Uvicorn runner → Tool dispatch API: serves
- Server configuration → Tool dispatch API: configures
- Tool dispatch API → Jira tools: dispatches
- Tool dispatch API → Repository discovery: dispatches
- Tool dispatch API → GitHub mutation: dispatches
- Jira tools → Jira Cloud: ticket reads and updates
- Repository discovery → GitHub: repository search and reads
- GitHub mutation → GitHub: branch, changes, PR
- Workflow stages → Workflow stages: review rejection retries implementation