Skip to content

Add MCP server integration instructions and update Copilot guidance#4494

Merged
DavidHuber-NOAA merged 11 commits intoNOAA-EMC:developfrom
TerrenceMcGuinness-NOAA:update_copilot_instructions
Feb 25, 2026
Merged

Add MCP server integration instructions and update Copilot guidance#4494
DavidHuber-NOAA merged 11 commits intoNOAA-EMC:developfrom
TerrenceMcGuinness-NOAA:update_copilot_instructions

Conversation

@TerrenceMcGuinness-NOAA
Copy link
Collaborator

@TerrenceMcGuinness-NOAA TerrenceMcGuinness-NOAA commented Jan 29, 2026

Separate MCP Instructions from Copilot Instructions

Summary

This PR refactors the GitHub Copilot instructions by separating MCP-specific guidance into its own file with conditional loading. MCP tool execution instructions are only available to development agents — not exposed to PR review agents.

Since the original PR was opened, the MCP server has evolved significantly: tool count grew from 35 → 48, the knowledge base expanded 4×, and a full GraphRAG layer with session state tracking was added. This PR now includes all instruction file updates through v7.21.0.

Resolves #4578

Key Design Decision: Separation of MCP Instructions

MCP-specific instructions live in .github/instructions/mcp.instructions.md with:

  • applyWhen: hasActiveMCPServer("eib-mcp-rag-full") — only loads when the MCP server is connected
  • excludeAgent: "code-review" — PR review agents never see MCP tool guidance

This ensures:

  • PR Review Agents (GitHub Copilot code review) are NOT exposed to MCP tool execution guidance
  • Development Agents (VS Code Copilot, Copilot CLI, Claude Desktop) GET full MCP tool access with correct parameter names
  • ~35% context window reduction for standalone global-workflow use (no MCP server)
  • Prevents PR review agents from attempting to invoke MCP tools they don't have access to

Changes

  • New: .github/instructions/mcp.instructions.md — MCP server tool guide (v7.21.0, 48 tools, excluded from code-review agent)
  • Updated: .github/copilot-instructions.md — Removed MCP details, added guidance to check for MCP tool availability

What's Included

MCP Server Integration (v7.21.0)

  • 9 tool modules with 48 total tools
  • RAG-powered semantic search across 63,837 indexed documents (5 ChromaDB collections)
  • Neo4j code graph analysis (41,355 nodes, 589,396 relationships)
  • GraphRAG with Graph-Guided Semantic Retrieval (GGSR) and hierarchical communities (1,036 nodes across 4 levels)
  • Session state tracking for agent workflows (checkpoints, modification tracking, examined symbol deduplication)
  • EE2 compliance validation with Phase 2 SME-corrected anti-patterns
  • SDD workflow execution framework (38 phase specs, 12 completed sessions)

Tool Categories

Category Tools Purpose
Workflow Info 3 Static filesystem analysis (structure, configs, components)
Code Analysis 6 Neo4j graph traversal (dependencies, callers, execution chains)
Semantic Search 6 ChromaDB vector + graph hybrid queries
EE2 Compliance 5 NOAA NCO standards validation (SME-corrected)
Operational 4 HPC platform guidance and job script analysis
GraphRAG + Session State 9 GGSR context, architecture search, impact analysis, session tracking
GitHub Integration 4 Cross-repo issue/PR/dependency analysis
SDD Workflows 9 Spec-driven development session orchestration
Utility 2 Health check and server info

Parameter Naming Conventions

The instruction file documents exact required parameter names for each tool to prevent "must have required property" errors. Common patterns:

  • Graph tools use symbol (not node_name, function_name, etc.)
  • Search tools use query (not search_term, keyword, etc.)
  • Aliases supported for backward compatibility (e.g., node_namesymbol)

Commit History

Commit Description
8b597625 Initial: Add MCP server integration instructions
c309c32f Refactor for conditional MCP loading (applyWhen + excludeAgent)
2c9c8060 Fix GraphRAG tool parameter names in Required Param column
35bec79d Sync with v7.21.0 — add 4 Phase 24H-3 session state tools (48 total)

Benefits

  • AI agents can search 63,837 indexed documents across 5 collections (15/16 SPOT documentation sources)
  • Code dependency analysis across 41,355 graph nodes with 589,396 relationships
  • 1,036 hierarchical community nodes enable multi-resolution architecture queries
  • Automated EE2 compliance checking before commits (SME-validated, 85% false positive reduction)
  • Session state tracking enables cross-modality handoff between IDE and CLI agents
  • Context-aware explanations using Graph-Guided Semantic Retrieval (GGSR)

