MCP
An open standard protocol that lets LLM host applications connect uniformly and securely to external tools, databases, and data sources
Table of Contents
Structure Diagram
What is MCP?
An open standard protocol that lets LLM host applications connect uniformly and securely to external tools, databases, and data sources. It is a core concept in Agents & Protocols within AI / ML.
Core Principles
MCP (Model Context Protocol) is an open specification often described as "USB-C for AI applications." Previously, connecting M AI clients to N external tools (GitHub, Slack, Postgres, Jira) required building M × N bespoke integrations.
By standardizing a Host – Client – Server architecture over JSON-RPC 2.0, MCP collapses that integration matrix to M + N. Any MCP server exposes three core primitives to any compliant AI host:
- Tools: Model-invoked actions with structured schemas (run SQL, open a PR, create a ticket).
- Resources: Read-only contextual data (files, database schemas, live logs).
- Prompts: Reusable, server-defined prompt templates and workflows.
Practical Takeaways
- Enforce least privilege and human approval: Because MCP tools can mutate production state, separate read-only tools from destructive actions, scope credentials via OAuth/tokens, and require explicit user confirmation before irreversible writes.
- Prevent tool-schema context bloat: Attaching dozens of MCP servers with hundreds of verbose schemas eats up the context window and degrades tool-selection accuracy. Enable only task-relevant servers or adopt lazy tool discovery.
- Pick the right transport: Use
stdiofor lightweight local developer tools (filesystem, git, local DBs) and Streamable HTTP for remote, multi-user enterprise servers that need centralized auth and observability.
Notable Examples
- AI coding environments (Claude Code, Cursor, VS Code): Plugging in GitHub, Supabase, Sentry, and Linear MCP servers to inspect errors, query schemas, and ship fixes in one workflow.
- Enterprise data assistants: Wrapping internal APIs and warehouses once as MCP servers so any approved AI client can query them safely.
- Design & QA automation: Connecting Figma and Playwright MCP servers for automated visual regression checks and design-token extraction.
Practical Code Snippet
Copy and drop straight into your project{ "mcpServers": { "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" } } }}