kgatilin/claude-workflow-example
If you are the rightful owner of claude-workflow-example and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Model Context Protocol (MCP) server allows AI agents to securely interact with external tools and services, providing standardized access to specific functionalities.
AI Coding Agent Workflow for MCP Server Development
This project showcases a structured coding agent workflow using Claude to implement a Model Context Protocol (MCP) server for Jira issue retrieval. It demonstrates how to leverage AI agents to streamline development through standardized commands and task management.
What is an MCP Server?
The Model Context Protocol (MCP) is a system that allows AI agents to securely interact with tools and services, giving Claude "hands" to work with your local files, GitHub repositories, databases, and external APIs. An MCP server provides standardized access to specific functionality - in this case, retrieving Jira issue information.
MCP servers enable AI agents to:
- Access real-time data from external services
- Perform actions on behalf of users through standardized interfaces
- Integrate with existing tools and workflows securely
- Provide context-aware assistance based on live data
How to Install Claude
Installation
Claude Code CLI is the command-line interface that enables AI-powered development workflows.
Prerequisites:
- Node.js 18.0.0 or higher
- 4GB RAM minimum
- Active internet connection
Installation:
npm install -g @anthropic-ai/claude-code
Platform Support:
- macOS: Works natively on macOS 10.15+
- Linux: Ubuntu 20.04+/Debian 10+ supported
- Windows: Requires WSL2 (Windows Subsystem for Linux)
Windows WSL Setup:
# Enable WSL
wsl --install
# Or use PowerShell installer
irm https://claude.ai/install.ps1 | iex
Official Documentation: Claude Code Setup Guide
Authentication Options
After installing Claude Code CLI, you need to choose how to authenticate and access Claude models:
Option 1: Subscription (Recommended for Regular Use)
- Fixed monthly cost with higher usage limits
- Most economical for frequent Claude Code usage (Pro or Max plans)
- Automatic authentication through Anthropic account
- Setup: Sign up at claude.ai and run
claude
to authenticate
Option 2: Direct API Access (Pay-per-Use)
- Pay only for what you use
- Good for occasional usage or testing
- Setup:
- Visit Anthropic Console
- Sign up/login to your account
- Navigate to Settings β API Keys
- Click "Create Key" and claim free credits ($5 for 14 days)
- Configure your environment:
export ANTHROPIC_API_KEY="your-api-key"
- Pricing:
- Input: $3-15 per million tokens (depending on model)
- Output: $15-75 per million tokens
Option 3: Enterprise Cloud Backends
Amazon Bedrock:
- Enterprise deployment with AWS infrastructure
- Claude Opus 4 and Sonnet 4 available
- Regions: US East/West, APAC, Europe
- Setup:
export CLAUDE_CODE_USE_BEDROCK=1 export AWS_REGION=us-east-1
- Documentation: Claude on Amazon Bedrock
Google Cloud Vertex AI:
- Enterprise deployment with GCP infrastructure
- Available through Vertex AI Model Garden
- Setup:
gcloud config set project YOUR-PROJECT-ID gcloud services enable aiplatform.googleapis.com export CLAUDE_CODE_USE_VERTEX=1
- Setup Guide: Claude on Google Vertex AI
- Official GCP Documentation: Anthropic Claude models on Vertex AI
- Required IAM role:
roles/aiplatform.user
Getting Started
First-time Setup: On first run, Claude Code will prompt for authentication:
claude
# Follow browser authentication flow for subscription/API
# Or ensure environment variables are set for cloud backends
Using Claude Code: Navigate to your project directory and launch Claude:
cd your-project-directory
claude
Claude Code provides an interactive terminal interface where you can:
- Ask questions about your codebase in natural language
- Request features to be built from descriptions
- Debug and fix issues by describing problems
- Navigate and understand complex codebases
Official Getting Started Guide: Claude Code Overview
How to Use the Workflow
This project implements a structured workflow with five main commands that guide you through implementing an MCP server from requirements to completion.
Command Sequence
This is a collaborative human-AI workflow, not automation. Each command must be manually invoked by you after reviewing the previous stage's output. The AI assistant accelerates development by 10x while you maintain complete control over when and how to proceed.
First, launch Claude Code in your project directory:
cd your-project-directory
claude
Then execute the workflow with human oversight at each stage:
# 1. Initialize task from backlog
/workflow:init_task @.agent/backlog/jira-get-issue-mcp.md
π Review & Decide: Examine the generated business requirements in 00_task.md
. Validate acceptance criteria, modify requirements if needed. When satisfied, run the next command.
# 2. Create implementation plan
/workflow:plan
ποΈ Review & Decide: Examine the technical plan in 01_implementation_plan.md
. Verify architecture decisions, assess complexity, adjust approach if needed. When the strategy looks good, proceed to implementation.
# 3. Implement the feature with TDD
/workflow:implement
β‘ Review & Decide: Test the implementation, run the code, verify functionality matches requirements. The AI builds fast, but you ensure it builds right. When ready, run the review.
# 4. Review implementation against requirements
/workflow:review [additional-focus-areas]
π Review & Decide: Evaluate the comprehensive review findings in 03_review.md
. If fixes are needed, run the fix command. If satisfied, you're done.
# 5. Fix any issues found in review (if needed)
/workflow:review_fix
β Review & Decide: Validate that fixes address the identified issues without introducing new problems. Repeat review cycle as needed.
Key Principles:
- Human judgment drives decisions - AI provides options, you choose the path
- Review every output - Fast generation requires careful validation
- Iterative improvement - Use feedback to refine results at each stage
- Quality gate enforcement - Don't proceed until each stage meets your standards
Command Descriptions
1. /workflow:init_task
- Task Initialization
Purpose: Transform brief backlog items into comprehensive business requirements
What it does:
- Creates a feature branch for the task
- Sets up standardized task folder structure (
/.agent/tasks/[task-name]/
) - Expands brief requirements into detailed user stories
- Researches external dependencies and current versions
- Creates comprehensive acceptance criteria
- Focuses exclusively on business requirements (what to build, not how)
Output: 00_task.md
with complete business requirements
Supporting Scripts:
.claude/scripts/init_task_setup.sh
- Creates feature branches, task directories, and stage tracking
2. /workflow:plan
- Implementation Planning
Purpose: Create detailed technical implementation plan with systems architecture approach
What it does:
- Analyzes task complexity (simple vs. complex)
- Designs system architecture with component relationships
- Creates mermaid diagrams for data/control flow
- Maps acceptance criteria to specific tests
- Defines implementation tasks in executable order
- Determines iteration strategy (single vs. multiple iterations)
Output: 01_implementation_plan.md
with detailed technical plan
3. /workflow:implement
- TDD Implementation
Purpose: Implement features using Test-Driven Development with minimal essential tests
What it does:
- Follows pragmatic TDD: test behavior, not implementation
- Writes one focused test per acceptance criteria
- Implements simplest code to pass tests
- Tracks progress with TodoWrite tool
- Creates working software incrementally
- Avoids over-engineering (YAGNI principle)
Output: Complete implementation with test coverage and 02_implementation_log.md
Supporting Scripts:
.claude/scripts/get_current_task_context.sh
- Extracts current task info from git branch and folder structure
4. /workflow:review [additional-review-focus]
- Quality Review
Purpose: Review implementation against task requirements and planned architecture
Arguments:
additional-review-focus
(optional): Specific areas to focus on during review (e.g., "security", "performance", "error handling")
What it does:
- Launches 5 parallel specialized review agents:
- Code Quality: maintainability, readability, idiomaticity
- Test Quality: coverage, clarity, behavior focus
- Architecture Alignment: compliance with planned design
- Acceptance Criteria: requirement fulfillment verification
- Security & Performance: vulnerability and bottleneck analysis
- Synthesizes findings into binary classification (Must Fix vs. Future Improvement)
- Verifies all acceptance criteria are met with corresponding tests
- Makes APPROVED/REQUIRES FIXES decision
Output: 03_review.md
with comprehensive assessment and decision
Supporting Scripts:
.claude/scripts/find_review_comments.sh
- Identifies unresolved review comments across the codebase.claude/scripts/get_current_task_context.sh
- Provides task context for review scope
5. /workflow:review_fix
- Issue Resolution
Purpose: Address blocking issues identified in review before proceeding
What it does:
- Focuses only on "Must Fix" issues that block requirements
- Implements targeted fixes without scope creep
- Re-runs verification tests
- Updates implementation log with fixes applied
Output: Updated code and 04_fixes_applied.md
Supporting Utility Commands
In addition to the main workflow commands, several utility commands are available:
/utility:new_command
- Create new custom slash commands
- Takes command name and purpose as arguments
- Follows Claude 4 prompt engineering best practices
- Automatically determines required tools and structure
/utility:improve_command
- Enhance existing slash commands
- Accepts feedback to improve command functionality
- Maintains consistency with established patterns
/utility:update_project_rules
- Update CLAUDE.md project guidelines
- Adds new rules or guidance while maintaining structure
- Ensures project-specific instructions are preserved
Slash Command Syntax
Slash commands use a frontmatter-based syntax with specific structure:
Frontmatter Format
---
allowed-tools: Read, Write, Bash, WebSearch
argument-hint: <command-name> <purpose>
description: Brief description of command purpose
model: claude-sonnet-4-0 # Specify model explicitly
---
Bash Command Integration
Commands can execute bash scripts using the !
prefix:
## Setup Context
!`.claude/scripts/init_task_setup.sh $ARGUMENTS`
File References
Reference documentation using the @
prefix:
Read @docs/mcp_app_guide.md for implementation patterns
Based on @.claude/snippets/agents-workflow.md
Argument Handling
Commands access arguments through variables:
- `$ARGUMENTS` - All arguments as single string
- `$1`, `$2`, etc. - Individual positional arguments
Command Organization
.claude/commands/
βββ workflow/ # Task workflow commands
β βββ init_task.md
β βββ plan.md
β βββ implement.md
β βββ review.md
β βββ review_fix.md
βββ utility/ # General utility commands
βββ new_command.md
βββ improve_command.md
βββ update_project_rules.md
Testing the MCP Server
Prerequisites
-
Environment Configuration Create a
.env
file in your project root:JIRA_BASE_URL=https://your-domain.atlassian.net JIRA_EMAIL=your-email@company.com JIRA_API_TOKEN=your-api-token
-
Jira API Token Setup
- Go to Atlassian Account Settings
- Click "Create API token"
- Copy the token to your
.env
file
Testing Methods
Method 1: MCP Inspector (Recommended)
The MCP Inspector provides a visual testing interface for MCP servers:
-
Build your MCP server:
npm run build
-
Start MCP Inspector:
npx @modelcontextprotocol/inspector node dist/index.js .env
-
Test in browser:
- Inspector runs on
http://localhost:6274
(client) andhttp://localhost:6277
(proxy) - Click "βΆοΈConnect" to connect to your MCP server
- Use the Tools tab to test
get_jira_issue
with valid issue keys (e.g., "PROJ-123") - Verify responses contain summary, description, status, and assignee fields
- Test error handling with invalid issue keys
- Inspector runs on
Features:
- Interactive testing of Resources, Prompts, and Tools
- Real-time connection status
- Visual schema validation
- Session tokens for security
Method 2: Claude Code MCP Configuration
Configure Claude Code to use your MCP server locally:
-
Build your MCP server:
npm run build
-
Add MCP server to Claude Code:
# Using CLI command (recommended) claude mcp add jira-server --scope local -- node dist/index.js .env # Or create .claude.json manually: { "mcpServers": { "jira": { "command": "node", "args": ["dist/index.js", ".env"] } } }
-
Restart Claude Code and test:
claude # In conversation: "Get me details for Jira issue PROJ-123"
Configuration file locations:
- Primary:
.claude.json
in project directory (local scope) - Alternative:
~/.claude.json
(global scope)
Method 3: VS Code MCP Configuration
Configure VS Code with GitHub Copilot Chat extension:
-
Install GitHub Copilot Chat extension from VS Code marketplace
-
Add MCP server configuration:
# Use Command Palette: "MCP: Add Server" # Or create .vscode/mcp.json manually: { "mcpServers": { "jira": { "command": "node", "args": ["dist/index.js", ".env"] } } }
-
Enable MCP in settings:
- Open VS Code settings
- Enable
Chat > Mcp > Discovery
- Enable
Chat > Mcp
-
Test in VS Code:
- Open Copilot Chat panel
- Ask: "@jira get details for issue PROJ-123"
Configuration locations:
- Workspace:
.vscode/mcp.json
(project-specific) - Global: Use "MCP: Open User Configuration" command
Required Environment Parameters
Parameter | Description | Example |
---|---|---|
JIRA_BASE_URL | Your Jira instance URL | https://company.atlassian.net |
JIRA_EMAIL | Email associated with Jira account | developer@company.com |
JIRA_API_TOKEN | Jira API token for authentication | ATATT3xFfGF0... |
Verification Steps
-
Server starts successfully:
node dist/index.js .env # Should output: "MCP server running on stdio"
Note: The .env file path is required as the first argument.
-
Tool responds to valid input:
- Issue key format:
PROJ-123
(project key + hyphen + number) - Returns JSON with summary, description, status, assignee fields
- Issue key format:
-
Error handling works:
- Invalid issue keys return appropriate error messages
- Authentication failures provide clear feedback
- Network issues are handled gracefully
-
Response time acceptable:
- Requests complete within 5 seconds
- No timeout errors under normal conditions
Project Structure
βββ .agent/ # Agent workflow system
β βββ backlog/ # Task backlog items (submitted)
β βββ tasks/ # Task execution logs (not submitted)
β β βββ jira-get-issue-mcp/ # Example task documentation
β β βββ 00_task.md # Business requirements
β β βββ 01_implementation_plan.md # Technical plan
β β βββ 02_implementation_log.md # Implementation details
β β βββ 03_review.md # Quality review results
β β βββ stage.yaml # Workflow stage tracking
β βββ templates/ # Task templates (submitted)
βββ .claude/ # Claude Code configuration
β βββ commands/ # Slash command definitions
β β βββ workflow/ # Main workflow commands
β β βββ utility/ # Helper commands
β βββ scripts/ # Supporting bash scripts
β βββ snippets/ # Reusable code snippets
β βββ prompts/ # Prompt templates
βββ docs/ # Documentation
βββ CLAUDE.md # Claude Code instructions
βββ package.json # Node.js dependencies
βββ tsconfig.json # TypeScript configuration
βββ .env # Environment variables (local)
βββ README.md # This file
Note: This project showcases the workflow structure and commands. What gets submitted to the repository:
.agent/backlog/
- Task definitions.claude/commands/
- Workflow commands.claude/scripts/
- Supporting scripts- Documentation and configuration
What is generated during workflow execution (not submitted):
.agent/tasks/
- Task execution logssrc/
andtests/
- Actual implementation code
Getting Started
- Clone this repository to see the complete workflow example
- Install Claude using one of the methods above
- Run the workflow on your own backlog item:
# Create your backlog file echo "Build an MCP server for [your use case]" > .agent/backlog/my-task.md # Start the workflow /workflow:init_task @.agent/backlog/my-task.md
- Follow the command sequence to implement your own MCP server
- Test with MCP Inspector to verify functionality
This workflow demonstrates how AI coding agents can streamline development through structured processes, comprehensive planning, and quality assurance - all while maintaining focus on user requirements and business value.