-
-
Notifications
You must be signed in to change notification settings - Fork 108
Context Provider Workflow Automation
Automate development workflows with intelligent pattern-based triggers
The MCP Context Provider enables workflow automation through intelligent pattern matching. By defining auto-retrieve patterns, you can create automatic reminders and context-aware triggers that prevent common development workflow mistakes.
This guide demonstrates how to use context provider patterns to automate complex workflows, using the release workflow automation as a practical example.
A common development workflow issue: You implement a feature, write tests, update documentation... but forget the release procedure. No version bumps, no CHANGELOG updates, no git tags.
Traditional approach: Manual checklists, hoping you remember every step.
Context provider solution: Automatic pattern-based reminders that trigger when specific conditions are detected.
Context provider patterns can detect specific development activities and trigger automatic memory retrieval with reminders:
{
"auto_retrieve_triggers": {
"release_procedure_reminder": {
"patterns": [
"added.*CLAUDE.md",
"documented.*v\\d+\\.\\d+\\.\\d+",
"implemented.*feature",
"feature complete",
"all tests passing",
"ready to ship",
"production ready"
],
"action": "retrieve_memory",
"tags": ["release-workflow", "procedure"],
"reminder_message": "⚠️ REMINDER: Complete release procedure!\n1. Bump version (__init__.py, pyproject.toml, uv lock)\n2. Update CHANGELOG.md\n3. Commit with semantic message\n4. Create annotated tag\n5. Push commit and tag\n6. Verify workflows\n7. Close related issues"
}
}
}
- Pattern Detection: Context provider monitors conversation for specific phrases
- Automatic Trigger: When patterns match (e.g., "feature complete"), memory retrieval activates
- Contextual Reminder: Displays checklist with all required steps
- Workflow Guidance: Prevents skipping critical procedures
Scenario: Developer implements semtools document ingestion feature
Developer: "Semtools integration complete, all tests passing"
↓
Context Provider: Detects "all tests passing" pattern
↓
System: Retrieves release workflow memory
↓
Display: "⚠️ REMINDER: Complete release procedure!
1. Bump version (__init__.py, pyproject.toml, uv lock)
2. Update CHANGELOG.md
..."
Result: Developer follows complete release procedure instead of skipping steps.
Identify a workflow that has multiple steps and is easy to forget:
- Release procedures (version bumps, changelogs, tags)
- PR review cycles (fix → comment → review → wait → repeat)
- Deployment checklists (build → test → deploy → verify)
- Documentation updates (code → docs → wiki → changelog)
List phrases that indicate the workflow should start:
For Release Workflow:
"feature complete"
"all tests passing"
"documented.*v\d+\.\d+\.\d+"
"ready to ship"
For PR Review Workflow:
"commented on PR"
"gemini review complete"
"PR updated"
Create a context file in MCP-Context-Provider/contexts/
:
{
"context_metadata": {
"name": "My Workflow Automation",
"version": "1.0.0",
"description": "Automates my development workflow",
"tool_category": "workflow",
"priority": "high"
},
"applies_to_tools": ["all"],
"auto_retrieve_triggers": {
"workflow_reminder": {
"patterns": [
"your pattern 1",
"your pattern 2"
],
"action": "retrieve_memory",
"tags": ["workflow-tag"],
"reminder_message": "Your checklist here"
}
}
}
Store the complete procedure in memory:
claude /memory-store "Release Procedure:
1. Bump version in __init__.py
2. Bump version in pyproject.toml
3. Run uv lock
4. Update CHANGELOG.md
5. Commit with semantic message
6. Create annotated tag
7. Push commit and tag
8. Verify GitHub Actions" --tags release-workflow,procedure
- Use a phrase that matches your pattern
- Verify the reminder appears
- Adjust patterns if needed
Location: contexts/mcp_memory_release_workflow_context.json
Triggers:
- Feature completion indicators
- Documentation updates
- Test completion phrases
Provides:
- Version bump checklist
- CHANGELOG reminder
- Git tag creation
- Workflow verification
Location: contexts/mcp_memory_release_workflow_context.json
Triggers:
"fixes #\d+"
"closes #\d+"
"merged PR"
Provides:
- Issue closure reminders
- PR-issue relationship tracking
- Smart closing comments
Create your own patterns for:
- Deployment procedures
- Security review checklists
- Performance testing workflows
- Documentation update cycles
✅ DO:
- Use specific, unique phrases that clearly indicate workflow state
- Include regex patterns for version numbers, issue IDs
- Test patterns with actual conversation phrases
- Keep reminder messages concise but complete
❌ DON'T:
- Use overly generic patterns that trigger too often
- Create patterns that overlap with other contexts
- Make reminder messages too long (keep under 10 lines)
✅ DO:
- Store complete procedures with step-by-step instructions
- Use consistent tags for easy retrieval
- Include context-specific examples
- Update memories when procedures change
❌ DON'T:
- Store incomplete or outdated procedures
- Use vague tags that overlap with other content
- Forget to version your workflow memories
- Pattern Complexity: Simple regex patterns have minimal overhead
- Trigger Frequency: Patterns should trigger only when needed
- Memory Size: Keep workflow memories focused and concise
- Context Priority: Set appropriate priority levels to avoid conflicts
- ✅ Never forget critical steps
- ✅ Consistent execution across team members
- ✅ Reduced human error
- ✅ Capture what works (and what doesn't)
- ✅ Build institutional knowledge
- ✅ Onboard new team members faster
- ✅ Automated reminders save mental overhead
- ✅ Context-aware suggestions reduce context switching
- ✅ Faster task completion with guided workflows
- ✅ Works seamlessly with Natural Memory Triggers
- ✅ Complements Claude Code's git awareness
- ✅ Zero performance impact with lightweight rule processing
Create patterns that trigger at different workflow stages:
{
"step_1_complete": {
"patterns": ["implemented feature"],
"reminder_message": "✅ Step 1 done. Next: Write tests"
},
"step_2_complete": {
"patterns": ["all tests passing"],
"reminder_message": "✅ Step 2 done. Next: Update docs"
},
"step_3_complete": {
"patterns": ["updated documentation"],
"reminder_message": "✅ Step 3 done. Next: Release procedure"
}
}
Use specific patterns for different scenarios:
{
"hotfix_release": {
"patterns": ["hotfix.*complete", "critical.*bug.*fixed"],
"reminder_message": "🔥 HOTFIX: Skip feature freeze, deploy immediately"
},
"standard_release": {
"patterns": ["feature.*complete", "sprint.*done"],
"reminder_message": "📦 RELEASE: Follow standard procedure"
}
}
Combine with git hooks and CI/CD:
- Pattern triggers context provider reminder
- Git hook validates version bump before commit
- CI/CD runs tests and deployment
- Context provider confirms completion
Check:
- Pattern syntax (valid regex)
- Conversation contains exact phrase
- Context provider is active (
mcp context status
) - Pattern doesn't conflict with other contexts
Check:
- Memory exists with correct tags
- Tags match pattern configuration
- Memory retrieval is enabled
- MCP memory service is running
Solution:
- Make patterns more specific
- Add word boundaries (
\b
) - Use negative lookaheads
- Increase pattern complexity
- Memory Hooks Complete Guide - Comprehensive memory integration reference
- Natural Memory Triggers - AI-based automatic memory retrieval
- Context Provider Documentation - Full context provider features
Here's the complete setup used in MCP Memory Service for automated release procedures:
{
"context_metadata": {
"name": "MCP Memory Release Workflow",
"version": "1.0.0",
"description": "Automated release procedure reminders",
"tool_category": "workflow",
"priority": "high"
},
"applies_to_tools": ["all"],
"auto_retrieve_triggers": {
"release_procedure_reminder": {
"patterns": [
"added.*CLAUDE.md",
"documented.*v\\d+\\.\\d+\\.\\d+",
"implemented.*feature",
"feature complete",
"all tests passing",
"ready to ship",
"production ready"
],
"action": "retrieve_memory",
"tags": ["release-workflow", "procedure"],
"reminder_message": "⚠️ REMINDER: Complete release procedure!\n1. Bump version (__init__.py, pyproject.toml, uv lock)\n2. Update CHANGELOG.md\n3. Commit with semantic message\n4. Create annotated tag\n5. Push commit and tag\n6. Verify workflows\n7. Close related issues"
}
}
}
claude /memory-store "MCP Memory Service Release Procedure:
**Version Bump (3 files)**:
1. src/mcp_memory_service/__init__.py - Update __version__
2. pyproject.toml - Update version field
3. Run: uv lock (sync dependencies)
**CHANGELOG Update**:
- Add new version section with date
- Document features, fixes, breaking changes
- Include performance metrics if applicable
**Git Workflow**:
1. Commit: git commit -m 'chore(release): bump version to vX.Y.Z'
2. Tag: git tag -a vX.Y.Z -m 'Release vX.Y.Z: description'
3. Push: git push && git push --tags
**Verification**:
- Check GitHub Actions: Docker Publish, Publish and Test, HTTP-MCP Bridge
- Close related issues with resolution comments
- Update project board if applicable" \
--tags release-workflow,procedure,mcp-memory-service
When a developer says "Feature complete, all tests passing", the system automatically:
- Detects the trigger phrase
- Retrieves the release procedure memory
- Displays the complete checklist
- Prevents accidental procedure skipping
Start automating your workflows today! Create your first context pattern and experience intelligent workflow guidance.