Skip to content

Copilot Integration

Chris & Mike edited this page Apr 11, 2026 · 3 revisions

Copilot Integration — Cross-Agent Memory Bridge

Connect memory-journal-mcp to GitHub Copilot so IDE agents and Copilot share context through journal entries. Two agents, one shared memory.


How It Works

IDE Agent (AntiGravity/Cursor)  ←→  memory-journal-mcp  ←→  Copilot (GitHub)
         reads reviews via API        shared memory         reads context via MCP

Pattern 1 — Learn from Reviews

The IDE agent reads Copilot's PR review findings with get_copilot_reviews, creates copilot-finding journal entries, and suggests rule updates.

// 1. Fetch Copilot's review for a PR
const review = await get_copilot_reviews({ pr_number: 42 });

// 2. Create journal entry from findings
create_entry({
  content: "Copilot flagged missing null checks in src/utils.ts (line 15) and missing error handling in src/api.ts (line 42)",
  entry_type: "code_review",
  tags: ["copilot-finding", "null-safety", "error-handling"],
  pr_number: 42,
});

Pattern 2 — Pre-emptive Checking

Before writing code, the IDE agent searches past copilot-finding entries and applies those patterns proactively — avoiding the same review feedback.

// Before starting work on a file, check what Copilot has flagged before
const findings = await search_entries({
  query: "copilot-finding error-handling",
  tags: ["copilot-finding"],
});
// Agent applies discovered patterns to new code

Pattern 3 — Context-Aware Reviews

Copilot uses memory-journal-mcp as an MCP server during PR review, gaining access to project history, architectural decisions, and past review patterns.

Pattern 4 — Adversarial CLI Review (Pre-Push)

Instead of waiting for a remote PR review, agents can run local, pre-push evaluations using the GitHub Copilot CLI by leveraging the bundled github-copilot-cli skill.

By executing the copilot-audit workflow via GitHub Commander, the IDE agent will pipe your uncommitted diffs to Copilot, log its critique into memory-journal-mcp (as an audit_finding or triage entry), and pause for a required "Human-in-the-Loop" gateway, giving you the chance to fix the code before you push and invalidate continuous integration tests.


Setup: Copilot → Memory Journal (MCP Server)

Local MCP (VS Code / Copilot Chat)

Add to your workspace .vscode/mcp.json:

{
  "servers": {
    "memory-journal": {
      "command": "npx",
      "args": ["-y", "memory-journal-mcp"],
      "env": {
        "DB_PATH": "./memory-journal.db",
        "GITHUB_TOKEN": "${env:GITHUB_TOKEN}",
        "PROJECT_REGISTRY": "{\"my-repo\":{\"path\":\".\",\"project_number\":1}}"
      }
    }
  }
}

Remote MCP (HTTP Transport)

For Copilot Code Review or remote agents, deploy in HTTP mode:

npx memory-journal-mcp --transport http --port 3100

Then configure as a remote MCP server in your GitHub Copilot settings.

See HTTP Transport for full deployment options including Docker, OAuth, and stateless mode.


Setup: IDE Agent → Copilot Reviews

Enable Copilot Review Data in Briefing

Set the environment variable:

BRIEFING_COPILOT_REVIEWS=true

Or use the CLI flag:

--briefing-copilot

This aggregates Copilot review state across recent PRs into the memory://briefing resource, so agents are immediately aware of review patterns at session start.

Fetch Reviews for Any PR

Use get_copilot_reviews(pr_number) to fetch Copilot's findings:

get_copilot_reviews({ pr_number: 42 });

Output:

{
  prNumber: 42,
  state: "changes_requested",
  commentCount: 2,
  comments: [
    { body: "Consider adding null check here", path: "src/utils.ts", line: 15 },
    { body: "Missing error handling for async call", path: "src/api.ts", line: 42 }
  ]
}

See Tools Reference — get_copilot_reviews for full parameter documentation.


Recommended Workflow

  1. Enable briefing integration — Set BRIEFING_COPILOT_REVIEWS=true so every session starts with Copilot review awareness
  2. After each PR review — IDE agent fetches get_copilot_reviews and creates copilot-finding entries for recurring patterns
  3. Before starting work — Agent searches past copilot-finding entries and applies patterns proactively
  4. Periodic rule updates — When patterns repeat 3+ times, agent suggests codifying them as rules or skills

Security Note

When connecting memory-journal-mcp to Copilot:

  • Use read-only OAuth scopes (e.g., a read-level scope) and follow the principle of least privilege if OAuth is enabled
  • The journal database may contain project decisions, architecture notes, and code patterns — share only what's appropriate
  • Copilot's access follows your GitHub repository permissions

Related Pages


Next: Explore Git Integration or Tool Filtering.

Clone this wiki locally