Model Context Protocol & Agentkits

A comprehensive primer on building AI agents with the Model Context Protocol

What You'll Learn

  • Understanding the Model Context Protocol (MCP)
  • How MCP enables AI agents to interact with external systems
  • Architecture and core components of MCP
  • Popular agentkits and frameworks
  • Building your own MCP servers and clients
  • Real-world examples and implementations

Why MCP Matters

The Model Context Protocol represents a paradigm shift in how AI systems interact with the world. Instead of being limited to text-based conversations, MCP enables AI agents to:

🔌
Connect to Tools

Integrate with external APIs, databases, and services seamlessly

📊
Access Data

Retrieve and process information from various data sources

Take Actions

Execute tasks and workflows in external systems

🔄
Maintain Context

Keep track of state across interactions and sessions

The Evolution of AI Agents

From Chatbots to Agentic Systems

  1. Simple Chatbots (2020-2022) - Basic text responses, no external integrations
  2. Function Calling (2023) - LLMs could request specific function calls, but implementations were custom
  3. MCP Era (November 25, 2024+) - Standardized protocol for tool use, context sharing, and agent coordination
💡 Key Insight: MCP provides a standardized way for AI models to interact with tools and data sources, similar to how HTTP standardized web communication. This standardization enables building complex, multi-agent systems.

What is the Model Context Protocol?

The Model Context Protocol (MCP) is an open protocol that standardizes how AI applications provide context to Large Language Models (LLMs). Think of it as a universal "plugin system" for AI.

MCP in One Sentence

MCP is a standardized protocol that allows AI models to securely connect to and interact with external data sources, tools, and services in a consistent way.

📋 Official Technical Specifications

For authoritative information about MCP, refer to these official sources:

Core Concepts

🔌 Resources

Resources represent data or content that AI models can access. These can be:

  • Files and documents
  • Database records
  • API responses
  • Web pages
  • Real-time data streams
// Example resource
{
  "uri": "file:///docs/guide.md",
  "name": "User Guide",
  "mimeType": "text/markdown",
  "description": "Product user guide"
}

🛠️ Tools

Tools are functions that AI models can invoke to perform actions:

  • Query databases
  • Call APIs
  • Execute code
  • Modify files
  • Send notifications
// Example tool definition
{
  "name": "search_database",
  "description": "Search the product database",
  "inputSchema": {
    "type": "object",
    "properties": {
      "query": { "type": "string" },
      "limit": { "type": "number" }
    }
  }
}

💬 Prompts

Prompts are reusable templates that provide context and structure:

  • Pre-configured conversation starters
  • System prompts with embedded context
  • Workflow templates
  • Role definitions

Why MCP Was Created

The Problem Before MCP

  • Every AI application had custom integrations
  • No standard way to share context between tools
  • Difficult to build multi-agent systems
  • Security and permission models varied wildly

The MCP Solution

  • ✅ Standardized protocol for all integrations
  • ✅ Consistent context sharing mechanism
  • ✅ Built-in security and permission model
  • ✅ Easy to build composable agent systems

MCP vs Other Approaches

Approach Pros Cons
Custom Integration Flexible, tailored Not reusable, time-consuming
Function Calling Simple, model-native No standard format, limited
MCP Standardized, reusable, secure Requires protocol understanding

MCP Architecture

MCP uses a client-server architecture where AI applications (clients) connect to MCP servers that provide resources, tools, and prompts.

System Architecture

🖥️ Client Application (Host)

AI applications like Claude Desktop, IDEs, or custom apps that use LLMs and need access to external context

🤖 LLM (AI Model)

The language model that processes requests and decides when to use tools or access resources

🔌 MCP Client

Protocol client embedded in the host application that manages connections to MCP servers

🌐 MCP Server(s)

Services that expose resources, tools, and prompts through the MCP protocol

💾 Data Sources / APIs

Underlying systems like databases, file systems, web APIs that servers connect to

Communication Flow

