FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
prashamtrivedi
prashamtrivedimcpTwilioHelper
Public
Like
mcpTwilioHelper
Home
Code
2
README.md
S
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
README.md

MCP Twilio Helper

This val was added by the MCP tool to provide utility functions for working with Twilio in Val Town.

Functions

  • generateSmsResponse(message): Creates a formatted TwiML response for SMS.
  • parseTwilioRequest(request): Parses Twilio webhook form data from a request.
  • validateTwilioRequest(request, authToken): Validates that a request is coming from Twilio.
  • createTwimlResponse(twimlContent): Creates a Response with proper TwiML headers.
  • addedByMCP(): Returns true to indicate this val was added by the MCP tool.

Each function includes an indicator that it was added by the MCP tool, either through:

  • The _addedByMCP: "true" property in returned objects
  • The X-Created-By: "MCP-Tool" header in responses
  • The dedicated addedByMCP() function

Usage Example

import { mcpTwilioHelper } from "https://esm.town/v/prashamtrivedi/mcpTwilioHelper"; export default async function(request: Request): Promise<Response> { const twilioData = await mcpTwilioHelper.parseTwilioRequest(request); // Handle the SMS message const responseMessage = `Hello ${twilioData.From}! You said: ${twilioData.Body}`; // Generate and return a TwiML response const twiml = mcpTwilioHelper.generateSmsResponse(responseMessage); return mcpTwilioHelper.createTwimlResponse(twiml); }
Code
README.md
S
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.