Introduction
Prerequisites
Part I: Foundations
1.
The Enterprise Case for MCP
❱
1.1.
The AI Integration Problem
1.2.
Why MCP Over Alternatives
1.3.
Why Rust for Enterprise
2.
Your First Production Server
❱
2.1.
Development Environment Setup
2.2.
Building and Running
2.3.
The Calculator Server
2.4.
Understanding the Generated Code
2.5.
Testing with MCP Inspector
2.6.
Chapter 2 Exercises
❱
2.6.1.
Exercise: Environment Setup
2.6.2.
Exercise: Your First MCP Server
2.6.3.
Exercise: The Calculator Tool
2.6.4.
Exercise: Code Review Challenge
3.
Database MCP Servers
❱
3.1.
The Enterprise Data Access Problem
3.2.
Building db-explorer
3.3.
SQL Safety and Injection Prevention
3.4.
Resource-Based Data Patterns
3.5.
Handling Large Results
3.6.
Chapter 3 Exercises
❱
3.6.1.
Exercise: Building a Database Query Tool
3.6.2.
Exercise: SQL Injection Code Review
3.6.3.
Exercise: Pagination Patterns
Part II: Thoughtful Design
4.
Beyond Tool Sprawl
❱
4.1.
The Anti-Pattern: 50 Confusing Tools
4.2.
Cohesive API Design
4.3.
Single Responsibility for Tools
4.4.
Chapter 4 Exercises
❱
4.4.1.
Exercise: Tool Design Review
5.
Input Validation and Output Schemas
❱
5.1.
Schema-Driven Validation
5.2.
Output Schemas for Composition
5.3.
Type-Safe Tool Annotations
5.4.
Chapter 5 Exercises
❱
5.4.1.
Exercise: Validation Errors for AI
6.
Resources, Prompts, and Workflows
❱
6.1.
When to Use Resources vs Tools
6.2.
Prompts as Workflow Templates
6.3.
Designing Multi-Step Workflows
6.4.
Chapter 6 Exercises
❱
6.4.1.
Exercise: Prompt Design Workshop
6.4.2.
Exercise: Building and Validating Hard Workflows
Part III: Cloud Deployment
7.
Deployment Overview
❱
7.1.
Serverless vs Containers vs Edge
7.2.
Cost Analysis Framework
7.3.
Security Boundaries
8.
AWS Lambda Deployment
❱
8.1.
Connecting Clients
8.2.
Chapter 8 Exercises
9.
Config-Driven SQL Servers: From Scaffold to Lambda
10.
Config-Driven OpenAPI Servers: From Scaffold to Deploy
11.
OpenAPI over Microsoft Graph (Contoso M365)
12.
Config-Driven Workbook Servers: From Spreadsheet to Served MCP
13.
Authoring Workbooks as MCP Tools: The Table Contract
14.
Cloudflare Workers (WASM)
❱
14.1.
WASM Considerations
15.
Google Cloud Run
❱
15.1.
Container-Based Deployment
15.2.
Auto-Scaling Configuration
15.3.
Comparison with Lambda
16.
Azure Container Apps
Part IV: Testing
17.
Local Testing
❱
17.1.
MCP Inspector Deep Dive
17.2.
mcp-tester Introduction
17.3.
Schema-Driven Test Generation
17.4.
Chapter 11 Exercises
18.
Remote Testing
❱
18.1.
Testing Deployed Servers
18.2.
CI/CD Integration
18.3.
Regression Testing
18.4.
Chapter 12 Exercises
Part V: Enterprise Security
19.
OAuth for MCP
❱
19.1.
Why OAuth, Not API Keys
19.2.
OAuth 2.0 Fundamentals
19.3.
Token Validation
19.4.
Chapter 13 Exercises
20.
Identity Provider Integration
❱
20.1.
AWS Cognito
20.2.
Auth0
20.3.
Microsoft Entra ID
20.4.
Multi-Tenant Considerations
Part VI: AI-Assisted Development
21.
AI-Assisted MCP Development
❱
21.1.
The AI-Compiler Feedback Loop
21.2.
Setting Up Claude Code
21.3.
Alternative AI Assistants
22.
Effective AI Collaboration
❱
22.1.
The Development Workflow
22.2.
Prompting for MCP Tools
22.3.
Quality Assurance with AI
Part VII: Observability
23.
Middleware and Instrumentation
❱
23.1.
Middleware Architecture
23.2.
Logging Best Practices
23.3.
Metrics Collection
23.4.
Chapter 17 Exercises
24.
Operations and Monitoring
❱
24.1.
pmcp.run Dashboard
24.2.
Alerting and Incidents
24.3.
Performance Optimization
24.4.
Chapter 18 Exercises
Part VIII: Advanced Patterns
25.
Server Composition
❱
25.1.
Foundation Servers
25.2.
Domain Servers
25.3.
Orchestration Patterns
25.4.
Chapter 19 Exercises
26.
MCP Apps: Interactive Widgets
❱
26.1.
Widget Authoring and Developer Workflow
26.2.
Bridge Communication and Adapters
26.3.
Example Walkthroughs
26.4.
Chapter 20 Exercises
27.
MCP Tasks: Long-Running Operations
❱
27.1.
Task Lifecycle and Polling
27.2.
Capability Negotiation
27.3.
Chapter 21 Exercises
28.
Code Mode: Validated LLM Code Execution
❱
28.1.
Chapter 22 Exercises
29.
Skills: Agent Workflow Instructions
❱
29.1.
Chapter 23 Exercises
Appendices
30.
Appendix A: cargo pmcp Reference
31.
Appendix B: Template Gallery
32.
Appendix C: Troubleshooting
33.
Appendix D: Security Checklist
Light
Rust
Coal
Navy
Ayu
Advanced MCP: Enterprise-Grade AI Integration with Rust
Appendix C: Troubleshooting