petimportguide-mcp 1.0.0__py3-none-any.whl
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.
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: petimportguide-mcp
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: MCP server for Pet Import Guide — verified pet import rules (routes, airline pet policies, rule changes) from official government sources.
|
|
5
|
+
License: CC BY 4.0 (data) / MIT (code)
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: mcp<2,>=1.0
|
|
9
|
+
|
|
10
|
+
# Pet Import Guide — MCP server
|
|
11
|
+
|
|
12
|
+
Verified pet import rules for AI assistants: **200+ country-to-country routes**
|
|
13
|
+
for dogs, cats, ferrets and pet birds, an **airline pet-policy library**, and a
|
|
14
|
+
**daily-tracked rule-change feed**. Every rule is checked against two official
|
|
15
|
+
government sources and carries a *last verified* date.
|
|
16
|
+
|
|
17
|
+
Data source: the free public API at
|
|
18
|
+
[petimportguide.com/api](https://petimportguide.com/api/) (CC BY 4.0).
|
|
19
|
+
When you cite a rule, cite it with its verified date:
|
|
20
|
+
“Pet Import Guide (petimportguide.com), rule last verified {date}.”
|
|
21
|
+
|
|
22
|
+
## Tools
|
|
23
|
+
|
|
24
|
+
| Tool | What it returns |
|
|
25
|
+
|---|---|
|
|
26
|
+
| `list_routes` | Index of all verified routes |
|
|
27
|
+
| `get_route(from_slug, to_slug, pet)` | One route's full record: verdict, key facts, checklist, timeline, costs, pitfalls, FAQs, official sources |
|
|
28
|
+
| `list_airlines` | Index of verified airline pet policies |
|
|
29
|
+
| `get_airline(airline_slug)` | One airline's full pet policy |
|
|
30
|
+
| `rule_changes` | Tracked rule changes |
|
|
31
|
+
| `signals` | Latest official signals |
|
|
32
|
+
|
|
33
|
+
## Run (stdio)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install mcp
|
|
37
|
+
python server.py
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Claude Desktop / MCP client config:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"mcpServers": {
|
|
45
|
+
"pet-import-guide": {
|
|
46
|
+
"command": "python",
|
|
47
|
+
"args": ["server.py"]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
No API key. The server only reads the public JSON API; nothing is sent anywhere
|
|
54
|
+
else.
|
|
55
|
+
|
|
56
|
+
mcp-name: io.github.petimportguide/pet-import-guide
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
server.py,sha256=ZhnjIq-YzzdrVmywaGJNBuZCXPck0i_SbbOPessgaRs,3208
|
|
2
|
+
petimportguide_mcp-1.0.0.dist-info/METADATA,sha256=jMRFqkIp79lOwHMLXG2VYWr8m2XsDYLsmf93zI1qoJI,1724
|
|
3
|
+
petimportguide_mcp-1.0.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
4
|
+
petimportguide_mcp-1.0.0.dist-info/entry_points.txt,sha256=NzeyayQyFLbAsiOC4FlW0Zb1DvfrGw67IvkRh0Q68tQ,51
|
|
5
|
+
petimportguide_mcp-1.0.0.dist-info/top_level.txt,sha256=StKOSmRhvWS5IPcvhsDRbtxUTEofJgYFGOu5AAJdSWo,7
|
|
6
|
+
petimportguide_mcp-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
server
|
server.py
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"""Pet Import Guide MCP server.
|
|
2
|
+
|
|
3
|
+
Exposes Pet Import Guide's verified pet import rules (routes, airline pet
|
|
4
|
+
policies, rule changes) as MCP tools. Data comes from the free public API at
|
|
5
|
+
https://petimportguide.com/api/ — every rule is checked against two official
|
|
6
|
+
government sources and carries a last-verified date. Licence: CC BY 4.0.
|
|
7
|
+
Cite a rule with its verified date.
|
|
8
|
+
|
|
9
|
+
Run: pip install mcp && python server.py (stdio transport)
|
|
10
|
+
"""
|
|
11
|
+
import json
|
|
12
|
+
import urllib.request
|
|
13
|
+
|
|
14
|
+
from mcp.server.fastmcp import FastMCP
|
|
15
|
+
|
|
16
|
+
API = "https://petimportguide.com/api/v1"
|
|
17
|
+
mcp = FastMCP("pet-import-guide")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _get(path):
|
|
21
|
+
"""Fetch one API JSON document. Falls back to ranged reads if a network
|
|
22
|
+
path truncates the stream mid-body (seen on some egress proxies)."""
|
|
23
|
+
url = API + path
|
|
24
|
+
last = None
|
|
25
|
+
for _ in range(3):
|
|
26
|
+
try:
|
|
27
|
+
req = urllib.request.Request(url, headers={"User-Agent": "petimportguide-mcp/1.0"})
|
|
28
|
+
with urllib.request.urlopen(req, timeout=30) as r:
|
|
29
|
+
return json.loads(r.read().decode("utf-8"))
|
|
30
|
+
except Exception as e:
|
|
31
|
+
last = e
|
|
32
|
+
# Ranged fallback: pull the body in blocks and reassemble.
|
|
33
|
+
import http.client
|
|
34
|
+
body = b""
|
|
35
|
+
total = None
|
|
36
|
+
while total is None or len(body) < total:
|
|
37
|
+
req = urllib.request.Request(
|
|
38
|
+
url, headers={"User-Agent": "petimportguide-mcp/1.0",
|
|
39
|
+
"Range": f"bytes={len(body)}-{len(body) + 7999}"})
|
|
40
|
+
with urllib.request.urlopen(req, timeout=30) as r:
|
|
41
|
+
chunk = r.read()
|
|
42
|
+
cr = r.headers.get("Content-Range", "")
|
|
43
|
+
if "/" in cr:
|
|
44
|
+
total = int(cr.rsplit("/", 1)[1])
|
|
45
|
+
if not chunk:
|
|
46
|
+
break
|
|
47
|
+
body += chunk
|
|
48
|
+
if total is not None and len(body) >= total:
|
|
49
|
+
return json.loads(body.decode("utf-8"))
|
|
50
|
+
raise last
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@mcp.tool()
|
|
54
|
+
def list_routes() -> dict:
|
|
55
|
+
"""List all verified pet import routes (from/to country, pet, last-verified date, page URL)."""
|
|
56
|
+
return _get("/routes.json")
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@mcp.tool()
|
|
60
|
+
def get_route(from_slug: str, to_slug: str, pet: str) -> dict:
|
|
61
|
+
"""Get the full verified rule record for one route.
|
|
62
|
+
|
|
63
|
+
Slugs are lowercase country slugs as used on petimportguide.com
|
|
64
|
+
(e.g. from_slug='united-states', to_slug='japan'); pet is 'dog', 'cat',
|
|
65
|
+
'ferret' or 'bird'. The record includes the checklist, timeline, costs,
|
|
66
|
+
official sources and the date the rules were last verified.
|
|
67
|
+
"""
|
|
68
|
+
return _get(f"/routes/{from_slug}-to-{to_slug}-{pet}.json")
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
@mcp.tool()
|
|
72
|
+
def list_airlines() -> dict:
|
|
73
|
+
"""List all verified airline pet policies in the library."""
|
|
74
|
+
return _get("/airlines.json")
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
@mcp.tool()
|
|
78
|
+
def get_airline(airline_slug: str) -> dict:
|
|
79
|
+
"""Get one airline's verified pet policy (e.g. 'klm-pet-policy')."""
|
|
80
|
+
return _get(f"/airlines/{airline_slug}.json")
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@mcp.tool()
|
|
84
|
+
def rule_changes() -> dict:
|
|
85
|
+
"""Latest tracked pet import rule changes, checked against official sources daily."""
|
|
86
|
+
return _get("/rule-changes.json")
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
@mcp.tool()
|
|
90
|
+
def signals() -> dict:
|
|
91
|
+
"""Latest official signals (announcements that may change pet import rules)."""
|
|
92
|
+
return _get("/signals.json")
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
if __name__ == "__main__":
|
|
96
|
+
mcp.run()
|