How MCP Communication Works
  1. 👤 User sends a request to the AI application
  2. 🤖 LLM determines it needs external data/tools
  3. 📤 Client sends MCP request to appropriate server
  4. ⚙️ Server processes request and accesses data source
  5. 📥 Server returns response via MCP protocol
  6. 🧠 LLM incorporates context into its response
  7. ✨ User receives enriched, contextual answer

Connection Types

Standard I/O (stdio)

Server runs as subprocess, communicates via stdin/stdout. Best for local tools.

stdio://server-command

HTTP with SSE

Server runs as HTTP service with Server-Sent Events for streaming.

http://localhost:3000/mcp

Protocol Stack

Layer Model

┌─────────────────────────────────┐ │ Application Layer │ ← User interactions ├─────────────────────────────────┤ │ MCP Protocol Layer │ ← Resources, Tools, Prompts ├─────────────────────────────────┤ │ JSON-RPC 2.0 │ ← Message format ├─────────────────────────────────┤ │ Transport (stdio/HTTP+SSE) │ ← Communication channel └─────────────────────────────────┘

Security Model

⚠️ Security Considerations

  • Authentication: Servers can require authentication tokens
  • Authorization: Fine-grained permissions for resources and tools
  • Sandboxing: Servers run in isolated environments
  • Validation: All inputs are validated against schemas
  • Audit Logging: All actions can be logged for security review

Protocol Basics

MCP is built on top of JSON-RPC 2.0, a lightweight remote procedure call protocol. This makes it easy to implement and debug.

Core Message Types

1. Requests

Client initiates an action and expects a response:

{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "tools/call",
  "params": {
    "name": "search_database",
    "arguments": {
      "query": "artificial intelligence",
      "limit": 10
    }
  }
}

2. Responses

Server sends back the result:

{
  "jsonrpc": "2.0",
  "id": "1",
  "result": {
    "content": [
      {
        "type": "text",
        "text": "Found 10 results..."
      }
    ]
  }
}

3. Notifications

One-way messages that don't expect responses:

{
  "jsonrpc": "2.0",
  "method": "notifications/progress",
  "params": {
    "progressToken": "abc123",
    "progress": 50,
    "total": 100
  }
}

Common Methods

initialize

Establish connection and exchange capabilities

resources/list

Get available resources from server

resources/read

Read content of a specific resource

tools/list

Get available tools from server

tools/call

Execute a tool with given arguments

prompts/list

Get available prompt templates

Lifecycle

Connection Lifecycle
Client Server | | |------- initialize --------→ | |←----- capabilities ------- | | | |------- tools/list --------→ | |←----- tool definitions --- | | | |------- tools/call --------→ | |←----- result ------------- | | | | (multiple operations...) | | | |------- shutdown ----------→ | | | ✓ Connection closed ✓

Example: Complete Tool Call

Step 1: List Available Tools

// Request
{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "tools/list"
}

// Response
{
  "jsonrpc": "2.0",
  "id": "1",
  "result": {
    "tools": [
      {
        "name": "get_weather",
        "description": "Get current weather for a location",
        "inputSchema": {
          "type": "object",
          "properties": {
            "location": {
              "type": "string",
              "description": "City name"
            }
          },
          "required": ["location"]
        }
      }
    ]
  }
}

Step 2: Call the Tool

// Request
{
  "jsonrpc": "2.0",
  "id": "2",
  "method": "tools/call",
  "params": {
    "name": "get_weather",
    "arguments": {
      "location": "San Francisco"
    }
  }
}

// Response
{
  "jsonrpc": "2.0",
  "id": "2",
  "result": {
    "content": [
      {
        "type": "text",
        "text": "Weather in San Francisco: 18°C, Partly Cloudy"
      }
    ]
  }
}

Core Components

Let's explore the main building blocks you'll work with when building MCP applications.

MCP Server

What is an MCP Server?

