-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathverify_setup.py
More file actions
168 lines (138 loc) · 4.87 KB
/
Copy pathverify_setup.py
File metadata and controls
168 lines (138 loc) · 4.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#!/usr/bin/env python3
"""
Verification script for Apollo.io MCP Server setup
"""
import os
import sys
from typing import Dict, Any
def verify_imports() -> bool:
"""Verify that all required imports work."""
try:
import httpx
import pydantic
import fastmcp
from src.apollo_mcp_server import ApolloAPIClient
print("✅ All imports successful")
return True
except ImportError as e:
print(f"❌ Import error: {e}")
return False
def verify_environment() -> bool:
"""Verify environment setup."""
if not os.getenv("APOLLO_API_KEY"):
print("⚠️ APOLLO_API_KEY not set (this is expected for demo)")
return True
else:
print("✅ APOLLO_API_KEY is set")
return True
def verify_client_creation() -> bool:
"""Verify Apollo API client can be created."""
try:
from src.apollo_mcp_server import ApolloAPIClient
client = ApolloAPIClient("test_key")
print("✅ Apollo API client can be created")
return True
except Exception as e:
print(f"❌ Client creation failed: {e}")
return False
def verify_pydantic_models() -> bool:
"""Verify Pydantic models work correctly."""
try:
from src.apollo_mcp_server import (
AccountSearchRequest,
PeopleSearchRequest,
PersonEnrichmentRequest,
OrganizationEnrichmentRequest
)
# Test AccountSearchRequest
account_req = AccountSearchRequest(
q_organization_name="Google",
page=1,
per_page=25
)
# Test PeopleSearchRequest
people_req = PeopleSearchRequest(
q_organization_domains="apollo.io\ngoogle.com",
person_titles=["CEO", "CTO"],
page=1
)
# Test PersonEnrichmentRequest
person_req = PersonEnrichmentRequest(
first_name="Tim",
last_name="Zheng",
email="tim@apollo.io"
)
# Test OrganizationEnrichmentRequest
org_req = OrganizationEnrichmentRequest(domain="apollo.io")
print("✅ All Pydantic models work correctly")
return True
except Exception as e:
print(f"❌ Pydantic model error: {e}")
return False
def verify_fastmcp_setup() -> bool:
"""Verify FastMCP is set up correctly."""
try:
from src.apollo_mcp_server import mcp
# Just verify that the MCP instance was created successfully
print(f"✅ FastMCP instance created successfully: {type(mcp).__name__}")
# Verify we can access the app name
if hasattr(mcp, 'name'):
print(f" Server name: {mcp.name}")
# Try to import the decorated functions to ensure they were processed
expected_functions = [
"search_accounts",
"search_people",
"enrich_person",
"enrich_organization",
"bulk_enrich_organizations",
"get_account_by_id",
"create_account",
"update_account",
"get_email_accounts",
"health_check",
"search_opportunities"
]
import src.apollo_mcp_server as server_module
missing_functions = []
for func_name in expected_functions:
if not hasattr(server_module, func_name):
missing_functions.append(func_name)
if missing_functions:
print(f"❌ Missing tool functions: {missing_functions}")
return False
print(f" All {len(expected_functions)} tool functions are available")
return True
except Exception as e:
print(f"❌ FastMCP setup error: {e}")
return False
def main():
"""Run all verification checks."""
print("Apollo.io MCP Server Setup Verification")
print("=" * 40)
checks = [
("Imports", verify_imports),
("Environment", verify_environment),
("Client Creation", verify_client_creation),
("Pydantic Models", verify_pydantic_models),
("FastMCP Setup", verify_fastmcp_setup),
]
results = []
for name, check_func in checks:
print(f"\n{name}:")
result = check_func()
results.append(result)
print("\n" + "=" * 40)
passed = sum(results)
total = len(results)
if passed == total:
print(f"🎉 All {total} checks passed! Apollo MCP Server is ready to use.")
print("\nNext steps:")
print("1. Set your real Apollo.io API key in .env file")
print("2. Run: uv run python src/apollo_mcp_server.py")
print("3. Configure your MCP client to connect to this server")
return 0
else:
print(f"❌ {total - passed} checks failed out of {total}")
return 1
if __name__ == "__main__":
sys.exit(main())