How nguyenvanduocit/jira-mcp works
Project Type and Purpose
• It’s an open-source Go-based MCP connector/CLI for Atlassian Jira.
• It exposes a Model Control Protocol (MCP) interface over stdin/stdout (or Docker), translates incoming commands into Jira REST API calls, and returns structured JSON responses.
File Structure
• main.go + util/handler.go: the MCP server entrypoint and generic request router.
• tools/*.go: one file per Jira operation (issues, comments, sprints, transitions, etc.)—these are your “Command Handlers.”
• services/*.go: abstractions for core domain concepts (Atlassian host config, Jira service logic, HTTP client wrapper).
• .github/workflows, Dockerfile, justfile: CI/CD and build/deployment automation.
• go.mod/go.sum: dependency management.
README Insights
• Uses environment variables to configure ATLASSIAN_HOST, ATLASSIAN_EMAIL, ATLASSIAN_TOKEN.
• Runs as a standalone binary or Docker container.
• Integrates with AI assistants (e.g., Claude) by registering as an MCP server in Cursor.
Main Components
a. MCP Server / CLI Layer
– The “jira-mcp” binary (main.go) or Docker container entrypoint
– Listens on stdin/stdout for MCP messages
b. Command Handler Layer (tools package)
– Modules like jira_issue, jira_comment, jira_transition
– Parse command, validate input, call service methods
c. Service Layer (services package)
– atlassian.go: configuration & authentication
– jira.go: high-level business operations
– httpclient.go: generic HTTP client wrapper (retry, headers)
d. External System
– Atlassian Jira Cloud REST API
e. Configuration Store
– Environment variables (.env or Docker args)
f. CI/CD & Packaging (side annotation)
– GitHub Workflows, Dockerfile, justfile
Relationships and Data Flow
1. User/AI → MCP Server (stdin)
2. MCP Server → Command Handler (tools package)
3. Command Handler → Service Layer
4. Service Layer → HTTP Client → Jira REST API (HTTPS)
5. Response bubbles back through HTTP Client → Service → Handler → MCP Server → User/AI (stdout)
Architectural Patterns & Principles
• Layered architecture: clear separation of protocol (MCP), command parsing, business logic, and transport (HTTP).
• Single Responsibility: one tool file per Jira operation; one service file per domain slice.
• Environment-driven configuration for credentials and host.
• Containerization for portability (Docker).