Logo Context Engineering with MCP

Context Engineering with MCP

Tổ chức
timothywarner-org

🧠 Stop building AI that forgets. Master MCP (Model Context Protocol) with production-ready semantic memory, hybrid RAG, and the WARNERCO Schematica teaching app. FastMCP + LangGraph + Vector/Graph stores. Your AI assistant's long-term memory starts here.

Nhà phát hànhtimothywarner-org
Kho mãcontext-engineering
Ngôn ngữPython
Bản fork
23
Sao
27
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Context Engineering with MCP cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    27 sao và 23 bản fork từ kho mã được liên kết.

Context Engineering with MCP: Build AI Systems That Actually Remember

Welcome to the training hub for mastering Context Engineering with Model Context Protocol (MCP). This course teaches you to implement production-ready semantic memory systems for AI assistants using Python, FastAPI, FastMCP, and LangGraph.


Quick Start

Prerequisites

  • Python 3.13 (pinned in .python-version) — onnxruntime (a chromadb dependency) does not yet ship 3.14 wheels
  • Node.js 20+ (for Lab 01 and MCP Inspector)
  • uv package manager (recommended for Python)
  • Claude Desktop or Claude Code

Option 1: Hello MCP Lab (Beginner Entry Point)

bash
git clone https://github.com/timothywarner-org/context-engineering.git
cd context-engineering/labs/lab-01-hello-mcp/starter
npm install && npm start

# Test with MCP Inspector (in another terminal)
npx @modelcontextprotocol/inspector node src/index.js

Option 1.5: MCP Chat CLI Lab (Python Bridge)

powershell
cd labs/lab-02-mcp-chat
.\run.ps1

run.ps1 is the on-rails launcher: it bootstraps .env, lifts ANTHROPIC_API_KEY from the repo-root .env, and launches the chat REPL. Lab 02 is the smallest complete Python MCP client + stdio server + REPL in the repo - the conceptual bridge between Lab 01 (JS hello-world) and WARNERCO (production-shaped).

Option 1.7: MCP Apps Lab (Interactive UI Surfaces)

bash
cd labs/lab-03-mcp-apps

Lab 03 ships three npm MCP servers (budget-allocator, map, system-monitor) that render interactive ui:// surfaces in Claude Desktop via SEP-1865 (MCP Apps extension, spec 2026-01-26). See labs/lab-03-mcp-apps/README.md.

Option 1.9: Remote MCP + OAuth on Azure

Lab 04 is a remote MCP server secured by Entra ID OAuth, fronted by Azure API Management as the authorization-server facade, with an Azure Functions Python backend. Deploy with azd up, connect per remote-mcp-apim-functions-python/QUICKSTART.md, then tear down the same day with azd down --purge --force.

Option 2: WARNERCO Schematica (Flagship Teaching App)

bash
cd src/warnerco/backend
uv sync
uv run uvicorn app.main:app --reload    # HTTP server at http://localhost:8000
uv run warnerco-mcp                      # MCP stdio server for Claude Desktop
uv run warnerco-restart                  # Force-kill port 8000 and restart uvicorn

The warnerco-restart command (from scripts/restart_server.py) terminates anything bound to port 8000 (Windows: netstat + taskkill /F /T; POSIX: lsof + SIGKILL) before restarting. Flags: --kill-only, --port N.


Course Structure (4 x 50 Minutes)

SegmentTopicFocus
1Context, Made VisibleConsumer LLMs hide context; dev tools (Claude Code, Copilot) expose it
2MCP: Standard for ContextThe protocol + a server on the official mcp SDK; current best practices
3Memory Tiers in a Real AppWARNERCO's four CoALA tiers live; orchestration kept under the hood
4MCP in the Tools You UseClaude Code + GitHub Copilot in VS Code as context-engineering surfaces

Full plan: instructor/course-plan-june-2026.md (context-first, official-SDK-first; delivered 2026-06-30). The earlier orchestration-forward plan is archived under instructor/archive/.

Segment Notebooks

notebooks/segment-1.ipynb through segment-4.ipynb are four prepopulated, verified teaching notebooks, one per 50-minute segment. Each opens with a repo-root anchor cell that walks up to .git, so it runs from any working directory. They print live counts (never hardcoded), and Segment 3 runs the full pipeline with live Anthropic prose. Open them in VS Code with the Jupyter extension and Run All. Verified to run error-free from both the repo root and notebooks/.


WARNERCO Schematica Architecture

The flagship teaching application exercises all four CoALA memory tiers (Sumers et al. 2024) in a 9-node LangGraph pipeline:

+--------------------------------------------------------------------------+
|                          FastAPI + FastMCP                               |
+--------------------------------------------------------------------------+
|  LangGraph Flow (9-node CoALA-tiered RAG)                                |
|  parse_intent -> query_graph -> inject_scratchpad -> recall_episodes ->  |
|  retrieve -> compress_context -> reason -> respond -> log_episode        |
+--------------------------------------------------------------------------+
|  Four CoALA Memory Tiers                                                 |
|  +------------+  +-----------+  +----------+  +------------------------+ |
|  | Working    |  | Episodic  |  | Semantic |  | Procedural             | |
|  | Scratchpad |  | events.db |  | Vector   |  | MCP Prompts (versioned)| |
|  | (SQLite)   |  | (SQLite)  |  | store    |  | catalog://procedural   | |
|  +------------+  +-----------+  +----------+  +------------------------+ |
+--------------------------------------------------------------------------+
|  Consolidation ("sleep cycle"): scratchpad+episodic --(ctx.sample)--> semantic |
+--------------------------------------------------------------------------+

