tool

Model Context Protocol

created 2026-04-27 updated 2026-06-07 mcp · protocol · tools · ai · integration

Model Context Protocol (MCP)

Open standard for connecting AI applications to external systems. Acts as a “USB-C port for AI” — standardized interface for tools, data, and prompts.

Architecture

Host (AI Application)
  ├── MCP Client 1 ──stdio──→ Local Server (filesystem, DB)
  ├── MCP Client 2 ──stdio──→ Local Server (custom tools)
  └── MCP Client 3 ──HTTP──→ Remote Server (API, SaaS)
  • Host: AI application (Claude, LangGraph agent, VS Code)
  • Client: Maintains connection to one server
  • Server: Exposes tools, resources, and prompts

Three Primitives

PrimitivePurposeDiscoveryExecution
ToolsExecutable functionstools/listtools/call
ResourcesData sources (files, DB records)resources/listresources/read
PromptsReusable interaction templatesprompts/listprompts/get

Transport

  • stdio: Local process communication. No network overhead. Single client per server.
  • Streamable HTTP: Remote communication. Supports auth headers, multiple clients. OAuth recommended.

Dynamic Tool Discovery

Servers can notify clients when tools change:

{"jsonrpc": "2.0", "method": "notifications/tools/list_changed"}

Client then re-fetches tools/list. Enables runtime tool addition/removal without restarting the agent.

LangGraph Integration

Via langchain-mcp-adapters:

from langchain_mcp_adapters.client import MultiServerMCPClient

client = MultiServerMCPClient({
    "archive": {"transport": "stdio", "command": "python", "args": ["archive_server.py"]},
    "cms": {"transport": "http", "url": "https://cms.internal/mcp"},
})
tools = await client.get_tools()
agent = create_agent("anthropic:claude-sonnet-4-6", tools)

Features: tool interceptors (middleware), multimodal content, persistent sessions, resources, prompts.

When to Use MCP vs Direct Tools

Use MCP when:

  • Tools are shared across multiple agents or applications
  • Tools need independent deployment and lifecycle
  • Third-party tool providers
  • Dynamic tool composition at runtime
  • Different tool sets per user/context

Use direct tools when:

  • Performance-critical (avoid JSON-RPC overhead)
  • Agent-specific tools that won’t be shared
  • Simplicity is preferred
  • Tools tightly coupled to agent state

Relevance to kulify Projects

For fajb-next, MCP could package each skill (archive search, CMS integration, financial data) as an independent server. Journalists would get different tool sets based on their active bundle. See LangGraph Skills Pattern for the full bundle architecture.

MCP as a Distribution Channel

A second use of MCP, beyond plumbing inside your own stack: selling tools to AI agents as a paid marketplace category. As of mid-2026, less than 5% of the 17k+ public MCP servers are monetized — and dedicated marketplaces (Apify ~80% rev share, MCPize ~85% rev share) handle billing/discovery just like rapidapi does for REST APIs.

This is the weekend #2 channel for the mini-apps/overview|mini-apps series: each REST product (starting with url-intel/overview) gets a thin MCP wrapper exposing its endpoints as get_page_metadata, screenshot_page, page_to_pdf tools. Same backend, second sales channel, different buyer class (AI agents rather than human devs). See marketplace-distribution for the broader pattern.