An MCP server is a program that exposes resources, tools, and prompts to AI applications. Servers can be written in any language that supports JSON-RPC.

Server Responsibilities:

  • Implement the MCP protocol (JSON-RPC handlers)
  • Define and expose resources, tools, and prompts
  • Handle authentication and authorization
  • Manage connections to underlying data sources
  • Validate inputs and sanitize outputs

Example: Simple MCP Server (TypeScript)

import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

const server = new Server({
  name: "example-server",
  version: "1.0.0"
}, {
  capabilities: {
    tools: {}
  }
});

// Define a tool
server.setRequestHandler("tools/list", async () => ({
  tools: [{
    name: "echo",
    description: "Echoes back the input",
    inputSchema: {
      type: "object",
      properties: {
        message: { type: "string" }
      }
    }
  }]
}));

// Handle tool calls
server.setRequestHandler("tools/call", async (request) => {
  if (request.params.name === "echo") {
    return {
      content: [{
        type: "text",
        text: request.params.arguments.message
      }]
    };
  }
});

// Start server
const transport = new StdioServerTransport();
await server.connect(transport);

MCP Client

What is an MCP Client?

An MCP client is embedded in AI applications (like Claude Desktop, IDEs) and manages connections to MCP servers. Most developers won't need to build clients from scratch.

Client Responsibilities:

  • Discover and connect to MCP servers
  • Send requests on behalf of the LLM
  • Handle responses and errors
  • Manage multiple server connections
  • Provide context to the LLM

Resources

Resource Types

Resources represent any data or content the AI can access:

📄 Files

{
  "uri": "file:///home/user/document.pdf",
  "name": "Project Plan",
  "mimeType": "application/pdf"
}

🗄️ Database Records

{
  "uri": "database://users/12345",
  "name": "User Profile",
  "mimeType": "application/json"
}

🌐 Web Content

{
  "uri": "https://example.com/api/data",
  "name": "API Data",
  "mimeType": "application/json"
}

Tools

Tool Schema

Tools must be defined with a JSON Schema for their inputs:

{
  "name": "create_file",
  "description": "Creates a new file with content",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": {
        "type": "string",
        "description": "File path"
      },
      "content": {
        "type": "string",
        "description": "File content"
      },
      "overwrite": {
        "type": "boolean",
        "description": "Overwrite if exists",
        "default": false
      }
    },
    "required": ["path", "content"]
  }
}
💡 Best Practice: Tool names should be descriptive verbs (e.g., search_documents, create_task, send_email) and descriptions should explain what the tool does and when to use it.

Prompts

Prompt Templates

Prompts provide reusable conversation templates:

{
  "name": "code_review",
  "description": "Review code for issues",
  "arguments": [
    {
      "name": "language",
      "description": "Programming language",
      "required": true
    },
    {
      "name": "code",
      "description": "Code to review",
      "required": true
    }
  ]
}

// When called, generates:
{
  "messages": [
    {
      "role": "user",
      "content": {
        "type": "text",
        "text": "Review this {{language}} code for issues:\n\n{{code}}"
      }
    }
  ]
}

Agentkits & Frameworks

While MCP provides the protocol, agentkits and frameworks make it easier to build sophisticated AI agents by providing higher-level abstractions.

Popular Agent Frameworks

🔷 Anthropic SDKs

There are TWO separate but complementary official SDKs for building agents with Claude and MCP:

1. Anthropic Claude SDK (@anthropic-ai/sdk)

Official SDK for the Claude API - handles LLM interactions, messaging, and tool use.

  • Claude API integration
  • TypeScript and Python support
  • Tool use (function calling)
  • Streaming responses
  • Multi-turn conversations
npm install @anthropic-ai/sdk

2. MCP SDK (@modelcontextprotocol/sdk)

Official SDK for the Model Context Protocol - handles MCP server/client implementation.

  • Build MCP servers and clients
  • Expose tools, resources, and prompts
  • JSON-RPC protocol handling
  • Transport layer (stdio, HTTP+SSE)
