Model Context Protocol (MCP): Build Production-Grade AI Infrastructure with Python, PostgreSQL, and OpenTelemetry
“Stop Hand-Wiring Agents. Build the MCP Infrastructure They Deserve.”
Replace hand-wired LLM database clients with a stateful, access-controlled, fully auditable MCP server that survives a SOC 2 review.
One-time · Lifetime access · Certificate included
- ✓6 modules of content
- ✓47 concept slides
- ✓18 practical exercises
- ✓24 quiz questions
- ✓Capstone project
- ✓LearnAspire certificate
Learning Outcomes
What you'll learn
The day after you finish
The day after completing this course, you will open your company's internal PostgreSQL service, create a new MCP Python SDK 1.9.x server module that registers a resources/read handler scoped to the calling agent's JWT identity, wire asyncpg SET LOCAL role to enforce your existing row-level security policies, attach an OpenTelemetry OTLP exporter pointed at your Grafana Tempo instance, and run your pytest-asyncio contract suite against it — replacing your current hardcoded SQL client with zero loss of functionality and a passing audit trail before your next standup.
Who this is for
- Primary: Staff or Principal Platform Engineer (6–10 years) shipping LLM-powered features in production who needs to replace bespoke SQL-to-agent bridges with auditable MCP infrastructure
- Secondary: AI Systems Architect designing internal tool-use layers for multi-agent pipelines and responsible for security review readiness
- Tertiary: Senior Backend Engineer maintaining internal API gateways who will integrate with or review the MCP server layer produced by this course
Prerequisites
- Production experience with async Python (asyncio, async/await, async context managers) — the course never defines these
- Hands-on experience consuming LLM APIs using tool_use / function-calling patterns (OpenAI or Anthropic format)
- Working knowledge of PostgreSQL query design, connection pooling, and JSON column handling
- Familiarity with JWT or bearer-token authentication flows in REST API middleware
Curriculum
6 modules · full breakdown
🤖 Part of: AI Engineering Path
Capstone Project
Acme Financial Services MCP Server — Production Deployment with Row-Level Security, Sampling Delegation, and Audit Dashboard
Learners build and ship a complete MCP server in Python 3.12 using MCP Python SDK 1.9.x that exposes the Acme Financial Services customer_accounts and underwriting_documents PostgreSQL 16.3 schema. The server enforces per-agent row-level security via asyncpg SET LOCAL role, delegates LLM completions through MCP sampling extensions using the Anthropic Python SDK 0.28 against claude-3-7-sonnet-20250219, emits structured OpenTelemetry spans to Grafana Tempo 2.4 via OTLP, and is containerised with Docker Compose 2.27. The submission is validated by a provided pytest-asyncio 0.23 contract test harness run by automated grader — not a rubric.
What you'll deliver
A GitHub repository containing: (1) a runnable Docker Compose stack with the MCP server, PostgreSQL 16.3 with row_security enabled, and Grafana Tempo; (2) a pytest-asyncio contract test suite with all tests passing; (3) a Grafana dashboard JSON file for agent audit trail queries; (4) an Architecture Decision Record markdown file documenting the resource scoping design choices suitable for team wiki publication
Portfolio value
Design, secure, and operate a production MCP server that enforces agent identity through PostgreSQL row-level security, delegates LLM sampling with token budgets, and emits full observability to Grafana Tempo—proving mastery of enterprise AI infrastructure as a full-stack owner.