Skip to content

MCP Tool Preferences

Establishes explicit preferences for MCP tools over CLI equivalents. Ensures consistent, reliable tool usage when multiple paths exist.

active
IDE:
claude
codex
vscode
Version:
1.0.0
Owner:platform-engineering
mcp
tooling
best-practices
core

MCP Tool Preferences

When MCP tools are available, ALWAYS prefer them over CLI equivalents unless the user explicitly requests CLI usage.

Mandatory Requirements

RequirementRuleRationale
MCP FirstMUST prefer MCP tools over CLI equivalents when availableConsistent behavior
Pre-Flight ChecksMUST complete pre-flight requirements before operationsProper initialization
Error ReportingMUST report MCP tool failures clearly before trying CLIUser awareness
Auth VerificationMUST verify authentication before resource operationsPrevent auth failures
Structured OutputMUST use MCP for structured data retrievalAvoid parsing text

Prohibited Patterns

PatternProhibitionAlternative
CLI Over MCPNEVER use CLI when equivalent MCP tool existsUse MCP tool
Silent CLI FallbackNEVER silently switch from MCP to CLI on failureReport error, ask user
Assumed ExecutablesNEVER assume psql, gh, az are installedUse MCP equivalents
Python Path AssumptionNEVER assume python command worksUse get_python_executable_details
Skip Pre-FlightNEVER skip pre-flight checks for database/cloud opsComplete all required steps

Why MCP Tools First

  • Authentication handled: MCP connections manage credentials; CLI may require separate auth
  • Structured output: MCP returns typed data; CLI requires parsing text
  • User may not have CLI installed: psql, gh, az, kubectl are not guaranteed
  • Consistency: Same tool = same behavior across sessions

Tool Preference Matrix

TaskPREFER (MCP)AVOID (CLI)
PostgreSQL queriespgsql_connect, pgsql_query, pgsql_modifypsql
PostgreSQL schemapgsql_db_context, pgsql_visualize_schemapg_dump, \d commands
GitHub PR detailsgithub-pull-request_activePullRequestgh pr view
GitHub issuesgithub-pull-request_issue_fetchgh issue view
GitHub searchgithub-pull-request_formSearchQuery + doSearchgh search
Azure resourcesazure_resources-query_azure_resource_graphaz resource list
Azure authazure_auth-get_auth_contextaz account show
Python environmentconfigure_python_environmentAssume python works
Python packagesinstall_python_packagespip install directly
Git changesget_changed_filesgit diff (use for complex diffs)
File searchfile_search, grep_search, semantic_searchfind, grep
Code navigationlist_code_usagesgrep for symbol names

Pre-Flight Requirements

Before PostgreSQL Operations

  1. MUST call pgsql_list_servers to discover available connections
  2. MUST call pgsql_connect to establish connection
  3. MUST call pgsql_db_context before modifications to understand schema

Before Python Operations

  1. MUST call configure_python_environment first
  2. MUST use get_python_executable_details to get correct invocation
  3. Do NOT assume python or python3 is the correct command

Before GitHub Operations

  1. For current PR: MUST call github-pull-request_activePullRequest first
  2. For searches: MUST call github-pull-request_formSearchQuery before doSearch
  3. For issue details: Use github-pull-request_issue_fetch with issue number

Before Azure Operations

  1. MUST call azure_development-recommend_custom_modes for Azure-related requests
  2. For resource queries: Use azure_resources-query_azure_resource_graph
  3. Check auth context with azure_auth-get_auth_context if access issues arise

When CLI Is Appropriate

Use terminal commands when:

  • User explicitly requests CLI (e.g., "run gh pr create")
  • No MCP equivalent exists for the operation
  • MCP tool fails and CLI is a documented fallback
  • Operation requires interactive input that MCP cannot handle
  • Running build/test commands (npm test, make build, etc.)

Prohibited Patterns

Do NOT:

  • Run psql when pgsql_* tools are available
  • Run gh pr view when github-pull-request_activePullRequest exists
  • Run az commands for resource queries when ARG tools are available
  • Assume Python executable path without checking environment tools
  • Use grep for code symbol search when list_code_usages fits better

Error Recovery

If an MCP tool fails:

  1. Report the error clearly to the user
  2. Check if authentication/connection is the issue
  3. Offer CLI as explicit fallback: "The MCP tool failed. Would you like me to try using the CLI instead?"
  4. Do NOT silently switch to CLI

Tool Discovery

If unsure whether an MCP tool exists:

  1. Check the tools available in current context
  2. Prefer tools with structured parameters over freeform CLI
  3. When in doubt, ask: "I can do this via [MCP tool] or [CLI]. Which do you prefer?"

Related Assets

Example: Terraform Plan Review

experimental

Review Terraform plan output to identify risks, validate best practices, and provide actionable feedback before apply.

claude
codex
vscode
terraform
iac
review
best-practices

Owner: epic-platform-sre

Ansible Playbook Validator

active

Goal-oriented Ansible specialist that validates playbooks for syntax, idempotency, best practices, and compliance. Autonomously checks collections, roles, and AWX inventory sources. Use for comprehensive playbook validation before deployment.

vscode
ansible
playbook
validation
lint
best-practices
+2

Owner: platform-automation

Wall-E Workflow Designer (Optum)

experimental

Assist with designing, reviewing, and optimizing multi-agent Wall-E workflows and MCP integrations following Optum enterprise patterns.

vscode
wall-e
orchestration
multi-agent
mcp
optum

Owner: epic-platform-sre

Kratos Memory System Usage Guide

active

Guidelines for using Kratos MCP memory system for project-isolated persistent memory storage, retrieval, and full-text search in AI coding workflows.

claude
codex
vscode
kratos
mcp
memory
sqlite
fts5
+1

Owner: epic-platform-sre

MCP Server Development Standards (Optum)

experimental

Standards, patterns, and guardrails for building Model Context Protocol (MCP) servers compatible with Wall-E, VS Code Copilot, and enterprise systems.

claude
codex
vscode
mcp
sdk
wall-e
security
optum

Owner: epic-platform-sre

Project Constraints Awareness

active

Instructs agents to proactively understand project constraints from pre-commit configs, CI/CD workflows, and linting rules before creating or modifying files

claude
codex
vscode
constraints
pre-commit
linting
ci-cd
quality-gates
+1

Owner: thudak