Testing

  • MCP health check: 7/7 components healthy
  • generate-tool-docs.js --check: 48/48 tools documented, 0 warnings
  • All tool modules operational across full/core/rag/github scenarios
  • Knowledge base validated with targeted GraphRAG queries
  • Instruction file aligned across all 3 locations (copilot-instructions.md, eib-mcp-tools.instructions.md, mcp.instructions.md)

- Add .github/instructions/mcp.instructions.md with EIB MCP-RAG Server v3.6.2 documentation
- Document 7 tool modules with 35 total tools for AI-assisted workflow analysis
- Include tool categories: Workflow Info, Code Analysis, Semantic Search, EE2 Compliance, Operational, GitHub Integration, and SDD Workflow
- Update copilot-instructions.md with MCP tool availability guidance
- Add RAG knowledge base source documentation (5 tiers)
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors repository Copilot guidance by moving MCP/RAG server integration details into a dedicated instructions file intended to be excluded from the code-review agent.

Changes:

  • Added a new .github/instructions/mcp.instructions.md document describing the MCP/RAG server tools and usage.
  • Removed the MCP/RAG server integration section from .github/copilot-instructions.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/instructions/mcp.instructions.md New MCP/RAG server integration + tool catalog, with front-matter attempting to exclude code-review agents.
.github/copilot-instructions.md Removes the embedded MCP/RAG server integration section from the main Copilot instructions.
Comments suppressed due to low confidence (1)

.github/copilot-instructions.md:435

  • The PR description says MCP tool execution guidance is separated out so PR review agents aren’t exposed to it, but .github/copilot-instructions.md still instructs the agent to check for MCP tool availability and to “Use GitHub MCP tools …” (see lines 3–7). If the intent is to keep MCP/tool-invocation guidance out of the code-review context, consider moving/rewording those remaining MCP references as well.
---
Remember: This is a production weather forecasting system. Changes must be thoroughly tested and should not disrupt operational workflows. Always follow the existing patterns and conventions when extending the system

aerorahul
aerorahul previously approved these changes Feb 3, 2026
Copy link
Contributor

@aerorahul aerorahul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am good with separating MCP instructions into its own.
IMO, the copilot-instructions.md is too prescriptive and strongly worded and we can address in a later PR with some discussion.

@DavidHuber-NOAA
Copy link
Contributor

@TerrenceMcGuinness-NOAA Copilot had some suggestions/comments on this PR. Can you please address and/or resolve those?

@TerrenceMcGuinness-NOAA
Copy link
Collaborator Author

@aerorahul Yes I notice some things are out-of-date in the current instructions file. I should cut a new one next week

)

- copilot-instructions.md: Remove MCP preamble (lines 3-9), add note that
  MCP guidance loads automatically when server is connected
- mcp.instructions.md: Change applyTo -> applyWhen: hasActiveMCPServer()
  so it only loads when EIB MCP-RAG server is active
- mcp.instructions.md: Update 34 tools/7 modules -> 42 tools/9 modules
- mcp.instructions.md: Fix SDD tools (remove execute_sdd_workflow /
  execute_sdd_workflow_supervised, add actual 9 SDD tools)
- mcp.instructions.md: Add missing tools (trace_full_execution_chain,
  extract_code_for_analysis, get_job_details, etc.)
- mcp.instructions.md: Update version v3.6.2 -> v7.20.0

SDD Phase 32: Instruction File Architecture
Resolves context window waste (~35% reduction for standalone use)
- Added Required Param column to GraphRAG table (code_or_symbol, symbol, from_symbol)
- Tool count 42 -> 44 to match live get_server_info output
Add 4 Phase 24H-3 session state tools to GraphRAG section:
mark_as_modified, get_session_context, checkpoint_state, restore_checkpoint
@TerrenceMcGuinness-NOAA TerrenceMcGuinness-NOAA added the Ready for review by CMs This PR has passed required testing and is now ready for review label Feb 24, 2026
@DavidHuber-NOAA DavidHuber-NOAA merged commit d7296db into NOAA-EMC:develop Feb 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready for review by CMs This PR has passed required testing and is now ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update and refine the AI instructions files so accommodated MCP tools and Copilot

4 participants