Skip to content
advanced 90 min read ⚡ 800 XP by CMSG Team · Mar 5, 2026
mcp ai-agents claude-code typescript python

Mastering MCP & Agentic AI Development

Course Overview

Model Context Protocol (MCP) Arcane Glossary Model Context Protocol. An open standard that allows AI models to connect with local tools, data, and APIs securely. is the open standard that allows AI models to connect with your tools and data. In this course, you will learn to build, debug, and deploy MCP servers that extend the capabilities of agents like Claude Code, Gemini CLI, and Antigravity.

Learning Objectives

  • Architect and build MCP servers from scratch using TypeScript and Python.
  • Configure Host-Client relationships for secure local tool execution.
  • Implement specialized MCP servers for database, filesystem, and API access.
  • Extend Antigravity/Gemini behavior with custom MCP tools.

Prerequisite Rituals

Verify your circle before starting

Check all to unlock lesson focus READY TO CAST

Technical Deep Dive: The MCP Architecture

MCP operates on a simple but powerful Host-Client-Server model:

  1. The Client: The AI application (e.g., Claude Desktop, Antigravity) that needs context.
  2. The Host: The runner (often the same as the client) that manages the server lifecycle.
  3. The Server: Your custom code that provides Resources, Tools, and Prompts.

Communication happens over STDIO or SSE (Server-Sent Events) using JSON-RPC messages. This ensures that your secrets and data never leave your local environment—the agent only sees what you explicitly expose.


Walkthrough: Building a “FileSystem Search” MCP Server

Step 1: Initialize the Server

We’ll use the Official TypeScript SDK.

mkdir msp-fs-server && cd msp-fs-server
npm init -y
npm install @modelcontextprotocol/sdk zod
npm install -D typescript @types/node
npx tsc --init

Step 2: Implement the Tool logic

Create src/index.ts. This server will expose a tool to find specific file types.

import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import {
  CallToolRequestSchema,
  ListToolsRequestSchema,
} from "@modelcontextprotocol/sdk/types.js";
import { z } from "zod";
import { execSync } from "child_process";

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

// Define your tool
server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [{
    name: "find_files",
    description: "Search for files by extension within the current directory",
    inputSchema: {
      type: "object",
      properties: {
        extension: { type: "string", description: "e.g., .ts, .md" }
      },
      required: ["extension"]
    }
  }]
}));

// Implement the tool logic
server.setRequestHandler(CallToolRequestSchema, async (request) => {
  if (request.params.name === "find_files") {
    const { extension } = request.params.arguments as { extension: string };
    try {
      const output = execSync(`find . -maxdepth 2 -name "*${extension}"`).toString();
      return { content: [{ type: "text", text: output || "No files found." }] };
    } catch (e) {
      return { content: [{ type: "text", text: `Error: ${e}` }], isError: true };
    }
  }
  throw new Error("Tool not found");
});

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

Step 3: Connect to your Agent

Add your server configuration to your claude_desktop_config.json:

{
  "mcpServers": {
    "my-fs-search": {
      "command": "node",
      "args": ["/absolute/path/to/msp-fs-server/build/index.js"]
    }
  }
}

Advanced: Tool-Augmented Agents

Once connected, the agent doesn’t just “talk”—it “acts”.

  • The Planning Loop: Agent realizes it needs file info → Agent calls your tool → Your server executes local code → Agent builds reasoning based on actual metadata.
  • Security Ritual: Always use Zod for input validation to prevent command injection via AI inputs.

Capstone Project: The Personal Knowledge Bridge

Build an MCP server that connects your AI agent to a local SQLite database or a set of Markdown notes.

  1. Implement a Resource that lists all notes.
  2. Implement a Tool that updates a specific note based on agent findings.
  3. Successfully query your notes through the Antigravity or Claude interface.

You have extended the mind of the machine. The boundaries between code and intelligence are now yours to define.

📜 The Grimoire

Progress to Adept 0%
Knowledge Acquired

No spells mastered yet...

Rank Hierarchy

Progress saved locally to your browser.

🕯️ Academy Support

Common Ritual Issues
"Node.js version not found"
Run node -v. If it's below 22.12.0, use NVM to upgrade: nvm install 22 && nvm use 22
"Build fails on Cloudflare"
Ensure you've set the NODE_VERSION environment variable to 22.12.0 in the Cloudflare Dashboard settings.
"Prerequisites not checking"
The checklists are interactive but local to your current lesson view. They help you track your own setup progress manually.

Still blocked by a technical curse?

Ask the Archmage