Skip to content

Model Context Protocol (MCP) & Plugins: Extending Claude Code

CoreConceptJuly 31, 20265 min read

An AI coding assistant confined strictly to local file editing misses half of a modern software engineer's environment: database schemas, cloud infrastructure status, internal microservice APIs, observability platforms, and CI/CD pipelines. Anthropic's Model Context Protocol (MCP) provides an open standard for connecting AI models to external tools, databases, and services safely.

This article explains how to build, configure, and secure MCP servers and custom plugins in Claude Code. We trace an engineering workflow in an inventory-service repository — connecting PostgreSQL, Datadog monitoring, and GitHub Actions webhooks via MCP Channels — and demonstrate how to package internal tools into private, version-controlled plugin marketplaces for engineering organizations. For broader CLI commands and tool architecture, see How Claude Code Works and Claude Code CLI Reference.

Knowledge map: Model Context Protocol (MCP) and plugin extension architecture
Knowledge map: Model Context Protocol (MCP) and plugin extension architecture

Model Context Protocol (MCP) Architecture & Transports

MCP standardizes communication between an AI client (such as Claude Code) and external tool providers via JSON-RPC 2.0. Instead of writing ad-hoc API integrations, an MCP server exposes three core capabilities: Tools (invokable functions), Resources (readable data feeds), and Prompts (pre-built prompt templates).

MCP supports two primary transport mechanisms: local Stdio (where Claude Code spawns the server process locally and communicates via standard input/output) and remote SSE / HTTP (Server-Sent Events over HTTPS for hosted microservices).

MCP Transport Comparison
PropertyStdio TransportSSE / HTTP Transport
Process HostingLocal subprocess managed by CLIRemote microservice / serverless function
Network BoundaryLocal machine (Zero network latency)HTTPS endpoint (Requires authentication)
Use CasesLocal CLI tools, git, filesystem helpersShared databases, staging environments, Slack
Security ScopeInherits user terminal permissionsGated by API tokens & OAuth headers
MCP transport comparison: local Stdio sub-processes vs remote SSE microservices
MCP transport comparison: local Stdio sub-processes vs remote SSE microservices

Quick reference

  • Stdio servers are defined in .claude/settings.json or ~/.claude/settings.json.
  • Remote SSE endpoints allow teams to share centralized database tools without distributing raw credentials.
  • JSON-RPC payloads validate tool inputs against declared JSON Schema definitions before execution.

Remember this

MCP decouples tool execution from model logic, providing a secure, standardized contract for connecting local and remote services.

Anatomy of a Claude Code Plugin

A Plugin in Claude Code is a portable, redistributable package that bundles skills, hooks, subagents, and MCP server configurations into a single directory or ZIP archive. Plugins allow engineering teams to standardize developer environments across repositories.

Below is the manifest structure (.claude-plugin/plugin.json) for a custom database-ops plugin used in inventory-service:

1{2  "name": "database-ops",3  "version": "1.4.0",4  "description": "Database query tools and migration helpers for inventory-service",5  "author": "Engineering Platform Team",6  "skills": ["./skills/sql-auditor"],7  "hooks": "./hooks/hooks.json",8  "mcpServers": {9    "postgres-read-only": {10      "command": "npx",11      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://readonly@db.internal:5432/inventory"]12    }13  }14}
Plugin bundle anatomy: manifest, skills, hooks, and executables
Plugin bundle anatomy: manifest, skills, hooks, and executables

Quick reference

  • Plugins can be installed locally via /plugin install ./my-plugin or loaded from ZIP archives and URLs.
  • Version constraints enforce compatibility across team environments.
  • Executables inside a plugin's bin/ directory are added to PATH automatically for the session duration.

Remember this

Plugins provide a unified distribution format for packaging enterprise skills, shell hooks, and MCP servers.

Live Event Pushing with MCP Channels

Traditional agent workflows are purely reactive: the developer asks a question, and the agent responds. MCP Channels invert this model by allowing external services — such as CI/CD runners, monitoring alerts, or Slack channels — to push real-time events into an active Claude Code session.

When a GitHub Actions build fails on PR #302 in inventory-service, an MCP Channel server forwards the build error log directly into the developer's terminal. Claude Code detects the incoming channel message, analyzes the stack trace, and prompts the developer with a proposed fix.

Channels event flow: Pushing live CI test failures into an active CLI session
Channels event flow: Pushing live CI test failures into an active CLI session

Quick reference

  • Channels require explicit user consent and sender gating to prevent unauthorized message injection.
  • Pushed messages enter the transcript without interrupting an active tool execution sequence.
  • Useful for automated CI remediation, staging deployment notifications, and live log monitoring.

Remember this

MCP Channels transform Claude Code into an event-driven agent capable of reacting to live infrastructure events in real time.

Enterprise Plugin Marketplaces & Managed MCP Security

In large enterprise deployments, administrators must govern which MCP servers and plugins developers can execute. Managed settings allow security teams to publish Private Plugin Marketplaces and configure strict allowlists or denylists.

Administrators define managed policies in /etc/claude/managed-settings.json or deliver them via central server config:

1{2  "mcpSecurityPolicy": {3    "allowlist": [4      "@modelcontextprotocol/server-postgres",5      "@modelcontextprotocol/server-github"6    ],7    "denylist": [8      "untrusted-third-party-mcp-*"9    ],10    "requireApprovalForNewServers": true11  }12}

Quick reference

  • Private marketplaces allow hosting internal plugin catalogs behind company SSO authentication.
  • Hard-deny rules block dangerous MCP tools (e.g. unverified remote shell execution) unconditionally.
  • Server-managed policies prevent developers from adding unvetted third-party MCP endpoints.

Remember this

Enterprise governance features enable safe, organization-wide adoption of MCP tools and custom plugins.

Hands-on Practice: Build & Test a Stdio MCP Server

Practice building and registering a custom MCP server with this exercise:

1. Create Server: Build a minimal Node.js script mcp-server.js using @modelcontextprotocol/sdk that exposes a get_system_uptime tool. 2. Register Server: Add the server to your project's .claude/settings.json under mcpServers using the node command. 3. Test Connection: Launch Claude Code and run /mcp to verify that get_system_uptime is listed with a connected green status. 4. Execution Test: Ask Claude: "What is the current system uptime?" and confirm that the tool executes cleanly.

Quick reference

  • Check that JSON-RPC output is formatted correctly over standard stdout.
  • Verify that /mcp shows green connected status for your server process.
  • Test running a prompt that invokes get_system_uptime and confirm output matches OS uptime.

Remember this

Building a minimal Stdio MCP server demonstrates how easily custom tools can be registered and consumed by Claude Code.

Key takeaway

The Model Context Protocol (MCP) and custom plugin ecosystem transform Claude Code from an isolated file editor into a connected enterprise agent. By standardizing Stdio and SSE transports, packaging tools into versioned plugins, deploying internal marketplaces, and pushing live events via Channels, engineering organizations can securely integrate AI assistants into their complete development and operational stack.

Practice (20 min): Build a minimal Node.js Stdio MCP server exposing a get_system_uptime tool. Register it in .claude/settings.json, launch Claude Code, run /mcp to verify a connected green status, and ask the agent to return the system uptime.

Share:

Related Articles

Modern coding agents are no longer just chat boxes beside your editor. The useful power comes from controls around the l

Read

The Model Context Protocol (MCP) has emerged as the universal open standard for connecting AI models to external data so

Read

Traditional Static Application Security Testing (SAST) tools generate long lists of static warnings that engineers must

Read

Keep learning

Follow a structured path or browse all courses to go deeper.