npm install @modelcontextprotocol/sdk

How they work together: Use @anthropic-ai/sdk to interact with Claude, and @modelcontextprotocol/sdk to build MCP servers that expose tools Claude can use.

🦜 LangChain

Popular framework for building LLM applications with extensive tool ecosystem.

  • Chain multiple operations together
  • Large ecosystem of integrations
  • Memory management
  • Can integrate with MCP servers
⚠️ Note: initialize_agent was deprecated in LangChain 0.1.0 (early 2024). Use the modern pattern below instead.
from langchain.agents import create_react_agent, AgentExecutor
from langchain import hub

# Get the prompt template
prompt = hub.pull("hwchase17/react")

# Create the agent
agent = create_react_agent(llm, tools, prompt)

# Create agent executor
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)

🧠 AutoGen

Microsoft's framework for building multi-agent systems.

  • Multiple agents that can communicate
  • Built-in conversation patterns
  • Code execution capabilities
  • Human-in-the-loop support

🌊 CrewAI

Framework for orchestrating role-playing AI agents.

  • Role-based agent definition
  • Task delegation
  • Process orchestration
  • Built-in tools and integrations

MCP-Native Tools

MCP Inspector

Debug and test MCP servers interactively

npx @modelcontextprotocol/inspector

MCP Server Templates

Quickstart templates for common server types

npx create-mcp-server

Claude Desktop

Built-in MCP client with GUI configuration

Continue (IDE Plugin)

VS Code extension with MCP support

Building Blocks for Agents

Common Agent Patterns

  1. ReAct (Reasoning + Acting) - Agent reasons about what to do, then acts
  2. Plan-and-Execute - Create a plan, then execute steps
  3. Reflection - Agent reviews its own outputs and improves
  4. Multi-Agent - Multiple specialized agents collaborate
  5. Tool-Using - Agent selects and uses appropriate tools

Example: Simple Agent with MCP

import Anthropic from "@anthropic-ai/sdk";
import { MCPClient } from "@modelcontextprotocol/sdk/client/index.js";

// Connect to MCP server
const mcpClient = new MCPClient();
await mcpClient.connect(/* ... */);

// Get available tools
const { tools } = await mcpClient.request("tools/list");

// Create Claude client
const anthropic = new Anthropic();

// Agent loop
async function runAgent(userMessage) {
  let messages = [{ role: "user", content: userMessage }];

  while (true) {
    // Ask Claude what to do
    const response = await anthropic.messages.create({
      model: "claude-3-5-sonnet-20241022",
      messages,
      tools, // Pass MCP tools
      max_tokens: 4096
    });

    // Check if Claude wants to use a tool
    const toolUse = response.content.find(
      block => block.type === "tool_use"
    );

    if (!toolUse) {
      // No more tools needed, return response
      return response.content[0].text;
    }

    // Call the tool via MCP
    const toolResult = await mcpClient.request("tools/call", {
      name: toolUse.name,
      arguments: toolUse.input
    });

    // Add tool result to conversation
    messages.push({
      role: "assistant",
      content: response.content
    });
    messages.push({
      role: "user",
      content: [{
        type: "tool_result",
        tool_use_id: toolUse.id,
        content: toolResult.content
      }]
    });

    // Loop continues...
  }
}

// Use the agent
const result = await runAgent(
  "Search for recent AI papers and summarize the top 3"
);

Building with MCP

Ready to build your own MCP server? Let's walk through creating a practical example.

Getting Started

Prerequisites

  • Node.js 18+ or Python 3.10+
  • Basic understanding of JSON and APIs
  • Familiarity with async/await programming

Installation

# TypeScript/JavaScript
npm install @modelcontextprotocol/sdk

# Python
pip install mcp

Project: File System Server

Let's build an MCP server that provides file system access to AI agents.

Step 1: Server Setup

import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import fs from "fs/promises";
import path from "path";

