String Utilities

Extract Emails

Extracts all valid email addresses from any text input using regex pattern matching. Access via MCP in Cursor or Windsurf, or call GET /v1/string/extract-emails directly. Pass "contact us at [email protected] or [email protected]" and get back a clean array: ["[email protected]", "[email protected]"]. Handles complex formats including plus addressing and international domains.

API Endpoint

GET /v1/string/extract-emails

Code Examples

curl "https://tinyfn.io/v1/string/extract-emails" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/extract-emails', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/string/extract-emails',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's string tools:

{
  "mcpServers": {
    "tinyfn-string": {
      "url": "https://tinyfn.io/mcp/string",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I extract emails from text using MCP in Cursor?

Use the extract_emails tool in Cursor with your text as input. It returns a JSON array of all found email addresses, perfect for processing contact lists or parsing documents.

What email formats does the extraction support?

Supports standard formats ([email protected]), plus addressing ([email protected]), subdomains ([email protected]), and international domains. Filters out malformed addresses automatically.

Does it extract emails from HTML or only plain text?

Works with any text input including HTML, markdown, or plain text. It ignores HTML tags and extracts only the actual email addresses from the content.

What happens if no emails are found in the text?

Returns an empty array [] when no valid email addresses are detected. The function never fails - it always returns a valid JSON response.

Can I use this to validate if text contains specific email patterns?

Yes, check if the returned array contains your target email or use the array length to count total emails found. Useful for form validation or content analysis.

Try Extract Emails Now

Get your free API key and start using Extract Emails in seconds.

Get Free API Key