Skip to content

MCP First Workflow Guide

Run the Business Document Classifier through Claude Code using G6's MCP tools. No code writing required.

Prerequisites

  • Claude Code connected to G6 MCP server (Setup)
  • A CSV file with labeled examples (or use the built-in sample)

What this first workflow proves

This walkthrough proves that G6 is connected through MCP, can discover relevant tools, can execute a starter workflow, and can return inspectable results. It is not a production-readiness certificate for every domain workflow. Navigator routes and composes registered components, but each target component still has its own input schema, dependencies, tier access, and maturity level.

For legal, medical, tax, finance, safety-critical, or other regulated work, treat first-pass outputs as drafting, research, or triage support until a qualified reviewer validates the workflow and results.

Durable background runs

Some MCP workflows, including Recursive Architect runs, can use adapt_rq for durable background execution. That durability is only active when Redis is reachable and an RQ worker is running on the target queue. For Recursive Architect, start a worker with:

python -m rq worker g6-architect --url redis://localhost:6379/0

If Redis or the worker is missing, G6 falls back to local in-process execution. Local fallback is fine for a first smoke test, but it will not keep running or resume automatically after the MCP process exits.

Step-by-step

Step 1: Verify connection

Ask Claude Code:

Use system_status to check G6 is running.

Expected: health status showing available components and services.

Step 2: Plan the workflow

Use guide_plan_workflow with goal "Classify support tickets into 5 categories 
(billing, technical_support, account_access, feature_request, complaint) 
using labeled examples from a CSV file"

G6 returns a structured plan with steps, components, and resource estimates.

Step 3: Understand available tools

Use guide_find_tool with query "evaluate classification accuracy"

G6 recommends align_evals and explains how to use it.

Step 4: Load and inspect data

Use invoke_component with component "adapt_pandas" and op "load_csv" 
and params {"path": "workflows/business_classifier/sample_data.csv"}

Returns data shape, column types, and category distribution.

Step 5: Decompose the goal

Use decompose_goal with goal "Build and evaluate a text classifier for 
support tickets" and context "5 categories, 50 examples, target 80% accuracy"

G6 decomposes into subtasks: data prep, harness build, evaluation, diagnosis, improvement.

Step 6: Run evaluation

Use cross_call_tool with block "align_evals" and op "infer" 
and params_json containing predictions and ground_truth arrays

Returns accuracy, precision, recall, F1 scores.

Step 7: Audit quality

Use self_training_audit with component "align_evals" 
and op "infer" and params matching your evaluation

Returns maturity tier, quality score, and improvement suggestions.

Step 8: Get improvement recommendations

Use nav_recommend with context "classification accuracy is 65%, 
target is 80%, main failures are ambiguous inputs and edge cases"

G6 suggests specific components and strategies for improvement.

Step 9: Run a pipeline

Use compose_and_run with steps:
  1. Load data (adapt_pandas)
  2. Evaluate (align_evals)  
  3. Get recommendations (nav_recommend)

Executes the full sequence in one call.

What you get

After completing these steps:

  • A clear picture of your data quality
  • Baseline classification metrics
  • Specific failure diagnosis
  • Actionable improvement recommendations
  • Component-level quality audit

Tips

  • Use guide_ask at any point to ask questions about what you're seeing
  • Use explain_component to understand what any component does before invoking it
  • Use gateway nav_health to check which services are available and whether you're in degraded mode. If you are invoking the Navigator component MCP directly, use nav_health_check.
  • The guide_how_to tool gives step-by-step instructions for any task

Learning Layer Caveats

If you use learning_build_dataset, learning_train, or learning_evaluate after this first workflow, keep these constraints visible:

  • A JSONL row needs task text plus either an expected answer or a rubric. Task text can be input, prompt, question, goal, task, or description. Expected-answer aliases include expected, answer, target, ground_truth, reference, and expected_output.
  • Pick the scorer to match the task. Use normalized_exact for exact labels, contains for substring checks, token_f1 for partial text overlap, and rubric or llm_judge for open-ended answers.
  • Rubric/LLM-judge scoring makes another model call per row. Keep the first dataset small, use clear criteria, and inspect failures before trusting the score.
  • Learning-layer training changes harness artifacts and theory prompts. It does not fine-tune model weights, and it may show no lift on saturated or ambiguous datasets.
  • Before a customer pilot or production workflow, run the gated live smoke test on the deployment machine with the same G6_WORKSPACE, model/provider, credentials, and environment:
$env:G6_WORKSPACE="C:\path\to\pilot-workspace"
$env:G6_LEARNING_LAYER_LIVE_SMOKE="1"
python -m pytest -q tests/mvp/learning_layer/test_live_llm_smoke.py

If this fails, the live backend path is not launch-ready. - Before using exported artifacts in a real workflow, evaluate them on held-out examples that were not used during training.

Next steps

  • Run the full self-training loop: self_training_audit_all followed by improvement cycles
  • Export results via the Web portal for stakeholder reporting
  • Try the REST API guide for programmatic automation