const server = new Server({
  name: "filesystem-server",
  version: "1.0.0"
}, {
  capabilities: {
    resources: {},
    tools: {}
  }
});

const ALLOWED_DIR = process.env.ALLOWED_DIR || process.cwd();

Step 2: Implement Resources

// List available files as resources
server.setRequestHandler("resources/list", async () => {
  const files = await fs.readdir(ALLOWED_DIR);

  return {
    resources: files.map(file => ({
      uri: `file:///${path.join(ALLOWED_DIR, file)}`,
      name: file,
      mimeType: getMimeType(file),
      description: `File: ${file}`
    }))
  };
});

// Read file content
server.setRequestHandler("resources/read", async (request) => {
  const filePath = request.params.uri.replace("file:///", "");

  // Security check
  if (!filePath.startsWith(ALLOWED_DIR)) {
    throw new Error("Access denied");
  }

  const content = await fs.readFile(filePath, "utf-8");

  return {
    contents: [{
      uri: request.params.uri,
      mimeType: getMimeType(filePath),
      text: content
    }]
  };
});

Step 3: Implement Tools

// Define available tools
server.setRequestHandler("tools/list", async () => ({
  tools: [
    {
      name: "read_file",
      description: "Read contents of a file",
      inputSchema: {
        type: "object",
        properties: {
          path: {
            type: "string",
            description: "Path to file"
          }
        },
        required: ["path"]
      }
    },
    {
      name: "write_file",
      description: "Write content to a file",
      inputSchema: {
        type: "object",
        properties: {
          path: { type: "string" },
          content: { type: "string" }
        },
        required: ["path", "content"]
      }
    },
    {
      name: "list_directory",
      description: "List files in a directory",
      inputSchema: {
        type: "object",
        properties: {
          path: { type: "string" }
        }
      }
    }
  ]
}));

// Handle tool calls
server.setRequestHandler("tools/call", async (request) => {
  const { name, arguments: args } = request.params;

  switch (name) {
    case "read_file": {
      const fullPath = path.join(ALLOWED_DIR, args.path);
      const content = await fs.readFile(fullPath, "utf-8");
      return {
        content: [{
          type: "text",
          text: content
        }]
      };
    }

    case "write_file": {
      const fullPath = path.join(ALLOWED_DIR, args.path);
      await fs.writeFile(fullPath, args.content);
      return {
        content: [{
          type: "text",
          text: `File written: ${args.path}`
        }]
      };
    }

    case "list_directory": {
      const dirPath = args.path
        ? path.join(ALLOWED_DIR, args.path)
        : ALLOWED_DIR;
      const files = await fs.readdir(dirPath);
      return {
        content: [{
          type: "text",
          text: files.join("\n")
        }]
      };
    }

    default:
      throw new Error(`Unknown tool: ${name}`);
  }
});

Step 4: Start the Server

async function main() {
  const transport = new StdioServerTransport();
  await server.connect(transport);
  console.error("Filesystem MCP server running");
}

main().catch(console.error);

Testing Your Server

Using MCP Inspector

The easiest way to test your server:

npx @modelcontextprotocol/inspector node dist/index.js

This opens a web interface where you can:

  • List all tools and resources
  • Call tools with test inputs
  • View responses and errors
  • Debug the protocol messages

Connecting to Claude Desktop

Configuration

Add your server to Claude Desktop's config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "filesystem": {
      "command": "node",
      "args": ["/path/to/your/server/dist/index.js"],
      "env": {
        "ALLOWED_DIR": "/Users/yourname/Documents"
      }
    }
  }
}

Best Practices

Security

  • ✅ Always validate and sanitize inputs
  • ✅ Use allowlists for file paths and operations
  • ✅ Implement proper authentication
  • ✅ Log all operations for audit trails
  • ❌ Never trust user input directly
  • ❌ Don't expose sensitive system operations

Design

  • Keep tools focused and single-purpose
  • Provide clear, detailed descriptions
  • Use JSON Schema validation
  • Return structured, parseable responses
  • Handle errors gracefully with helpful messages

