Use GitHub Copilot CLI in the terminal with the same agrivalue-iq MCP server as VS Code — no duplicate logic, same three tools:
| Tool | Purpose |
|---|---|
get_market_intelligence |
Fabric IQ pricing + compliance |
generate_supply_contract |
Fair-Trade contract draft |
evaluate_crop_quality |
Vision grade + profit multiplier |
- GitHub Copilot subscription (Free tier works with limits)
- Copilot CLI installed
- This repo cloned and dependencies installed:
git clone https://github.com/cdm227/AgriValue-Tracker.git
cd AgriValue-Tracker
npm installTerminal (copilot CLI) → .mcp.json → mcp-server.js → lib/iq-data.js
VS Code Copilot Chat → .vscode/mcp.json → (same server)
Repo-root .mcp.json is loaded automatically when you run Copilot CLI inside this project.
From the repo root:
npm run verify:mcpExpected output:
OK: AgriValue MCP server started (Fabric IQ synced)
Also confirm VS Code config still works:
npm run mcpYou should see on stderr: AgriValue MCP Server running on stdio (Fabric IQ synced) — press Ctrl+C to stop.
Follow the official guide: Install Copilot CLI
Quick check:
copilot --versionSign in if prompted (copilot auth or follow CLI prompts).
Important: run Copilot CLI from the repository root so .mcp.json is picked up.
cd AgriValue-Tracker
copilotInside the interactive CLI:
/mcp show
You should see agrivalue-iq listed.
Details and tools:
/mcp show agrivalue-iq
Expect three tools: get_market_intelligence, generate_supply_contract, evaluate_crop_quality.
If the server is missing:
/mcp reload
/mcp show
Or add manually (same as .mcp.json):
/mcp add
- Server Name:
agrivalue-iq - Type: Local / STDIO
- Command:
node mcp-server.js - Tools:
*
In Copilot CLI (interactive):
Use the agrivalue-iq MCP tools to get market intelligence for Olive Oil, then generate a Fair-Trade supply contract for 15 metric tons, organic/DOP enabled, buyer "Cooperativa Valle del Belice". Summarize Path A vs Path B added value.
One-shot from the shell (non-interactive):
copilot -p "Use agrivalue-iq get_market_intelligence for Olive Oil and generate_supply_contract for 15 tons organic with buyer Cooperativa Valle del Belice"Exact flags depend on your CLI version — run copilot --help if -p differs.
- Open
http://localhost:3000(or GitHub Pages demo) - Run IQ Pipeline → Olive Oil, 15 MT, organic
- Click Copy for Copilot MCP in the UI
- Paste the prompt into Copilot CLI instead of VS Code Chat
Same MCP tools, terminal instead of IDE.
| Surface | Config file | When to use |
|---|---|---|
| VS Code | .vscode/mcp.json |
IDE workflow, demo video cut to Copilot Chat |
| Copilot CLI | .mcp.json (repo root) |
Terminal, automation, headless dev |
Both call scripts/mcp-launcher.mjs → mcp-server.js → lib/iq-data.js.
The launcher sets the repo root as cwd so Copilot CLI can connect reliably.
Market intel:
@agrivalue-iq get_market_intelligence crop="Grapes"
Contract (after optimization):
@agrivalue-iq generate_supply_contract crop="Olive Oil" qtyTons=15 isOrganic=true buyer="Cooperativa Valle del Belice"
Add a force majeure clause for Sicilian harvest weather.
Quality before optimize:
@agrivalue-iq evaluate_crop_quality crop="Olive Oil"
| Command | Action |
|---|---|
/mcp show |
List all MCP servers |
/mcp show agrivalue-iq |
Tools for this repo |
/mcp reload |
Reload after config change |
/mcp disable agrivalue-iq |
Turn off for session |
/mcp enable agrivalue-iq |
Turn back on |
-
Run from repo root (where
.mcp.jsonlives):cd /mnt/c/Users/calog/AgriValue-Tracker # your clone path ls -la .mcp.json # must exist (use ls -a for dotfiles)
-
Smoke test without Copilot CLI:
npm install npm run verify:mcp npm run mcp:cli # should log: AgriValue MCP Server running on stdio — Ctrl+C to stop -
Reload MCP in Copilot CLI:
/mcp reload /mcp show agrivalue-iq -
Trust the folder — on first launch Copilot CLI may ask to trust the workspace; MCP from
.mcp.jsonloads only after trust. -
WSL vs Windows — run Copilot CLI in the same environment as Node:
- WSL:
which nodeandcopilotboth inside WSL - Windows: use PowerShell/CMD, not WSL
/mnt/c/...mixed with Windowscopilot.exe
- WSL:
-
Manual add (if
.mcp.jsonis not picked up):/mcp add- Name:
agrivalue-iq - Type: STDIO
- Command:
node scripts/mcp-launcher.mjs - Tools:
*
Or edit
~/.copilot/mcp-config.jsonwith the same entry (use absolute path toscripts/mcp-launcher.mjsif needed). - Name:
-
Fabric SQL in
.env— ifFABRIC_SQL_*is set but unreachable, the server still starts (sync runs in background). Remove or fix.envif startup is slow.
| Problem | Fix |
|---|---|
agrivalue-iq not in /mcp show |
Run CLI from repo root; ls -la .mcp.json |
| MCP server fails to start | npm run verify:mcp and npm run mcp:cli |
| Wrong crop / empty tools | Crops: Olive Oil, Grapes, Wheat, Coffee, Milk |
Plain ls hides config |
Use ls -a to see .mcp.json, .gitattributes, etc. |
MCP uses in-memory Fabric IQ demo data by default. Azure/Fabric env vars in .env are optional — same as the web app.
- COPILOT.md — VS Code + how Copilot built the project
- MICROSOFT_IQ.md — Fabric / Foundry / Work IQ
- DEMO_SCRIPT.md — 2-min judge video script