8.8 KiB
A2P AutoPilot MCP Server — Deployment Guide
✅ What Was Built
A complete, production-ready MCP Server with 4 interactive UI apps for managing A2P registrations in Claude Desktop.
📁 File Structure
a2p-autopilot/mcp-app/
├── server.ts # Main MCP server (stdio transport)
├── package.json # Dependencies & scripts
├── tsconfig.json # TypeScript config
├── build-all.js # Build script for all apps
├── README.md # Documentation
├── .gitignore # Git ignore patterns
│
├── src/ # Core server logic
│ ├── tools.ts # All 9 MCP tool definitions
│ ├── handlers.ts # Tool execution handlers
│ ├── resources.ts # UI resource registration
│ └── mock-data.ts # Realistic test data (10 submissions)
│
├── apps/ # 4 React apps (Vite)
│ ├── registration-wizard/
│ │ ├── App.tsx # Multi-step registration form
│ │ ├── main.tsx # React entry point
│ │ ├── index.html # HTML template
│ │ └── vite.config.ts # Vite single-file build config
│ ├── dashboard/
│ │ ├── App.tsx # Submissions list with filters
│ │ ├── main.tsx
│ │ ├── index.html
│ │ └── vite.config.ts
│ ├── submission-detail/
│ │ ├── App.tsx # Deep dive: SID chain, timeline, details
│ │ ├── main.tsx
│ │ ├── index.html
│ │ └── vite.config.ts
│ └── landing-preview/
│ ├── App.tsx # Preview opt-in/privacy/terms pages
│ ├── main.tsx
│ ├── index.html
│ └── vite.config.ts
│
├── components/ # Shared React components
│ ├── layout/
│ │ ├── PageHeader.tsx # App header with title & actions
│ │ ├── Card.tsx # Card container
│ │ ├── StepProgress.tsx # Multi-step progress indicator
│ │ └── Section.tsx # Content section
│ ├── data/
│ │ ├── StatusBadge.tsx # Color-coded status badges
│ │ ├── DataTable.tsx # Generic sortable table
│ │ ├── MetricCard.tsx # Dashboard metric cards
│ │ ├── Timeline.tsx # Event timeline
│ │ └── SidChainTracker.tsx # Visual SID chain progress
│ ├── forms/
│ │ ├── FormField.tsx # Text input with validation
│ │ ├── SelectField.tsx # Dropdown select
│ │ ├── PhoneInput.tsx # Phone number input with formatting
│ │ ├── EINInput.tsx # EIN input with XX-XXXXXXX formatting
│ │ └── FormSection.tsx # Form section container
│ └── shared/
│ ├── Button.tsx # Button with variants & loading state
│ ├── Modal.tsx # Modal dialog
│ ├── Toast.tsx # Toast notifications
│ └── ComplianceChecklist.tsx # Checkbox list for compliance
│
├── hooks/
│ ├── useMCPApp.ts # Hook to access MCP context data
│ └── useSmartAction.ts # Hook to call MCP tools from apps
│
└── styles/
└── base.css # Global CSS variables & utilities
🛠️ Setup Instructions
1. Install Dependencies
cd a2p-autopilot/mcp-app
npm install
2. Build UI Apps
npm run build:ui
This runs build-all.js, which builds all 4 apps as single-file HTML bundles:
dist/app-ui/registration-wizard.htmldist/app-ui/dashboard.htmldist/app-ui/submission-detail.htmldist/app-ui/landing-preview.html
3. Test the Server
npm run serve
The server runs on stdio. Test by piping JSON-RPC commands:
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | npm run serve
4. Add to Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"a2p-autopilot": {
"command": "node",
"args": [
"/Users/jakeshore/.clawdbot/workspace/a2p-autopilot/mcp-app/server.ts"
],
"env": {
"A2P_API_URL": "http://localhost:3100",
"USE_MOCK_DATA": "true"
}
}
}
}
Restart Claude Desktop.
🧪 Testing
Using Mock Data (Default)
The server defaults to USE_MOCK_DATA=true, which uses the 10 realistic mock submissions in src/mock-data.ts.
Using Live API
Set USE_MOCK_DATA=false and ensure the A2P AutoPilot backend is running on localhost:3100.
Test Commands in Claude
Open the A2P registration wizard
Show me the A2P dashboard
View submission sub_1
Preview landing pages for sub_1
📊 MCP Tools
UI Tools (Model + App Visible)
-
a2p_registration_wizard — Opens multi-step registration form
- Optional:
externalIdto pre-fill data - Returns:
ui://a2p/registration-wizard
- Optional:
-
a2p_dashboard — Opens submissions dashboard
- Optional:
statusfilter - Returns:
ui://a2p/dashboardwith submissions & stats
- Optional:
-
a2p_view_submission — Opens detailed submission view
- Required:
submissionId - Returns:
ui://a2p/submission-detailwith full data
- Required:
-
a2p_preview_landing — Previews landing pages
- Required:
submissionId - Returns:
ui://a2p/landing-previewwith page URLs
- Required:
Backend Tools (App-Only Visibility)
-
a2p_submit_registration — Submit new registration
- Takes full
RegistrationInputobject - Returns: submission ID & status
- Takes full
-
a2p_retry_submission — Retry failed submission
- Required:
submissionId
- Required:
-
a2p_cancel_submission — Cancel pending submission
- Required:
submissionId
- Required:
-
a2p_check_status — Refresh submission status
- Required:
submissionId
- Required:
-
a2p_get_stats — Get dashboard statistics
- Returns: counts by status, success rate
🎨 UI Features
Registration Wizard
- 5-step form: Business Info → Authorized Rep → Address → Campaign → Review
- Form validation with real-time feedback
- Pre-fill support via
externalId - EIN & phone number formatting
- Industry & use case dropdowns
Dashboard
- Metric cards: Total, Completed, Pending, Success Rate
- Status filter buttons
- Sortable submissions table
- Click any row to view details
Submission Detail
- Current status with badge
- Failure reason display (if applicable)
- Full SID chain tracker (10 Twilio SIDs)
- Activity timeline with timestamps
- Retry/Cancel/Refresh actions
- Business & campaign details
- Remediation history
Landing Preview
- 3-page preview: Landing, Privacy Policy, Terms
- Tab navigation
- Generated content based on campaign data
- Sample messages display
- Opt-in/opt-out instructions
🔧 Development
Run Single App in Dev Mode
cd apps/registration-wizard
npx vite
Opens on http://localhost:5173 with hot reload.
Rebuild After Changes
npm run build:ui
Add New Component
- Create in
components/{category}/ - Import in app:
import { MyComponent } from '../../components/{category}/MyComponent' - Use Tailwind classes for styling
📝 Type Safety
All types are imported from ../src/types.ts:
RegistrationInputSubmissionRecordSubmissionStatusSidChain- Business/Campaign enums
🚀 Next Steps
- Connect to Real API: Set
USE_MOCK_DATA=falseand test with live backend - Add More Tools:
a2p_bulk_importfor CSV importsa2p_export_reportfor analytics
- Enhance UI:
- Add charts to dashboard (success rate over time)
- Add search/sort to table
- Add bulk actions (retry multiple submissions)
- Add Notifications: Show real-time status updates via webhooks
🐛 Troubleshooting
"Resource not found" error
- Run
npm run build:uito generate HTML bundles - Check
dist/app-ui/contains 4 HTML files
Server won't start
- Verify
nodeandtsxare installed:npm install -g tsx - Check logs:
npm run serve 2>&1 | tee server.log
UI doesn't show data
- Verify
window.mcpContextis set (check browser console) - Check mock data in
src/mock-data.ts
📦 Production Checklist
- Build all apps:
npm run build:ui - Set
USE_MOCK_DATA=false - Configure
A2P_API_URLto production endpoint - Test all 9 tools in Claude Desktop
- Verify error handling (network failures, validation errors)
- Check mobile responsiveness (Tailwind is mobile-first)
- Add logging/monitoring for tool calls
Built by: Subagent (a2p-mcp-server)
Date: February 3, 2026
Status: ✅ Ready for testing