A production-ready remote Model Context Protocol (MCP) server that provides OpenPhone functionality through Cloudflare Workers. Send messages, manage contacts, and fetch call transcripts directly from Claude Desktop.
- π± Messaging: Send individual or bulk text messages via OpenPhone
- π₯ Contact Management: Create and manage OpenPhone contacts
- π Call Transcripts: Fetch and analyze call transcripts (Business plan required)
- π OAuth 2.1 + PKCE: Industry-standard authentication with enhanced security
- β‘ Fast: Powered by Cloudflare Workers for global edge deployment
- π¨ Modern UI: Beautiful homepage with setup instructions
- OAuth 2.1 + PKCE: Industry-standard authentication prevents API key exposure
- Stateless Tokens: JWT-style tokens with embedded signatures survive worker restarts
- No URLs Parameters: API keys never exposed in logs, browser history, or referrer headers
- Input Validation: Phone number format validation, message length limits
- Security Headers: CSP, X-Frame-Options, X-Content-Type-Options
- Request Timeouts: 30-second timeout protection
- Error Sanitization: No sensitive information disclosure
The easiest way to connect this MCP server to Claude Desktop:
- Log into your OpenPhone dashboard
- Go to Settings β Integrations β API
- Generate an API key
Method 1: Direct Integration (Recommended)
- Open Claude Desktop
- Go to Settings > Integrations
- Click "Add custom integration"
- Enter:
- Name: OpenPhone
- URL:
https://mcp.openphonelabs.com/sse
- Click "Connect"
- When prompted, enter your OpenPhone API key securely
Method 2: Configuration File
Update your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json
):
{
"mcpServers": {
"openphone": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.openphonelabs.com/sse"
]
}
}
}
π Enhanced Security:
- OAuth 2.1 + PKCE authentication ensures your API keys are never exposed in URLs
- Claude Desktop will securely prompt for your API key during the first connection
- All authentication tokens are stateless and survive Cloudflare Workers restarts
That's it! You should now see OpenPhone tools available in Claude Desktop. You can ask Claude to help with OpenPhone tasks like sending messages or managing contacts.
Tool | Description | Plan Required |
---|---|---|
send-message | Send text messages to any phone number | All plans |
bulk-messages | Send the same message to multiple recipients | All plans |
create-contact | Create contacts with email, phone, and company info | All plans |
fetch-call-transcripts | Fetch and analyze call transcripts | Business plan |
Once configured, you can ask Claude to help with tasks like:
- "Send a text to +1234567890 saying 'Meeting moved to 3pm'"
- "Create a contact for John Smith at Acme Corp with email [email protected] and phone +1555123456"
- "Send a reminder message to my whole team about tomorrow's deadline"
- "Fetch the latest call transcripts from my main business line"
- Node.js and npm
- Wrangler CLI (
npm install -g wrangler
)
-
Clone this repository
-
Install dependencies:
npm install
-
Start development server:
npm run dev
-
Test with MCP Inspector:
npx @modelcontextprotocol/inspector@latest
- Set Transport Type to "SSE"
- Use URL:
http://localhost:8787/sse
- When prompted, enter your OpenPhone API key
{
"mcpServers": {
"openphone": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8787/sse"
]
}
}
}
wrangler deploy
Your server will be available at https://your-worker.workers.dev/sse
Configure custom routes in wrangler.jsonc
:
{
"routes": [
"mcp.yourdomain.com/*"
]
}
- Runtime: Cloudflare Workers (V8 isolates)
- Framework: MCP SDK with Durable Objects
- API: OpenPhone REST API v1
- Authentication: OAuth 2.1 + PKCE with stateless tokens
- Deployment: Cloudflare edge locations globally
- OAuth 2.1 + PKCE: Industry-standard authentication with Proof Key for Code Exchange
- Stateless Tokens: JWT-style tokens with embedded signatures survive worker restarts
- No URL Parameters: API keys never exposed in URLs, logs, or browser history
- Input Validation: Phone number format, message length, API key format validation
- Security Headers: Content Security Policy, X-Frame-Options, X-Content-Type-Options
- Error Sanitization: Generic error messages prevent information disclosure
- Request Timeouts: 30-second timeout prevents hanging requests
- HTTPS Only: All API communication encrypted
- No Server Storage: API keys never stored server-side
src/
βββ index.ts # Worker entry point + homepage
βββ openphone-api.ts # OpenPhone API client
βββ openphone-mcp-agent.ts # MCP tools implementation
This server implements industry-standard OAuth 2.1 with PKCE (Proof Key for Code Exchange):
- Authorization Endpoint:
/authorize
- Handles consent and API key validation - Token Endpoint:
/token
- Exchanges authorization codes for access tokens - Discovery Endpoint:
/.well-known/oauth-authorization-server
- OAuth metadata - Registration Endpoint:
/register
- Dynamic client registration
- Claude Desktop registers as OAuth client
- User redirected to consent page for API key entry
- Server validates API key against OpenPhone API
- Authorization code generated with embedded API key
- Code exchanged for stateless access token
- Token validates requests to protected MCP endpoints
Set in Cloudflare Workers for additional security:
OPENPHONE_API_KEY
: Pre-configured API key (bypasses OAuth for testing)
- Active OpenPhone account
- API access enabled
- For call transcripts: Business plan subscription
- Claude Desktop application
- MCP configuration access
"No tools available"
- Check your API key is correct and properly formatted
- Ensure you completed the OAuth authentication flow when prompted
- Verify your OpenPhone account has API access enabled
- Check API key length (should be 16-128 characters) and contains only valid characters
- Try restarting Claude Desktop to refresh the OAuth connection
"Error fetching call transcripts"
- Call transcripts require OpenPhone Business plan
- Transcripts are only available for calls where transcription was enabled
- Check that the phone number exists in your workspace
Connection timeout
- Verify Claude Desktop configuration syntax
- Check internet connectivity
- Try restarting Claude Desktop
- Check the server homepage at your deployment URL for setup instructions
- Verify API key permissions in OpenPhone dashboard
- Test connection with MCP Inspector for debugging
This project demonstrates building production-ready remote MCP servers with:
- OAuth 2.1 + PKCE authentication
- Stateless token architecture for Cloudflare Workers
- Modern UI with secure consent flow
- Comprehensive error handling
- Edge deployment with global scalability
Contributions welcome! Please feel free to submit issues and pull requests.
MIT License - feel free to use this as a template for your own MCP servers.
Built with β€οΈ for the Claude Desktop community