CoALA Tier Reference

TierWhat it storesBacked byLangGraph node
WorkingSession observations & inferencesdata/scratchpad/notes.db (SQLite)inject_scratchpad
EpisodicTimestamped events with importancedata/episodic/events.db (SQLite)recall_episodes + log_episode
SemanticDurable facts (incl. consolidated FACT-*)Vector store (Chroma / Azure / JSON)retrieve
ProceduralVersioned skills/workflowsMCP @mcp.prompt() registrations(user-invoked, not in pipeline)

The reason node (LangGraph node 6) synthesizes prose via the official anthropic Python SDK (AsyncAnthropic); if the backend .env lacks the key it degrades gracefully - retrieval still works and the prose shows a fallback message.

Episodic recall uses Park et al.'s scoring formula — α_recency · 0.5^(hours/half_life) + α_importance · stored + α_relevance · cosine(query, summary) — and warn_episodic_recall returns the per-event score breakdown so students can see why each memory surfaced.

The knowledge graph is indexed at src/warnerco/backend/data/graph/knowledge.db with 117 entities and 221 relationships across 6 predicates (has_tag, compatible_with, belongs_to_model, has_status, has_category, contains).

Progressive Tool Loading

The server registers 28 MCP tools, 12 resources, and 5 prompts. Two meta-discovery tools implement progressive tool loading per Anthropic's "code execution with MCP" guidance:

  • warn_search_tools(query, detail, limit) — keyword discovery with detail levels name, summary, full
  • warn_describe_tool(name) — full schema for a single tool by name

Both meta-tools self-exclude from warn_search_tools results, so count is up to 26 even when total is 28. Clients can list tools cheaply, then pull full schemas only for what they actually plan to call.


Repository Structure

context-engineering/
├── src/warnerco/backend/      # WARNERCO Schematica (FastAPI + FastMCP + LangGraph)
├── labs/lab-01-hello-mcp/     # Lab 01: Hello MCP, single add tool (JS)
├── labs/lab-02-mcp-chat/      # Lab 02: MCP client + server + chat REPL (Python, vendored)
├── labs/lab-03-mcp-apps/      # Lab 03: MCP Apps, interactive ui:// surfaces (JS/TS, SEP-1865)
├── remote-mcp-apim-functions-python/  # Lab 04: remote MCP + Entra ID OAuth via APIM (Python + bicep)
├── notebooks/                 # Four verified segment teaching notebooks (segment-1..4)
├── docs/                      # Student materials, tutorials, diagrams
├── instructor/                # Instructor-only materials
├── config/                    # Sample MCP client configurations
├── .vscode/                   # VS Code workspace configuration
├── .claude/                   # Claude Code agents and skills
└── CLAUDE.md                  # Development instructions (SOURCE OF TRUTH)

For development details, see CLAUDE.md - the source of truth for:

  • Complete MCP tool reference (28 tools)
  • API endpoint documentation
  • Environment variable configuration (incl. EPISODIC_*)
  • 9-node LangGraph pipeline details
  • All four CoALA memory tiers (Working / Episodic / Semantic / Procedural)

For the framework explainer (read this first): see docs/tutorials/coala-explainer.md — what CoALA is and where each tier lives in the WARNERCO codebase.

For the classroom demo: see docs/tutorials/coala-memory-walkthrough.md — the ~4-minute four-tier classroom path.


MCP Client Configuration

Claude Desktop

Windows: %APPDATA%\Claude\claude_desktop_config.json Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

json
{
  "mcpServers": {
    "warnerco": {
      "command": "uv",
      "args": ["run", "warnerco-mcp"],
      "cwd": "C:/github/context-engineering/src/warnerco/backend"
    }
  }
}

Claude Code (project scope)

.claude/mcp.json is checked in with two entries pointing at the same server: claude-warnerco-schematica and claude-warnerco-coala-memory (the second pre-pins the episodic-memory env vars for class demos).

VS Code Copilot

.vscode/mcp.json is checked in with a single vscode-warnerco-schematica entry (MEMORY_BACKEND=chroma) plus the GitHub Copilot remote MCP server ghcopilot-warner. To list servers in VS Code: Cmd/Ctrl+Shift+P → MCP: List Servers.


Testing with MCP Inspector

bash
npx @modelcontextprotocol/inspector uv run warnerco-mcp
# Opens http://localhost:6274

Resources


Your Instructor

Tim Warner

Microsoft MVP - Azure AI and Cloud/Datacenter Management Microsoft Certified Trainer (25+ years)


License

MIT License - 2026 Timothy Warner


Now go build AI systems that actually remember!

Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "timothywarner-org-context-engineering": {
      "command": "",
      "args": []
    }
  }
}

Dùng MCP Context Engineering with MCP với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Context Engineering with MCP, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Context Engineering with MCP làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Context Engineering with MCP.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "timothywarner-org-context-engineering": {
      "command": "npx",
      "args": [
        "-y",
        "context-engineering"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Context Engineering with MCP, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Context Engineering with MCP.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Context Engineering with MCP giúp tôi làm việc này không?
Context Engineering with MCP
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Context Engineering with MCP.

Câu hỏi thường gặp

Máy chủ MCP Context Engineering with MCP dùng để làm gì?

Context Engineering with MCP là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Context Engineering with MCP với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Context Engineering with MCP với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Context Engineering with MCP với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Context Engineering with MCP, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Context Engineering with MCP với TypingMind?

Context Engineering with MCP hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Context Engineering with MCP cung cấp những công cụ nào trong TypingMind?

Context Engineering with MCP cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Context Engineering with MCP không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Context Engineering with MCP yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