Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Domain: AI Infrastructure
Inheritance: inheritable
Version: 1.2.0
Last Updated: 2026-03-10
⚠️ Staleness Watch (EXTERNAL-API-REGISTRY.md): MCP spec and SDK are actively versioned. SDK moved from 1.0.0 → 1.27.1 with 3 security fixes: cross-client data leak in shared instances (GHSA-345p-7cg4-v4c7), ReDoS (v1.25.2), command injection prevention (v1.27.1). New SDK features: task types, elicitation streaming, OAuth discovery/caching, fetch transport, conformance testing, framework-agnostic server refactoring. Streamable HTTP replaced HTTP+SSE for remote servers (spec 2025-03-26). Check MCP Changelog and SDK Releases when advising on transport or SDK usage.
Overview
Complete guide to the Model Context Protocol (MCP)—an open standard for connecting AI assistants to external data sources and tools. Covers architecture, server development, client integration, and production deployment patterns.
What Is MCP?
The Problem MCP Solves
Before MCP:
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Claude │ │ ChatGPT │ │ Copilot │
└────┬────┘ └────┬────┘ └────┬────┘
│ │ │
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│Custom │ │Custom │ │Custom │
│Plugin A │ │Plugin A'│ │Plugin A"│
└─────────┘ └─────────┘ └─────────┘
(3 different implementations for same data source)
After MCP:
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Claude │ │ ChatGPT │ │ Copilot │
└────┬────┘ └────┬────┘ └────┬────┘
│ │ │
└───────────────┼───────────────┘
▼
┌────────────┐
│ MCP Server │ (One implementation, many clients)
└────────────┘
Core Concepts
Concept
Description
Host
AI application (Claude Desktop, VS Code, etc.)
Client
MCP client within the host, manages server connections
Single HTTP endpoint handles both request and streaming response
Network-accessible
Supports authentication (Bearer tokens)
Scalable (multiple clients)
Requires security hardening
⚠️ HTTP+SSE is deprecated. Old servers used POST /message + GET /sse. If you encounter an HTTP+SSE server, it is using the legacy transport. Prefer Streamable HTTP for all new remote servers.
Add proper error handling with user-friendly messages
Set up logging for debugging
Implement rate limiting for expensive operations
Add caching where appropriate
Write unit and integration tests
Document configuration requirements
Consider security (auth, sandboxing)
Tool vs Resource Decision
Use Tool When
Use Resource When
Action with side effects
Read-only data access
Requires input parameters
Static or template URI
Returns computed result
Returns stored content
May fail or have errors
Generally stable data
MCP Tool Handoff QA Decision Table (PL1)
MCP tool calls are inherently synchronous — the tool returns a result and the interaction ends. This creates the same silent-handoff failure mode as extension commands: a write operation succeeds mechanically but the caller never learns that semantic review is needed.
Review every MCP tool handler against this table:
#
Check
Pass
Fail
Action on Fail
1
Write tools gate on cross-project isolation — tools that write to AI-Memory or global scope enforce SK2 boundary
SK2 decision table rows evaluated before write
Direct write with no isolation check
Add SK2 gate; return structured warning if check fails
2
Read tools don't mutate — search/status tools have no side effects
Tool only reads files, returns data
Tool writes logs, creates files, or modifies state
Split into read tool + write tool; or explicitly document side effects
3
Error vs review distinction — tool result distinguishes "error" from "semantic review pending"
Result includes status: "review-required" when artifacts need LLM review
Only returns success or error; no handoff signal
Add semanticReviewRequired: true + reviewArtifact path to result schema
4
PII filter on outputs — tool results don't leak absolute paths with usernames or credentials
Paths are relative; no credentials in output
C:\Users\name\... paths or tokens in result JSON
Apply stripPII() before returning; use relative paths
5
Decision logging — write operations log to PE1 decision log
logPhase2Decision() called with tool name, action, rationale
Write completes with no audit trail
Integrate phase2-decision-log.cjs into tool handler
6
Input validation — tool validates all required fields before acting
Missing fields return descriptive error
Tool throws or returns empty result on bad input
Validate schema; return structured error with field requirements
7
Scope visibility — tool result includes scope metadata for caller's routing
Result includes scope: "project" or scope: "global"
Caller can't determine if result crosses project boundary
Add scope field to result schema
8
Backup before overwrite — tools that modify existing files preserve the original
.backup.md created before overwrite; path included in result
Original content lost on write
Create backup; include backupPath in result
Known findings in alex-cognitive-tools (v1.1.0):
alex_knowledge_save fails rows 1, 3, 5, 8 — writes directly to AI-Memory with no isolation check, no decision logging, no review signal, and no backup of existing content.
alex_health_check passes (read-only, no mutations).
alex_memory_search and alex_knowledge_search pass (read-only).
alex_architecture_status passes (read-only).
MCP Development skill — Building AI-accessible tools and data sources