byteplant-mcp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- byteplant_mcp-0.1.0/PKG-INFO +96 -0
- byteplant_mcp-0.1.0/README.md +87 -0
- byteplant_mcp-0.1.0/pyproject.toml +10 -0
- byteplant_mcp-0.1.0/setup.cfg +4 -0
- byteplant_mcp-0.1.0/src/byteplant-mcp/__init__.py +0 -0
- byteplant_mcp-0.1.0/src/byteplant-mcp/__main__.py +4 -0
- byteplant_mcp-0.1.0/src/byteplant-mcp/server.py +208 -0
- byteplant_mcp-0.1.0/src/byteplant_mcp.egg-info/PKG-INFO +96 -0
- byteplant_mcp-0.1.0/src/byteplant_mcp.egg-info/SOURCES.txt +10 -0
- byteplant_mcp-0.1.0/src/byteplant_mcp.egg-info/dependency_links.txt +1 -0
- byteplant_mcp-0.1.0/src/byteplant_mcp.egg-info/requires.txt +2 -0
- byteplant_mcp-0.1.0/src/byteplant_mcp.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: byteplant-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Byteplant's Email Validator, Phone Validator and Address Validator MCP Server
|
|
5
|
+
Requires-Python: >=3.12
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: mcp[cli]>=1.23.1
|
|
8
|
+
Requires-Dist: requests>=2.32.5
|
|
9
|
+
|
|
10
|
+
<!-- mcp-name: io.github.byteplant-dev/byteplant-mcp -->
|
|
11
|
+
# Byteplant Validator MCP Server
|
|
12
|
+
Email, Phone Number, and Address Validation for the Model Context Protocol (MCP)
|
|
13
|
+
|
|
14
|
+
This package provides an MCP server that uses Byteplant’s Email Validator, Phone Validator, and Address Validator APIs to deliver real-time validation inside any MCP-compatible client.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
- Email validation
|
|
18
|
+
- Phone number validation
|
|
19
|
+
- Postal address validation
|
|
20
|
+
- Fast stdio MCP server
|
|
21
|
+
- Local execution
|
|
22
|
+
- Easy integration with Claude Desktop
|
|
23
|
+
|
|
24
|
+
## Requirements
|
|
25
|
+
- Python ≥ 3.12
|
|
26
|
+
- Byteplant API key (one for each validator, depending which ones you use). [You can register to get one here](https://www.byteplant.com/account/)
|
|
27
|
+
- MCP Client (e.g. Claude Desktop)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## MCP Configuration (Claude Desktop)
|
|
31
|
+
### 1. Installation
|
|
32
|
+
First, install the python module. You can use local installation (like `venv`) or global.
|
|
33
|
+
```bash
|
|
34
|
+
pip install byteplant-mcp
|
|
35
|
+
```
|
|
36
|
+
### 2. Configuration
|
|
37
|
+
Next, add the MCP server to Claude configuration.
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"byteplant": {
|
|
42
|
+
"command": "path/to/python/installation",
|
|
43
|
+
"args": ["-m", "byteplant-mcp"],
|
|
44
|
+
"env": {
|
|
45
|
+
"EV_TOKEN": "<EMAIL VALIDATOR API TOKEN>",
|
|
46
|
+
"PV_TOKEN": "<PHONE VALIDATOR API TOKEN>",
|
|
47
|
+
"AV_TOKEN": "<ADDRESS VALIDATOR API TOKEN>"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Tools
|
|
55
|
+
### 1. `validate_email`
|
|
56
|
+
Validates an email address.
|
|
57
|
+
|
|
58
|
+
**Parameters:**
|
|
59
|
+
- `email`: An email address to validate [required]
|
|
60
|
+
- `timeout`: timeout in seconds [optional; default 10s, min 5s, max 300s]
|
|
61
|
+
|
|
62
|
+
### 2. `validate_phone`
|
|
63
|
+
Validates a phone number.
|
|
64
|
+
**Parameters:**
|
|
65
|
+
- `phone`: Phone number to validate [required]
|
|
66
|
+
- `code`: Two letter ISO 3166-1 country code [optional; if phone number is in international format, empty string if not specified]
|
|
67
|
+
- `locale`: IETF language tag for Geocoding (string) [optional; default 'en-US']
|
|
68
|
+
- `mode`: express (static checks only)/extensive (full validation) [optional; default = extensive]
|
|
69
|
+
- `timeout`: timeout in seconds (int) [optional; default 10s, min 5s, max 300s]
|
|
70
|
+
|
|
71
|
+
### 3 `validate_address`
|
|
72
|
+
Validates a postal address.
|
|
73
|
+
**Paraters:**
|
|
74
|
+
- `code`: two-letter ISO 3166-1 country code (string), set to 'XX' for international [required]
|
|
75
|
+
- `street_adr`: street/housenumber/building, may include unit/apt etc. (string)[required]
|
|
76
|
+
- `street_num`: housenumber/building [optional] (string), housenumber/building can either be part of StreetAddress or be provided separately.
|
|
77
|
+
- `additional_info`: building/unit/apt/floor etc. [optional] (string)
|
|
78
|
+
- `city`: city or locality (city, district) [optional] (string)
|
|
79
|
+
- `postal`: zip/postal code [optional] (string)
|
|
80
|
+
- `State`: state/province [optional] (string)
|
|
81
|
+
- `geocoding`: enable Geocoding [true|false]; default: false [optional] (bool)
|
|
82
|
+
- `locale`: output language for countries with multiple postal languages - use only to translate addresses, always leave empty for address validation [IETF language tag]; default: local language [optional] (string)
|
|
83
|
+
- `charset`: output character set [us-ascii|utf-8]; default: 'utf-8' [optional] (string)
|
|
84
|
+
- `timeout`: timeout in seconds (int) [optional; default 10s, min 5s, max 300s]
|
|
85
|
+
|
|
86
|
+
## Environment Variables
|
|
87
|
+
- `EV_TOKEN`: Your Email Validator API Token
|
|
88
|
+
- `PV_TOKEN`: Your Phone Validator API Token
|
|
89
|
+
- `AV_TOKEN`: Your Address Validator API Token
|
|
90
|
+
You may use only the tokens for the services you use (e.g. only Email Validator), in that case leave the others tokens empty.
|
|
91
|
+
|
|
92
|
+
## Contact
|
|
93
|
+
- Website: https://www.byteplant.com
|
|
94
|
+
- Get your API key: https://www.byteplant.com/account/
|
|
95
|
+
|
|
96
|
+
- Email: contact@byteplant.com
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<!-- mcp-name: io.github.byteplant-dev/byteplant-mcp -->
|
|
2
|
+
# Byteplant Validator MCP Server
|
|
3
|
+
Email, Phone Number, and Address Validation for the Model Context Protocol (MCP)
|
|
4
|
+
|
|
5
|
+
This package provides an MCP server that uses Byteplant’s Email Validator, Phone Validator, and Address Validator APIs to deliver real-time validation inside any MCP-compatible client.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
- Email validation
|
|
9
|
+
- Phone number validation
|
|
10
|
+
- Postal address validation
|
|
11
|
+
- Fast stdio MCP server
|
|
12
|
+
- Local execution
|
|
13
|
+
- Easy integration with Claude Desktop
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
- Python ≥ 3.12
|
|
17
|
+
- Byteplant API key (one for each validator, depending which ones you use). [You can register to get one here](https://www.byteplant.com/account/)
|
|
18
|
+
- MCP Client (e.g. Claude Desktop)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## MCP Configuration (Claude Desktop)
|
|
22
|
+
### 1. Installation
|
|
23
|
+
First, install the python module. You can use local installation (like `venv`) or global.
|
|
24
|
+
```bash
|
|
25
|
+
pip install byteplant-mcp
|
|
26
|
+
```
|
|
27
|
+
### 2. Configuration
|
|
28
|
+
Next, add the MCP server to Claude configuration.
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"mcpServers": {
|
|
32
|
+
"byteplant": {
|
|
33
|
+
"command": "path/to/python/installation",
|
|
34
|
+
"args": ["-m", "byteplant-mcp"],
|
|
35
|
+
"env": {
|
|
36
|
+
"EV_TOKEN": "<EMAIL VALIDATOR API TOKEN>",
|
|
37
|
+
"PV_TOKEN": "<PHONE VALIDATOR API TOKEN>",
|
|
38
|
+
"AV_TOKEN": "<ADDRESS VALIDATOR API TOKEN>"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Tools
|
|
46
|
+
### 1. `validate_email`
|
|
47
|
+
Validates an email address.
|
|
48
|
+
|
|
49
|
+
**Parameters:**
|
|
50
|
+
- `email`: An email address to validate [required]
|
|
51
|
+
- `timeout`: timeout in seconds [optional; default 10s, min 5s, max 300s]
|
|
52
|
+
|
|
53
|
+
### 2. `validate_phone`
|
|
54
|
+
Validates a phone number.
|
|
55
|
+
**Parameters:**
|
|
56
|
+
- `phone`: Phone number to validate [required]
|
|
57
|
+
- `code`: Two letter ISO 3166-1 country code [optional; if phone number is in international format, empty string if not specified]
|
|
58
|
+
- `locale`: IETF language tag for Geocoding (string) [optional; default 'en-US']
|
|
59
|
+
- `mode`: express (static checks only)/extensive (full validation) [optional; default = extensive]
|
|
60
|
+
- `timeout`: timeout in seconds (int) [optional; default 10s, min 5s, max 300s]
|
|
61
|
+
|
|
62
|
+
### 3 `validate_address`
|
|
63
|
+
Validates a postal address.
|
|
64
|
+
**Paraters:**
|
|
65
|
+
- `code`: two-letter ISO 3166-1 country code (string), set to 'XX' for international [required]
|
|
66
|
+
- `street_adr`: street/housenumber/building, may include unit/apt etc. (string)[required]
|
|
67
|
+
- `street_num`: housenumber/building [optional] (string), housenumber/building can either be part of StreetAddress or be provided separately.
|
|
68
|
+
- `additional_info`: building/unit/apt/floor etc. [optional] (string)
|
|
69
|
+
- `city`: city or locality (city, district) [optional] (string)
|
|
70
|
+
- `postal`: zip/postal code [optional] (string)
|
|
71
|
+
- `State`: state/province [optional] (string)
|
|
72
|
+
- `geocoding`: enable Geocoding [true|false]; default: false [optional] (bool)
|
|
73
|
+
- `locale`: output language for countries with multiple postal languages - use only to translate addresses, always leave empty for address validation [IETF language tag]; default: local language [optional] (string)
|
|
74
|
+
- `charset`: output character set [us-ascii|utf-8]; default: 'utf-8' [optional] (string)
|
|
75
|
+
- `timeout`: timeout in seconds (int) [optional; default 10s, min 5s, max 300s]
|
|
76
|
+
|
|
77
|
+
## Environment Variables
|
|
78
|
+
- `EV_TOKEN`: Your Email Validator API Token
|
|
79
|
+
- `PV_TOKEN`: Your Phone Validator API Token
|
|
80
|
+
- `AV_TOKEN`: Your Address Validator API Token
|
|
81
|
+
You may use only the tokens for the services you use (e.g. only Email Validator), in that case leave the others tokens empty.
|
|
82
|
+
|
|
83
|
+
## Contact
|
|
84
|
+
- Website: https://www.byteplant.com
|
|
85
|
+
- Get your API key: https://www.byteplant.com/account/
|
|
86
|
+
|
|
87
|
+
- Email: contact@byteplant.com
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "byteplant-mcp"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Byteplant's Email Validator, Phone Validator and Address Validator MCP Server"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"mcp[cli]>=1.23.1",
|
|
9
|
+
"requests>=2.32.5",
|
|
10
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
from mcp.server.fastmcp import FastMCP
|
|
2
|
+
import os
|
|
3
|
+
import json
|
|
4
|
+
import requests
|
|
5
|
+
|
|
6
|
+
mcp = FastMCP("Byteplant MCP")
|
|
7
|
+
|
|
8
|
+
EV_TOKEN = os.environ.get("EV_TOKEN", "")
|
|
9
|
+
PV_TOKEN = os.environ.get("PV_TOKEN", "")
|
|
10
|
+
AV_TOKEN = os.environ.get("AV_TOKEN", "")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def make_data(data, error=None):
|
|
14
|
+
out = {}
|
|
15
|
+
if error:
|
|
16
|
+
out["ok"] = False
|
|
17
|
+
out["error"] = error
|
|
18
|
+
else:
|
|
19
|
+
out["ok"] = True
|
|
20
|
+
out["data"] = data
|
|
21
|
+
return out
|
|
22
|
+
|
|
23
|
+
def request_email(email, timeout):
|
|
24
|
+
params = {
|
|
25
|
+
"APIKey" : EV_TOKEN,
|
|
26
|
+
"EmailAddress" : email,
|
|
27
|
+
"Timeout" : timeout
|
|
28
|
+
}
|
|
29
|
+
try:
|
|
30
|
+
data = json.loads(requests.post("https://api.email-validator.net/api/verify", params=params).text)
|
|
31
|
+
return make_data(data)
|
|
32
|
+
except Exception as e:
|
|
33
|
+
return make_data(data=None, error=f"Error: {e}")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@mcp.tool()
|
|
37
|
+
def validate_email(email: str, timeout: int) -> str:
|
|
38
|
+
"""Validate email address
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
email: An email address to validate [required]
|
|
42
|
+
timeout: timeout in seconds (int) [optional; default 10s, min 5s, max 300s]
|
|
43
|
+
"""
|
|
44
|
+
data = request_email(email, timeout)
|
|
45
|
+
if not data['ok']:
|
|
46
|
+
return data['error']
|
|
47
|
+
data = data['data']
|
|
48
|
+
res = "Byteplant Email Validation Report\n"
|
|
49
|
+
if data.get("status"):
|
|
50
|
+
res += f"Validation status code: {data.get('status')}\n"
|
|
51
|
+
if data.get("info"):
|
|
52
|
+
res += f"Validation info: {data.get('info')}\n"
|
|
53
|
+
if data.get("freemail"):
|
|
54
|
+
res += f"Is freemai: {data.get('freemail')}\n"
|
|
55
|
+
if data.get("ratelimit_remain"):
|
|
56
|
+
res += f"Number of API requests remaining before the API rate limit is reached: {data.get('ratelimit_remain')}\n"
|
|
57
|
+
if data.get("ratelimit_seconds"):
|
|
58
|
+
res += f"Number of seconds remaining in the current rate limit interval: {data.get('ratelimit_seconds')}\n"
|
|
59
|
+
return res
|
|
60
|
+
|
|
61
|
+
def request_phone(phone, code, locale, mode, timeout):
|
|
62
|
+
params = {
|
|
63
|
+
"APIKey" : PV_TOKEN,
|
|
64
|
+
"PhoneNumber" : phone,
|
|
65
|
+
"CountryCode" : code,
|
|
66
|
+
"Locale" : locale,
|
|
67
|
+
"Mode" : mode,
|
|
68
|
+
"Timeout": timeout
|
|
69
|
+
}
|
|
70
|
+
try:
|
|
71
|
+
data = json.loads(requests.post("https://api.phone-validator.net/api/v2/verify", params=params).text)
|
|
72
|
+
return make_data(data)
|
|
73
|
+
except Exception as e:
|
|
74
|
+
return make_data(data=None, error=f"Error: {e}")
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
@mcp.tool()
|
|
78
|
+
def validate_phone(phone: str, code: str, locale: str, mode: str, timeout: int) -> str:
|
|
79
|
+
"""Validate phone number
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
phone: Phone number to validate [required]
|
|
83
|
+
code: Two letter ISO 3166-1 country code [optional; if phone number is in international format, empty string if not specified]
|
|
84
|
+
locale: IETF language tag for Geocoding (string) [optional; default 'en-US']
|
|
85
|
+
mode: express (static checks only)/extensive (full validation) [optional; default = extensive]
|
|
86
|
+
timeout: timeout in seconds (int) [optional; default 10s, min 5s, max 300s]
|
|
87
|
+
"""
|
|
88
|
+
data = request_phone(phone, code, locale, mode, timeout)
|
|
89
|
+
if not data['ok']:
|
|
90
|
+
return data['error']
|
|
91
|
+
data = data['data']
|
|
92
|
+
res = "Byteplant Phone Number Validation Report\n"
|
|
93
|
+
if data.get("status"):
|
|
94
|
+
res += f"Validation status code: {data.get('status')}\n"
|
|
95
|
+
if data.get("linetype"):
|
|
96
|
+
res += f"Line type: {data.get('linetype')}\n"
|
|
97
|
+
if data.get("location"):
|
|
98
|
+
res += f"Geographical location (city, county, state): {data.get('location')}\n"
|
|
99
|
+
if data.get("countrycode"):
|
|
100
|
+
res += f"Two letter ISO 3166-1 country code: {data.get('countrycode')}\n"
|
|
101
|
+
if data.get("formatnational"):
|
|
102
|
+
res += f"Phone number in national format: {data.get('formatnational')}\n"
|
|
103
|
+
if data.get("formatinternational"):
|
|
104
|
+
res += f"Phone number in international format: {data.get('formatinternational')}\n"
|
|
105
|
+
if data.get("mcc"):
|
|
106
|
+
res += f"Mobile country code to identify a mobile network operator (carrier) using the GSM (including GSM-R), UMTS, and LTE networks : {data.get('mcc')}\n"
|
|
107
|
+
if data.get("formatinternational"):
|
|
108
|
+
res += f"Mobile network code to identify a mobile network operator (carrier) using the GSM (including GSM-R), UMTS, and LTE networks : {data.get('mnc')}\n"
|
|
109
|
+
if data.get("ratelimit_remain"):
|
|
110
|
+
res += f"Number of API requests remaining before the API rate limit is reached: {data.get('ratelimit_remain')}\n"
|
|
111
|
+
if data.get("ratelimit_seconds"):
|
|
112
|
+
res += f"Number of seconds remaining in the current rate limit interval: {data.get('ratelimit_seconds')}\n"
|
|
113
|
+
return res
|
|
114
|
+
|
|
115
|
+
def request_address(code, street_adr, street_num, additional_info, city, postal, state, geocoding, locale, charset, timeout):
|
|
116
|
+
params = {
|
|
117
|
+
"APIKey" : AV_TOKEN,
|
|
118
|
+
"CountryCode" : code,
|
|
119
|
+
"StreetAddress" : street_adr,
|
|
120
|
+
"StreetNumber" : street_num,
|
|
121
|
+
"AdditionalAddressInfo" : additional_info,
|
|
122
|
+
"City": city,
|
|
123
|
+
"PostalCode" : postal,
|
|
124
|
+
"State" : state,
|
|
125
|
+
"Geocoding" : "true" if geocoding == True else "false",
|
|
126
|
+
"Locale" : locale,
|
|
127
|
+
"OutputCharset": charset,
|
|
128
|
+
"Timeout": timeout
|
|
129
|
+
}
|
|
130
|
+
try:
|
|
131
|
+
data = json.loads(requests.post("https://api.address-validator.net/api/verify", params=params).text)
|
|
132
|
+
return make_data(data)
|
|
133
|
+
except Exception as e:
|
|
134
|
+
return make_data(data=None, error=f"Error: {e}")
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
@mcp.tool()
|
|
139
|
+
def validate_address(code: str, street_adr: str, street_num: str, additional_info: str, city: str, postal: str, state: str, geocoding: bool, locale: str, charset: str, timeout: int) -> str:
|
|
140
|
+
"""Validate address
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
code: two-letter ISO 3166-1 country code (string), set to 'XX' for international [required]
|
|
144
|
+
street_adr: street/housenumber/building, may include unit/apt etc. (string)[required]
|
|
145
|
+
street_num: housenumber/building [optional] (string), housenumber/building can either be part of StreetAddress or be provided separately.
|
|
146
|
+
additional_info: building/unit/apt/floor etc. [optional] (string)
|
|
147
|
+
city: city or locality (city, district) [optional] (string)
|
|
148
|
+
postal: zip/postal code [optional] (string)
|
|
149
|
+
State: state/province [optional] (string)
|
|
150
|
+
geocoding: enable Geocoding [true|false]; default: false [optional] (bool)
|
|
151
|
+
locale: output language for countries with multiple postal languages - use only to translate addresses, always leave empty for address validation [IETF language tag]; default: local language [optional] (string)
|
|
152
|
+
charset: output character set [us-ascii|utf-8]; default: 'utf-8' [optional] (string)
|
|
153
|
+
timeout: timeout in seconds (int) [optional; default 10s, min 5s, max 300s]
|
|
154
|
+
"""
|
|
155
|
+
data = request_address(code, street_adr, street_num, additional_info, city, postal, state, geocoding, locale, charset, timeout)
|
|
156
|
+
if not data['ok']:
|
|
157
|
+
return data['error']
|
|
158
|
+
data = data['data']
|
|
159
|
+
res = "Byteplant Address Validation Report\n"
|
|
160
|
+
if data.get("status"):
|
|
161
|
+
res += "Validation status: "
|
|
162
|
+
if data.get('status') == "VALID":
|
|
163
|
+
res += "VALID: address is correct and deliverable.\n"
|
|
164
|
+
elif data.get('status') == "SUSPECT":
|
|
165
|
+
res += "SUSPECT: address is incorrect and needs corrections to be deliverable, a suggested correction is provided.\n"
|
|
166
|
+
elif data.get('status') == "INVALID":
|
|
167
|
+
res += "INVALID: address is incorrect and not deliverable - either there is no match at all in the reference data or the address is ambiguous and there are a lot of different matches. In these cases automatic correction suggestions are not available.\n"
|
|
168
|
+
else:
|
|
169
|
+
res += f"{data.get('status')}\n"
|
|
170
|
+
if data.get("formattedaddress"):
|
|
171
|
+
res += f"Full address in standardized format: {data.get('formattedaddress')}\n"
|
|
172
|
+
if data.get("supplement"):
|
|
173
|
+
res += f"Additional address details (building / unit / apt / suite etc.): {data.get('supplement')}\n"
|
|
174
|
+
if data.get("street"):
|
|
175
|
+
res += f"Street address in standardized format: {data.get('street')}\n"
|
|
176
|
+
if data.get("streetnumber"):
|
|
177
|
+
res += f"Street number in standardized format: {data.get('streetnumber')}\n"
|
|
178
|
+
if data.get("postalcode"):
|
|
179
|
+
res += f"Zip / postal code in standardized format: {data.get('postalcode')}\n"
|
|
180
|
+
if data.get("city"):
|
|
181
|
+
res += f"City in standardized format: {data.get('city')}\n"
|
|
182
|
+
if data.get("rdi"):
|
|
183
|
+
res += f"Residential Delivery Indicator (Commercial / Residential): {data.get('rdi')}\n"
|
|
184
|
+
if data.get("district"):
|
|
185
|
+
res += f"District in standardized format: {data.get('district')}\n"
|
|
186
|
+
if data.get("county"):
|
|
187
|
+
res += f"County in standardized format: {data.get('county')}\n"
|
|
188
|
+
if data.get("state"):
|
|
189
|
+
res += f"State / province in standardized format: {data.get('state')}\n"
|
|
190
|
+
if data.get("country"):
|
|
191
|
+
res += f"Two-letter ISO 3166-1 country code: {data.get('country')}\n"
|
|
192
|
+
if data.get("latitude"):
|
|
193
|
+
res += f"Latitude: {data.get('latitude')}\n"
|
|
194
|
+
if data.get("longitude"):
|
|
195
|
+
res += f"longitude: {data.get('longitude')}\n"
|
|
196
|
+
if data.get("diagnostics"):
|
|
197
|
+
res += f"Diagnostic hints, indicating errors in the address input: {data.get('diagnostics')}\n"
|
|
198
|
+
if data.get("corrections"):
|
|
199
|
+
res += f"Correction hints, indicating which parts of the address input have been fixed: {data.get('corrections')}\n"
|
|
200
|
+
if data.get("ratelimit_remain"):
|
|
201
|
+
res += f"Number of API requests remaining before the API rate limit is reached: {data.get('ratelimit_remain')}\n"
|
|
202
|
+
if data.get("ratelimit_seconds"):
|
|
203
|
+
res += f"Number of seconds remaining in the current rate limit interval: {data.get('ratelimit_seconds')}\n"
|
|
204
|
+
|
|
205
|
+
return res
|
|
206
|
+
|
|
207
|
+
def main():
|
|
208
|
+
mcp.run(transport="stdio")
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: byteplant-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Byteplant's Email Validator, Phone Validator and Address Validator MCP Server
|
|
5
|
+
Requires-Python: >=3.12
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: mcp[cli]>=1.23.1
|
|
8
|
+
Requires-Dist: requests>=2.32.5
|
|
9
|
+
|
|
10
|
+
<!-- mcp-name: io.github.byteplant-dev/byteplant-mcp -->
|
|
11
|
+
# Byteplant Validator MCP Server
|
|
12
|
+
Email, Phone Number, and Address Validation for the Model Context Protocol (MCP)
|
|
13
|
+
|
|
14
|
+
This package provides an MCP server that uses Byteplant’s Email Validator, Phone Validator, and Address Validator APIs to deliver real-time validation inside any MCP-compatible client.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
- Email validation
|
|
18
|
+
- Phone number validation
|
|
19
|
+
- Postal address validation
|
|
20
|
+
- Fast stdio MCP server
|
|
21
|
+
- Local execution
|
|
22
|
+
- Easy integration with Claude Desktop
|
|
23
|
+
|
|
24
|
+
## Requirements
|
|
25
|
+
- Python ≥ 3.12
|
|
26
|
+
- Byteplant API key (one for each validator, depending which ones you use). [You can register to get one here](https://www.byteplant.com/account/)
|
|
27
|
+
- MCP Client (e.g. Claude Desktop)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## MCP Configuration (Claude Desktop)
|
|
31
|
+
### 1. Installation
|
|
32
|
+
First, install the python module. You can use local installation (like `venv`) or global.
|
|
33
|
+
```bash
|
|
34
|
+
pip install byteplant-mcp
|
|
35
|
+
```
|
|
36
|
+
### 2. Configuration
|
|
37
|
+
Next, add the MCP server to Claude configuration.
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"byteplant": {
|
|
42
|
+
"command": "path/to/python/installation",
|
|
43
|
+
"args": ["-m", "byteplant-mcp"],
|
|
44
|
+
"env": {
|
|
45
|
+
"EV_TOKEN": "<EMAIL VALIDATOR API TOKEN>",
|
|
46
|
+
"PV_TOKEN": "<PHONE VALIDATOR API TOKEN>",
|
|
47
|
+
"AV_TOKEN": "<ADDRESS VALIDATOR API TOKEN>"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Tools
|
|
55
|
+
### 1. `validate_email`
|
|
56
|
+
Validates an email address.
|
|
57
|
+
|
|
58
|
+
**Parameters:**
|
|
59
|
+
- `email`: An email address to validate [required]
|
|
60
|
+
- `timeout`: timeout in seconds [optional; default 10s, min 5s, max 300s]
|
|
61
|
+
|
|
62
|
+
### 2. `validate_phone`
|
|
63
|
+
Validates a phone number.
|
|
64
|
+
**Parameters:**
|
|
65
|
+
- `phone`: Phone number to validate [required]
|
|
66
|
+
- `code`: Two letter ISO 3166-1 country code [optional; if phone number is in international format, empty string if not specified]
|
|
67
|
+
- `locale`: IETF language tag for Geocoding (string) [optional; default 'en-US']
|
|
68
|
+
- `mode`: express (static checks only)/extensive (full validation) [optional; default = extensive]
|
|
69
|
+
- `timeout`: timeout in seconds (int) [optional; default 10s, min 5s, max 300s]
|
|
70
|
+
|
|
71
|
+
### 3 `validate_address`
|
|
72
|
+
Validates a postal address.
|
|
73
|
+
**Paraters:**
|
|
74
|
+
- `code`: two-letter ISO 3166-1 country code (string), set to 'XX' for international [required]
|
|
75
|
+
- `street_adr`: street/housenumber/building, may include unit/apt etc. (string)[required]
|
|
76
|
+
- `street_num`: housenumber/building [optional] (string), housenumber/building can either be part of StreetAddress or be provided separately.
|
|
77
|
+
- `additional_info`: building/unit/apt/floor etc. [optional] (string)
|
|
78
|
+
- `city`: city or locality (city, district) [optional] (string)
|
|
79
|
+
- `postal`: zip/postal code [optional] (string)
|
|
80
|
+
- `State`: state/province [optional] (string)
|
|
81
|
+
- `geocoding`: enable Geocoding [true|false]; default: false [optional] (bool)
|
|
82
|
+
- `locale`: output language for countries with multiple postal languages - use only to translate addresses, always leave empty for address validation [IETF language tag]; default: local language [optional] (string)
|
|
83
|
+
- `charset`: output character set [us-ascii|utf-8]; default: 'utf-8' [optional] (string)
|
|
84
|
+
- `timeout`: timeout in seconds (int) [optional; default 10s, min 5s, max 300s]
|
|
85
|
+
|
|
86
|
+
## Environment Variables
|
|
87
|
+
- `EV_TOKEN`: Your Email Validator API Token
|
|
88
|
+
- `PV_TOKEN`: Your Phone Validator API Token
|
|
89
|
+
- `AV_TOKEN`: Your Address Validator API Token
|
|
90
|
+
You may use only the tokens for the services you use (e.g. only Email Validator), in that case leave the others tokens empty.
|
|
91
|
+
|
|
92
|
+
## Contact
|
|
93
|
+
- Website: https://www.byteplant.com
|
|
94
|
+
- Get your API key: https://www.byteplant.com/account/
|
|
95
|
+
|
|
96
|
+
- Email: contact@byteplant.com
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/byteplant-mcp/__init__.py
|
|
4
|
+
src/byteplant-mcp/__main__.py
|
|
5
|
+
src/byteplant-mcp/server.py
|
|
6
|
+
src/byteplant_mcp.egg-info/PKG-INFO
|
|
7
|
+
src/byteplant_mcp.egg-info/SOURCES.txt
|
|
8
|
+
src/byteplant_mcp.egg-info/dependency_links.txt
|
|
9
|
+
src/byteplant_mcp.egg-info/requires.txt
|
|
10
|
+
src/byteplant_mcp.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
byteplant-mcp
|