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.
Cloudflare Workers (WASM)
❱
9.1.
WASM Considerations
10.
Google Cloud Run
❱
10.1.
Container-Based Deployment
10.2.
Auto-Scaling Configuration
10.3.
Comparison with Lambda
Part IV: Testing
11.
Local Testing
❱
11.1.
MCP Inspector Deep Dive
11.2.
mcp-tester Introduction
11.3.
Schema-Driven Test Generation
11.4.
Chapter 11 Exercises
12.
Remote Testing
❱
12.1.
Testing Deployed Servers
12.2.
CI/CD Integration
12.3.
Regression Testing
12.4.
Chapter 12 Exercises
Part V: Enterprise Security
13.
OAuth for MCP
❱
13.1.
Why OAuth, Not API Keys
13.2.
OAuth 2.0 Fundamentals
13.3.
Token Validation
13.4.
Chapter 13 Exercises
14.
Identity Provider Integration
❱
14.1.
AWS Cognito
14.2.
Auth0
14.3.
Microsoft Entra ID
14.4.
Multi-Tenant Considerations
Part VI: AI-Assisted Development
15.
AI-Assisted MCP Development
❱
15.1.
The AI-Compiler Feedback Loop
15.2.
Setting Up Claude Code
15.3.
Alternative AI Assistants
16.
Effective AI Collaboration
❱
16.1.
The Development Workflow
16.2.
Prompting for MCP Tools
16.3.
Quality Assurance with AI
Part VII: Observability
17.
Middleware and Instrumentation
❱
17.1.
Middleware Architecture
17.2.
Logging Best Practices
17.3.
Metrics Collection
17.4.
Chapter 17 Exercises
18.
Operations and Monitoring
❱
18.1.
pmcp.run Dashboard
18.2.
Alerting and Incidents
18.3.
Performance Optimization
Part VIII: Advanced Patterns
19.
Server Composition
❱
19.1.
Foundation Servers
19.2.
Domain Servers
19.3.
Orchestration Patterns
19.4.
Chapter 19 Exercises
20.
MCP Applications
❱
20.1.
Building UIs for MCP
20.2.
High Availability
20.3.
Migration Strategies
20.4.
Chapter 20 Exercises
Appendices
21.
Appendix A: cargo pmcp Reference
22.
Appendix B: Template Gallery
23.
Appendix C: Troubleshooting
24.
Appendix D: Security Checklist
Light
Rust
Coal
Navy
Ayu
Advanced MCP: Enterprise-Grade AI Integration with Rust
Alerting and Incidents