← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

Model Context Protocol (MCP)

AI / ML PHP 8.0+ Advanced
debt(d8/e7/b5/t5)
d8 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'silent in production until users hit it' (d9), scored d8. The detection_hints flag automated:no and note only a code pattern observation: developers writing custom per-provider glue code instead of MCP. There are no static analysis tools, linters, or type checkers that catch this — a team can ship provider-specific integrations indefinitely without any tooling warning them they're duplicating effort. The misuse (missing auth, excessive permissions, unvalidated inputs) surfaces only in runtime behaviour or security incidents, not at build time.

e7 Effort Remediation debt — work required to fix once spotted

Closest to 'cross-cutting refactor across the codebase' (e7). The quick_fix says 'implement an MCP server to expose your PHP application's tools' — but doing so after the fact means replacing or wrapping all existing per-provider custom integrations (each provider's function-calling glue, auth, input validation) with a standardised MCP server. This is not a one-line patch; it's a cross-cutting rework touching every AI integration point, every tool handler, and potentially deployment configuration for HTTP-based servers.

b5 Burden Structural debt — long-term weight of choosing wrong

Closest to 'persistent productivity tax' (b5). MCP applies to web and CLI contexts and sits at the AI integration layer. Once a team commits to MCP (or fails to), every future AI tool addition is shaped by that choice — either they continue paying the per-provider duplication tax, or they carry the structural weight of maintaining the MCP server. The common_mistakes (stateful servers, missing auth, no input validation) impose ongoing maintenance burden across every tool added to the server.

t5 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'notable trap — a documented gotcha most devs eventually learn' (t5). The canonical misconception is explicit: 'MCP is only for Claude.' A competent developer encountering MCP through Claude documentation naturally but wrongly concludes it is Claude-proprietary, causing them to skip adopting an open standard that would save cross-provider effort. The common_mistakes (no auth on HTTP servers, treating LLM-generated args as trusted) are additional non-obvious traps that contradict intuition about internal tooling.

About DEBT scoring →

Also Known As

MCP tool use function calling AI tools

TL;DR

An open standard by Anthropic that defines how AI models connect to external tools and data sources — enabling LLMs to call APIs, read files, and query databases in a standardised way.

Explanation

MCP defines a client-server protocol where: MCP servers expose tools (functions the LLM can call), resources (data the LLM can read), and prompts (reusable prompt templates). MCP clients (Claude, IDE plugins, custom agents) connect to servers and make tools available to the LLM. The protocol uses JSON-RPC over stdio or HTTP/SSE. MCP servers can be written in any language — PHP can both consume MCP servers and act as an MCP server exposing PHP application data to AI agents.

Common Misconception

MCP is only for Claude — MCP is an open standard; any LLM client that implements the protocol can use MCP servers, and the ecosystem is growing across all major AI providers.

Why It Matters

MCP standardises AI tool integration — instead of writing custom function-calling glue code for every AI model and every tool, MCP servers work with any compliant AI client.

Common Mistakes

  • MCP servers with excessive permissions — an MCP server that can delete production data should require confirmation, not execute blindly.
  • Not validating tool inputs — MCP server tools receive LLM-generated arguments; validate them as strictly as any user input.
  • No authentication on HTTP-based MCP servers — anyone who can reach the server can invoke your tools.
  • Stateful MCP servers — MCP servers should be stateless; state belongs in the resources they read.

Code Examples

✗ Vulnerable
// MCP tool with no input validation:
$tools = [[
    'name' => 'run_sql',
    'description' => 'Run a SQL query',
    'inputSchema' => ['query' => 'string'],
]];
// Handler executes whatever SQL the LLM generates — SQL injection from AI
✓ Fixed
// MCP tool with restricted, validated operations:
$tools = [[
    'name' => 'get_user_orders',
    'description' => 'Get orders for a specific user ID',
    'inputSchema' => [
        'type' => 'object',
        'properties' => ['user_id' => ['type' => 'integer', 'minimum' => 1]],
        'required' => ['user_id'],
    ],
]];
// Handler uses parameterised query, read-only DB user:
$orders = $pdo->prepare('SELECT * FROM orders WHERE user_id = ?');
$orders->execute([$input['user_id']]);

Tags


Added 15 Mar 2026
Edited 22 Mar 2026
Views 51
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 1 ping W 1 ping T 1 ping F 0 pings S 0 pings S 0 pings M 0 pings T 2 pings W 0 pings T 0 pings F 1 ping S 2 pings S 1 ping M 1 ping T 1 ping W 0 pings T 0 pings F 1 ping S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 0 pings S 0 pings M 0 pings T 0 pings W
No pings yet today
No pings yesterday
Amazonbot 9 Scrapy 5 Ahrefs 4 Perplexity 4 Google 4 SEMrush 3 Unknown AI 2 ChatGPT 2 Claude 2 Bing 2 Qwen 1 Meta AI 1 Majestic 1
crawler 34 crawler_json 6
DEV INTEL Tools & Severity
🔵 Info ⚙ Fix effort: High
⚡ Quick Fix
Implement an MCP server to expose your PHP application's tools (database queries, API calls, file operations) as standardised tools that any MCP-compatible AI agent can use
📦 Applies To
PHP 8.0+ web cli
🔗 Prerequisites
🔍 Detection Hints
Custom tool integration per AI provider when MCP standard would enable reuse across Claude Cursor Zed and other MCP hosts
Auto-detectable: ✗ No
⚠ Related Problems
🤖 AI Agent
Confidence: Low False Positives: Medium ✗ Manual fix Fix: High Context: File Tests: Update


✓ schema.org compliant