abstractapi-mcp-server
Provides email and phone validation tools through Abstract API services, including email format validation, deliverability checking, phone number validation for 190+ countries, and email reputation analysis with security insights.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@abstractapi-mcp-server validate this phone number: +1-415-200-7986"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Abstract API MCP Server
A Model Context Protocol (MCP) server that provides email and phone validation tools using Abstract API services. This server is built with FastMCP, making it easy to integrate validation capabilities into AI applications and workflows.
Overview
This MCP server exposes three main validation tools:
Email Validation: Comprehensive email address validation and verification
Phone Validation: Phone number validation for 190+ countries
Email Reputation: Advanced email reputation analysis with security insights
Related MCP server: revenuebase-mcp-server
Features
Email Validation
Format validation
Deliverability checking
Domain verification
SMTP validation
Detection of disposable/role/catchall emails
Quality scoring
Phone Validation
International phone number validation
Format standardization (international/local)
Country and carrier identification
Phone type detection (mobile, landline, etc.)
Location information
Email Reputation
Comprehensive deliverability analysis
Quality scoring and risk assessment
Sender and organization identification
Domain security analysis (DMARC, SPF)
Data breach history tracking
Fraud and abuse detection
Prerequisites
Python 3.11+
uv (fast Python package installer)
Abstract API key (get one at abstractapi.com)
Installation
Option 1: Using uv (Recommended)
Clone the repository:
git clone https://github.com/avivshafir/abstractapi-mcp-server
cd abstractapi-mcp-serverCreate virtual environment and install dependencies:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install .Set up environment variables:
cp .env.example .env
# Edit .env and add your Abstract API keyOption 2: Using traditional pip
Clone the repository:
git clone https://github.com/avivshafir/abstractapi-mcp-server
cd abstractapi-mcp-serverCreate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtSet up environment variables:
cp .env.example .env
# Edit .env and add your Abstract API keyYour .env file should contain:
ABSTRACT_API_KEY=your_abstract_api_key_hereUsage
Running the MCP Server
The server can be run in stdio mode for integration with MCP clients:
# With uv (if virtual environment is activated)
python server.py
# Or run directly with uv
uv run server.pyFastMCP Framework
This server is built using FastMCP, a Python framework that simplifies MCP server development. FastMCP provides:
Automatic tool registration: Functions decorated with
@mcp.tool()are automatically exposed as MCP toolsType safety: Full type hints and validation
Easy async support: Native async/await support
Simplified server setup: Minimal boilerplate code
Key FastMCP Concepts
from mcp.server.fastmcp import FastMCP
# Initialize the server
mcp = FastMCP("abstract_api")
# Register a tool
@mcp.tool()
async def my_tool(param: str) -> dict:
"""Tool description for AI clients"""
return {"result": param}
# Run the server
mcp.run(transport="stdio")Available Tools
1. Email Validation (verify_email)
Validates email addresses and returns comprehensive information.
Parameters:
email(str): Email address to validate
Example Response:
{
"email": "user@example.com",
"deliverability": "DELIVERABLE",
"quality_score": "0.99",
"is_valid_format": {"value": true, "text": "TRUE"},
"is_free_email": {"value": false, "text": "FALSE"},
"is_disposable_email": {"value": false, "text": "FALSE"},
"is_role_email": {"value": false, "text": "FALSE"},
"is_catchall_email": {"value": false, "text": "FALSE"},
"is_mx_found": {"value": true, "text": "TRUE"},
"is_smtp_valid": {"value": true, "text": "TRUE"}
}2. Phone Validation (validate_phone)
Validates phone numbers from 190+ countries.
Parameters:
phone(str): Phone number to validatecountry(str, optional): ISO country code for context
Example Response:
{
"phone": "14152007986",
"valid": true,
"format": {
"international": "+14152007986",
"local": "(415) 200-7986"
},
"country": {
"code": "US",
"name": "United States",
"prefix": "+1"
},
"location": "California",
"type": "mobile",
"carrier": "T-Mobile USA, Inc."
}3. Email Reputation (check_email_reputation)
Provides comprehensive email reputation analysis including security insights and breach history.
Parameters:
email(str): Email address to analyze
Example Response:
{
"email_address": "benjamin.richard@abstractapi.com",
"email_deliverability": {
"status": "deliverable",
"status_detail": "valid_email",
"is_format_valid": true,
"is_smtp_valid": true,
"is_mx_valid": true,
"mx_records": ["gmail-smtp-in.l.google.com", "..."]
},
"email_quality": {
"score": 0.8,
"is_free_email": false,
"is_username_suspicious": false,
"is_disposable": false,
"is_catchall": true,
"is_subaddress": false,
"is_role": false,
"is_dmarc_enforced": true,
"is_spf_strict": true,
"minimum_age": 1418
},
"email_sender": {
"first_name": "Benjamin",
"last_name": "Richard",
"email_provider_name": "Google",
"organization_name": "Abstract API",
"organization_type": "company"
},
"email_domain": {
"domain": "abstractapi.com",
"domain_age": 1418,
"is_live_site": true,
"registrar": "NAMECHEAP INC",
"date_registered": "2020-05-13",
"date_expires": "2025-05-13",
"is_risky_tld": false
},
"email_risk": {
"address_risk_status": "low",
"domain_risk_status": "low"
},
"email_breaches": {
"total_breaches": 2,
"date_first_breached": "2018-07-23T14:30:00Z",
"date_last_breached": "2019-05-24T14:30:00Z",
"breached_domains": [
{"domain": "apollo.io", "date_breached": "2018-07-23T14:30:00Z"},
{"domain": "canva.com", "date_breached": "2019-05-24T14:30:00Z"}
]
}
}Integration with MCP Clients
Add this server to your mcp configuration:
{
"mcpServers": {
"abstract-api": {
"command": "uv",
"args": ["run", "/path/to/mcp-abstract-api/server.py"],
"env": {
"ABSTRACT_API_KEY": "your_api_key_here"
}
}
}
}Alternatively, if you prefer to use the traditional approach:
{
"mcpServers": {
"abstract-api": {
"command": "python",
"args": ["/path/to/mcp-abstract-api/server.py"],
"env": {
"ABSTRACT_API_KEY": "your_api_key_here"
}
}
}
}Other MCP Clients
This server follows the standard MCP protocol and can be integrated with any MCP-compatible client. The server communicates via stdio transport.
Error Handling
The server includes comprehensive error handling:
API Key Validation: Checks for missing API keys
HTTP Error Handling: Proper handling of API response errors
Input Validation: Type checking and parameter validation
Graceful Degradation: Meaningful error messages for debugging
API Rate Limits
Abstract API has different rate limits based on your plan:
Free plans: 1 request per second
Paid plans: Higher rate limits available
Each API call counts as one credit, regardless of whether the validation succeeds or fails.
Development
Project Structure
mcp-abstract-api/
├── server.py # Main MCP server implementation
├── .env # Environment variables (not in repo)
├── .env.example # Environment template
├── requirements.txt # Python dependencies (pip format)
├── uv.lock # uv lock file for reproducible builds
├── pyproject.toml # Project configuration
├── README.md # This file
└── LICENSE # MIT LicenseAdding New Tools
To add new Abstract API tools:
Add the API endpoint URL as a constant
Create a new function decorated with
@mcp.tool()Add comprehensive docstring with parameter and return descriptions
Implement error handling following the existing pattern
Example:
@mcp.tool()
async def new_validation_tool(param: str) -> dict[str, Any]:
"""
Description of what this tool does.
Args:
param (str): Description of parameter
Returns:
dict[str, Any]: Description of return value
"""
# Implementation here
passContributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For issues related to:
This MCP server: Open an issue in this repository
Abstract API: Contact Abstract API support
FastMCP framework: Check the FastMCP documentation
Acknowledgments
Abstract API for providing the validation services
FastMCP for the MCP server framework
Model Context Protocol for the protocol specification
Available Tools
3 toolscheck_email_reputationA
Analyzes email reputation using Abstract API's Email Reputation service.
This function provides comprehensive email reputation analysis including deliverability,
quality scoring, sender information, domain details, risk assessment, and breach history.
It's designed to help improve delivery rates, clean email lists, and block fraudulent users.
Args:
email (str): The email address to analyze for reputation.
Returns:
dict[str, Any]: A dictionary containing comprehensive reputation analysis. The dictionary
includes the following main sections:
- "email_address" (str): The email address that was analyzed.
- "email_deliverability" (dict): Deliverability information.
- "status" (str): "deliverable", "undeliverable", or "unknown".
- "status_detail" (str): Additional detail (e.g., "valid_email", "invalid_format").
- "is_format_valid" (bool): True if email follows correct format.
- "is_smtp_valid" (bool): True if SMTP check was successful.
- "is_mx_valid" (bool): True if domain has valid MX records.
- "mx_records" (list): List of MX records for the domain.
- "email_quality" (dict): Quality assessment information.
- "score" (float): Confidence score between 0.01 and 0.99.
- "is_free_email" (bool): True if from free provider (Gmail, Yahoo, etc.).
- "is_username_suspicious" (bool): True if username appears auto-generated.
- "is_disposable" (bool): True if from disposable email provider.
- "is_catchall" (bool): True if domain accepts all emails.
- "is_subaddress" (bool): True if uses subaddressing (user+label@domain.com).
- "is_role" (bool): True if role-based address (info@, support@, etc.).
- "is_dmarc_enforced" (bool): True if strict DMARC policy enforced.
- "is_spf_strict" (bool): True if domain enforces strict SPF policy.
- "minimum_age" (int|null): Estimated age of email address in days.
- "email_sender" (dict): Sender information if available.
- "first_name" (str|null): First name associated with email.
- "last_name" (str|null): Last name associated with email.
- "email_provider_name" (str|null): Email provider name (e.g., "Google").
- "organization_name" (str|null): Organization linked to email/domain.
- "organization_type" (str|null): Type of organization (e.g., "company").
- "email_domain" (dict): Domain information.
- "domain" (str): Domain part of the email.
- "domain_age" (int|null): Age of domain in days.
- "is_live_site" (bool|null): True if domain has active website.
- "registrar" (str|null): Domain registrar name.
- "registrar_url" (str|null): Registrar website URL.
- "date_registered" (str|null): Domain registration date.
- "date_last_renewed" (str|null): Last renewal date.
- "date_expires" (str|null): Domain expiration date.
- "is_risky_tld" (bool|null): True if top-level domain is considered risky.
- "email_risk" (dict): Risk assessment.
- "address_risk_status" (str): Risk level for the email address.
- "domain_risk_status" (str): Risk level for the domain.
- "email_breaches" (dict): Data breach information.
- "total_breaches" (int|null): Number of known breaches.
- "date_first_breached" (str|null): Date of first known breach.
- "date_last_breached" (str|null): Date of most recent breach.
- "breached_domains" (list): List of breached domains with dates.
Example:
>>> await check_email_reputation("benjamin.richard@abstractapi.com")
{
"email_address": "benjamin.richard@abstractapi.com",
"email_deliverability": {
"status": "deliverable",
"status_detail": "valid_email",
"is_format_valid": true,
"is_smtp_valid": true,
"is_mx_valid": true,
"mx_records": ["gmail-smtp-in.l.google.com", ...]
},
"email_quality": {
"score": 0.8,
"is_free_email": false,
"is_username_suspicious": false,
"is_disposable": false,
"is_catchall": true,
"is_subaddress": false,
"is_role": false,
"is_dmarc_enforced": true,
"is_spf_strict": true,
"minimum_age": 1418
},
"email_sender": {
"first_name": "Benjamin",
"last_name": "Richard",
"email_provider_name": "Google",
"organization_name": "Abstract API",
"organization_type": "company"
},
"email_domain": {
"domain": "abstractapi.com",
"domain_age": 1418,
"is_live_site": true,
"registrar": "NAMECHEAP INC",
"registrar_url": "http://www.namecheap.com",
"date_registered": "2020-05-13",
"date_last_renewed": "2024-04-13",
"date_expires": "2025-05-13",
"is_risky_tld": false
},
"email_risk": {
"address_risk_status": "low",
"domain_risk_status": "low"
},
"email_breaches": {
"total_breaches": 2,
"date_first_breached": "2018-07-23T14:30:00Z",
"date_last_breached": "2019-05-24T14:30:00Z",
"breached_domains": [
{"domain": "apollo.io", "date_breached": "2018-07-23T14:30:00Z"},
{"domain": "canva.com", "date_breached": "2019-05-24T14:30:00Z"}
]
}
}
Raises:
ValueError: If the API key is not found in the environment variables.
requests.exceptions.HTTPError: If the API request fails (e.g., 4xx or 5xx error).
Exception: For any other unexpected errors.
Inputs: email (required).
validate_phoneA
Validates a phone number using Abstract API's Phone Validation service.
This function checks the validity and other details of phone numbers from over 190 countries.
It returns detailed information about the phone number including format, country, location,
type, and carrier information.
Args:
phone (str): The phone number to validate and verify.
country (str, optional): The country's ISO code to indicate the phone number's country.
This helps the API append the corresponding country code to its analysis.
For example, use "US" for United States numbers.
Returns:
dict[str, Any]: A dictionary containing detailed validation results. The dictionary
includes the following keys:
- "phone" (str): The phone number submitted for validation.
- "valid" (bool): True if the phone number is valid, False otherwise.
- "format" (dict): Object containing international and local formats.
- "international" (str): International format with country code and "+" prefix.
- "local" (str): Local/national format without international formatting.
- "country" (dict): Object containing country details.
- "code" (str): Two-letter ISO 3166-1 alpha-2 country code.
- "name" (str): Name of the country where the phone number is registered.
- "prefix" (str): Country's calling code prefix.
- "location" (str): Location details (region, state/province, sometimes city).
- "type" (str): Type of phone number. Possible values: "Landline", "Mobile",
"Satellite", "Premium", "Paging", "Special", "Toll_Free", "Unknown".
- "carrier" (str): The carrier that the number is registered with.
Example:
>>> await validate_phone("14152007986")
{
"phone": "14152007986",
"valid": true,
"format": {
"international": "+14152007986",
"local": "(415) 200-7986"
},
"country": {
"code": "US",
"name": "United States",
"prefix": "+1"
},
"location": "California",
"type": "mobile",
"carrier": "T-Mobile USA, Inc."
}
>>> await validate_phone("2007986", "US")
# Will validate with US country context
Raises:
ValueError: If the API key is not found in the environment variables.
requests.exceptions.HTTPError: If the API request fails (e.g., 4xx or 5xx error).
Exception: For any other unexpected errors.
Inputs: phone (required), country.
verify_emailA
Validates an email address using an external email validation API of abstractapi.
This function checks the validity, deliverability, and other attributes of an email address.
It returns a detailed dictionary containing information about the email's format, domain,
and SMTP server.
Args:
email (str): The email address to validate.
Returns:
dict[str, Any]: A dictionary containing detailed validation results. The dictionary
includes the following keys:
- "email" (str): The email address being validated.
- "autocorrect" (str): Suggested autocorrection if the email is invalid or malformed.
- "deliverability" (str): The deliverability status of the email (e.g., "DELIVERABLE").
- "quality_score" (str): A score representing the quality of the email address.
- "is_valid_format" (dict): Whether the email is in a valid format.
- "value" (bool): True if the format is valid, False otherwise.
- "text" (str): A textual representation of the format validity (e.g., "TRUE").
- "is_free_email" (dict): Whether the email is from a free email provider.
- "value" (bool): True if the email is from a free provider, False otherwise.
- "text" (str): A textual representation (e.g., "TRUE").
- "is_disposable_email" (dict): Whether the email is from a disposable email service.
- "value" (bool): True if the email is disposable, False otherwise.
- "text" (str): A textual representation (e.g., "FALSE").
- "is_role_email" (dict): Whether the email is a role-based email (e.g., "admin@domain.com").
- "value" (bool): True if the email is role-based, False otherwise.
- "text" (str): A textual representation (e.g., "FALSE").
- "is_catchall_email" (dict): Whether the domain uses a catch-all email address.
- "value" (bool): True if the domain is catch-all, False otherwise.
- "text" (str): A textual representation (e.g., "FALSE").
- "is_mx_found" (dict): Whether MX records are found for the email domain.
- "value" (bool): True if MX records are found, False otherwise.
- "text" (str): A textual representation (e.g., "TRUE").
- "is_smtp_valid" (dict): Whether the SMTP server for the email domain is valid.
- "value" (bool): True if the SMTP server is valid, False otherwise.
- "text" (str): A textual representation (e.g., "TRUE").
Example:
>>> await verify_email("thanos@snap.io")
{
"email": "thanos@snap.io",
"autocorrect": "",
"deliverability": "UNDELIVERABLE",
"quality_score": "0.00",
"is_valid_format": {
"value": true,
"text": "TRUE"
},
"is_free_email": {
"value": false,
"text": "FALSE"
},
"is_disposable_email": {
"value": false,
"text": "FALSE"
},
"is_role_email": {
"value": false,
"text": "FALSE"
},
"is_catchall_email": {
"value": false,
"text": "FALSE"
},
"is_mx_found": {
"value": false,
"text": "FALSE"
},
"is_smtp_valid": {
"value": false,
"text": "FALSE"
}
}
Raises:
ValueError: If the API key is not found in the environment variables.
requests.exceptions.HTTPError: If the API request fails (e.g., 4xx or 5xx error).
Exception: For any other unexpected errors.
Inputs: email (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The tools have significant overlap and unclear boundaries. Both check_email_reputation and verify_email perform email validation with substantial functional overlap, making it difficult for an agent to choose between them. The phone validation tool is distinct, but the email tools appear to do similar things with different emphasis.
The naming follows a mixed pattern. Two tools use verb_noun format (check_email_reputation, verify_email) while one uses verb_noun format but with different verb style (validate_phone). The naming is readable but lacks complete consistency in verb choice across the set.
With only 3 tools, the server feels thin for an 'abstractapi-mcp-server' that presumably covers multiple Abstract API services. While the tools themselves are substantial, the count suggests limited coverage of what Abstract API likely offers, making the server feel under-scoped.
For an Abstract API server, there are significant gaps in coverage. The server only covers email and phone validation, missing other Abstract API services like IP geolocation, exchange rates, holidays, etc. Even within the covered domains, there's redundancy rather than comprehensive functionality.
Maintenance
Related MCP Connectors
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
The official MCP Server for the Mux API
Official IPinfo MCP Server - IP intelligence tools for AI assistants
Related MCP Servers
- MIT
- MIT
- -
- AlicenseAqualityBmaintenanceOfficial IPGeolocation.io MCP server for accurate IP geolocation, company information, ASN and network data, IP security (VPN, proxy, Tor, bot, hosting and spam detection), abuse contacts, time zones, astronomy, currency data and user-agent parsing. Its 17 tools support bulk lookups and cached-result pagination. Local stdio installation requires Node.js 22 or later. API plan restrictions apply.17387 npm6MIT