Popular MCP Tools & Servers

The MCP ecosystem is growing rapidly. Here are some popular and useful MCP servers you can use.

Official Servers

📁 Filesystem

Access and manipulate local files and directories

npx -y @modelcontextprotocol/server-filesystem /path/to/allowed/dir

Tools: read_file, write_file, list_directory, create_directory, move_file, search_files

🌐 Fetch

Make HTTP requests and fetch web content

npx -y @modelcontextprotocol/server-fetch

Tools: fetch_url, post_data

🗄️ PostgreSQL

Query and interact with PostgreSQL databases

npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb

Tools: query, list_tables, describe_table

💾 SQLite

Work with SQLite databases

npx -y @modelcontextprotocol/server-sqlite /path/to/database.db

Tools: query, list_tables, read_schema

🐙 GitHub

Interact with GitHub repositories, issues, and PRs

npx -y @modelcontextprotocol/server-github

Tools: create_issue, list_repos, get_file, create_pr, search_code

Community Servers

📧 Gmail

Read and send emails through Gmail API

📊 Google Sheets

Read and write spreadsheet data

📅 Google Calendar

Manage calendar events

🔍 Web Search

Search the web via APIs (Brave, Google, etc.)

🐳 Docker

Manage containers and images

☁️ AWS

Interact with AWS services

🎨 DALL-E

Generate images from text

🎵 Spotify

Control music playback and playlists

Development Tools

🔍 MCP Inspector

Interactive debugging tool for MCP servers

npx @modelcontextprotocol/inspector <command>

Features:

  • Web-based UI for testing
  • View all tools, resources, and prompts
  • Test tool calls interactively
  • See protocol messages in real-time

📦 Create MCP Server

Scaffolding tool for new servers

npx create-mcp-server my-server

Creates a ready-to-go TypeScript project with:

  • Basic server structure
  • Example tools and resources
  • Build configuration
  • Testing setup

Combining Multiple Servers

Multi-Server Configuration

Claude Desktop can connect to multiple MCP servers simultaneously:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/docs"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "your-token"
      }
    },
    "postgres": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
    }
  }
}

Now Claude can use tools from all three servers in a single conversation!

Finding More Servers

Example Implementations

Let's look at some practical examples of what you can build with MCP.

Example 1: Code Review Assistant

Use Case

An AI agent that reviews code by accessing the filesystem, running tests, and checking style guidelines.

MCP Servers Used

  • Filesystem: Read source code files
  • Git: Access commit history and diffs
  • Shell: Run linters and tests

Workflow

  1. User asks: "Review the recent changes in src/auth.ts"
  2. Agent uses Git server to get the diff
  3. Agent uses Filesystem to read related files for context
  4. Agent uses Shell server to run TypeScript compiler and ESLint
  5. Agent provides comprehensive review with specific suggestions

Example 2: Research Assistant

Use Case

An agent that searches the web, reads documents, and compiles research summaries.

MCP Servers Used

  • Web Search: Find relevant articles and papers
  • Fetch: Download and parse web content
  • Filesystem: Save and organize research notes
  • SQLite: Store citations and references

Example Interaction

User: Research the latest developments in quantum computing and create a summary

Agent Actions:
1. Uses web_search tool to find recent papers
2. Uses fetch tool to download paper abstracts
3. Uses filesystem to save source materials
4. Uses sqlite to store references with metadata
5. Generates comprehensive summary with citations
6. Uses filesystem to save final report

Example 3: DevOps Automation

Use Case

An agent that monitors systems, analyzes logs, and performs automated responses.

MCP Servers Used

  • Docker: Inspect containers and services
  • AWS: Check cloud infrastructure status
  • PostgreSQL: Query application databases
  • GitHub: Create issues for problems found
  • Slack: Send notifications to team

Automation Example

Trigger: High error rate detected

