1. Introduction
  2. Prerequisites
  3. Part I: Foundations
  4. 1. The Enterprise Case for MCP
    ❱
    1. 1.1. The AI Integration Problem
    2. 1.2. Why MCP Over Alternatives
    3. 1.3. Why Rust for Enterprise
  5. 2. Your First Production Server
    ❱
    1. 2.1. Development Environment Setup
    2. 2.2. Building and Running
    3. 2.3. The Calculator Server
    4. 2.4. Understanding the Generated Code
    5. 2.5. Testing with MCP Inspector
    6. 2.6. Chapter 2 Exercises
      ❱
      1. 2.6.1. Exercise: Environment Setup
      2. 2.6.2. Exercise: Your First MCP Server
      3. 2.6.3. Exercise: The Calculator Tool
      4. 2.6.4. Exercise: Code Review Challenge
  6. 3. Database MCP Servers
    ❱
    1. 3.1. The Enterprise Data Access Problem
    2. 3.2. Building db-explorer
    3. 3.3. SQL Safety and Injection Prevention
    4. 3.4. Resource-Based Data Patterns
    5. 3.5. Handling Large Results
    6. 3.6. Chapter 3 Exercises
      ❱
      1. 3.6.1. Exercise: Building a Database Query Tool
      2. 3.6.2. Exercise: SQL Injection Code Review
      3. 3.6.3. Exercise: Pagination Patterns
  7. Part II: Thoughtful Design
  8. 4. Beyond Tool Sprawl
    ❱
    1. 4.1. The Anti-Pattern: 50 Confusing Tools
    2. 4.2. Cohesive API Design
    3. 4.3. Single Responsibility for Tools
    4. 4.4. Chapter 4 Exercises
      ❱
      1. 4.4.1. Exercise: Tool Design Review
  9. 5. Input Validation and Output Schemas
    ❱
    1. 5.1. Schema-Driven Validation
    2. 5.2. Output Schemas for Composition
    3. 5.3. Type-Safe Tool Annotations
    4. 5.4. Chapter 5 Exercises
      ❱
      1. 5.4.1. Exercise: Validation Errors for AI
  10. 6. Resources, Prompts, and Workflows
    ❱
    1. 6.1. When to Use Resources vs Tools
    2. 6.2. Prompts as Workflow Templates
    3. 6.3. Designing Multi-Step Workflows
    4. 6.4. Chapter 6 Exercises
      ❱
      1. 6.4.1. Exercise: Prompt Design Workshop
      2. 6.4.2. Exercise: Building and Validating Hard Workflows
  11. Part III: Cloud Deployment
  12. 7. Deployment Overview
    ❱
    1. 7.1. Serverless vs Containers vs Edge
    2. 7.2. Cost Analysis Framework
    3. 7.3. Security Boundaries
  13. 8. AWS Lambda Deployment
    ❱
    1. 8.1. Connecting Clients
    2. 8.2. Chapter 8 Exercises
  14. 9. Cloudflare Workers (WASM)
    ❱
    1. 9.1. WASM Considerations
  15. 10. Google Cloud Run
    ❱
    1. 10.1. Container-Based Deployment
    2. 10.2. Auto-Scaling Configuration
    3. 10.3. Comparison with Lambda
  16. Part IV: Testing
  17. 11. Local Testing
    ❱
    1. 11.1. MCP Inspector Deep Dive
    2. 11.2. mcp-tester Introduction
    3. 11.3. Schema-Driven Test Generation
    4. 11.4. Chapter 11 Exercises
  18. 12. Remote Testing
    ❱
    1. 12.1. Testing Deployed Servers
    2. 12.2. CI/CD Integration
    3. 12.3. Regression Testing
    4. 12.4. Chapter 12 Exercises
  19. Part V: Enterprise Security
  20. 13. OAuth for MCP
    ❱
    1. 13.1. Why OAuth, Not API Keys
    2. 13.2. OAuth 2.0 Fundamentals
    3. 13.3. Token Validation
    4. 13.4. Chapter 13 Exercises
  21. 14. Identity Provider Integration
    ❱
    1. 14.1. AWS Cognito
    2. 14.2. Auth0
    3. 14.3. Microsoft Entra ID
    4. 14.4. Multi-Tenant Considerations
  22. Part VI: AI-Assisted Development
  23. 15. AI-Assisted MCP Development
    ❱
    1. 15.1. The AI-Compiler Feedback Loop
    2. 15.2. Setting Up Claude Code
    3. 15.3. Alternative AI Assistants
  24. 16. Effective AI Collaboration
    ❱
    1. 16.1. The Development Workflow
    2. 16.2. Prompting for MCP Tools
    3. 16.3. Quality Assurance with AI
  25. Part VII: Observability
  26. 17. Middleware and Instrumentation
    ❱
    1. 17.1. Middleware Architecture
    2. 17.2. Logging Best Practices
    3. 17.3. Metrics Collection
    4. 17.4. Chapter 17 Exercises
  27. 18. Operations and Monitoring
    ❱
    1. 18.1. pmcp.run Dashboard
    2. 18.2. Alerting and Incidents
    3. 18.3. Performance Optimization
  28. Part VIII: Advanced Patterns
  29. 19. Server Composition
    ❱
    1. 19.1. Foundation Servers
    2. 19.2. Domain Servers
    3. 19.3. Orchestration Patterns
    4. 19.4. Chapter 19 Exercises
  30. 20. MCP Applications
    ❱
    1. 20.1. Building UIs for MCP
    2. 20.2. High Availability
    3. 20.3. Migration Strategies
    4. 20.4. Chapter 20 Exercises
  31. Appendices
  32. 21. Appendix A: cargo pmcp Reference
  33. 22. Appendix B: Template Gallery
  34. 23. Appendix C: Troubleshooting
  35. 24. Appendix D: Security Checklist

Advanced MCP: Enterprise-Grade AI Integration with Rust

Appendix B: Template Gallery