Agent Actions:
1. Query PostgreSQL for recent error logs
2. Check Docker for container health status
3. Analyze AWS CloudWatch metrics
4. Identify root cause (database connection timeout)
5. Create GitHub issue with full context
6. Send Slack notification to on-call engineer
7. Attempt automatic remediation (restart connection pool)

Example 4: Content Management System

Use Case

An agent that helps manage blog content, images, and publishing workflows.

MCP Servers Used

  • Filesystem: Read and write blog posts
  • DALL-E: Generate featured images
  • Git: Version control for content
  • GitHub: Create PRs for review

Publishing Workflow

User: Create a blog post about MCP with a featured image

Agent:
1. Drafts blog post content
2. Uses filesystem to save draft markdown
3. Generates featured image with DALL-E
4. Saves image to assets folder
5. Updates post frontmatter with image path
6. Creates git branch for new post
7. Opens GitHub PR for review
8. Notifies author when ready

Example 5: Customer Support Bot

Use Case

An intelligent support agent that accesses documentation, tickets, and user data.

MCP Servers Used

  • PostgreSQL: Access customer and ticket database
  • Filesystem: Read product documentation
  • Zendesk/Custom API: Update tickets
  • Stripe/Custom API: Check billing info

Support Flow

Customer: Why am I being charged $99 instead of $49?

Agent:
1. Query PostgreSQL for customer account details
2. Check Stripe for current subscription and billing history
3. Read documentation about pricing plans
4. Identify issue: Customer on legacy plan, price increased
5. Search knowledge base for migration options
6. Provide explanation with options
7. Update support ticket with resolution
8. Offer to process refund if applicable

Building Your Own

Tips for Successful Implementations

  • Start Simple: Begin with 1-2 servers, add more as needed
  • Test Tools Individually: Use MCP Inspector to verify each tool works
  • Provide Rich Context: Good tool descriptions help the LLM choose correctly
  • Handle Errors Gracefully: Return helpful error messages
  • Log Everything: Makes debugging much easier
  • Iterate: Refine based on real usage patterns

Resources & Next Steps

Official Documentation

SDKs & Libraries

TypeScript/JavaScript

npm install @modelcontextprotocol/sdk

GitHub Repo

Python

pip install mcp

GitHub Repo

Example Servers

🔧 Official Example Servers

Development Tools

🛠️ Essential Tools

  • MCP Inspector: npx @modelcontextprotocol/inspector
  • Server Template: npx create-mcp-server
  • Claude Desktop: Download

Community & Support

💬 Get Help & Connect

Learning Path

📖 Recommended Learning Journey

  1. Understand the Basics
    • Read this primer (you're here!)
    • Review the MCP specification
    • Understand JSON-RPC 2.0
  2. Experiment with Existing Servers
    • Install Claude Desktop
    • Configure a few official servers
    • Try using them in conversations
  3. Build a Simple Server
    • Use create-mcp-server to start
    • Implement 1-2 basic tools
    • Test with MCP Inspector
  4. Create a Practical Project
    • Identify a workflow to automate
    • Build a custom server for it
    • Integrate with Claude Desktop
  5. Explore Advanced Topics
    • Multi-server coordination
    • Streaming responses
    • Custom authentication
    • Error handling strategies

Related Technologies

Complementary Tools & Frameworks

  • LangChain: Framework for LLM applications
  • AutoGen: Multi-agent conversation framework
  • LlamaIndex: Data framework for LLM applications
  • Semantic Kernel: Microsoft's AI orchestration SDK

Sources & References

🤖 Anthropic Claude

Keep Learning

🎯 Next Steps

Now that you understand MCP and agentkits:

  • ✅ Try the examples in this guide
  • ✅ Build a simple server for your own use case
  • ✅ Join the community and share what you build
  • ✅ Contribute to open source MCP servers
  • ✅ Explore multi-agent architectures

🚀 Ready to build the future of AI agents?
Start experimenting with MCP today!