-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest.py
More file actions
executable file
·50 lines (43 loc) · 1.84 KB
/
test.py
File metadata and controls
executable file
·50 lines (43 loc) · 1.84 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
#!/usr/bin/env python3
"""Test script for the Kaggle MCP server."""
import importlib.util
import sys
import os
# Check if kaggle-mcp is installed
try:
from kaggle_mcp.server import mcp
print("✅ Kaggle MCP package is installed and importable")
except ImportError:
print("❌ Kaggle MCP package not found. Please install it first with: pip install -e .")
sys.exit(1)
# Check if kaggle is installed
try:
import kaggle
print("✅ Kaggle package is installed")
except ImportError:
print("❌ Kaggle package not found. Please install it with: pip install kaggle")
sys.exit(1)
# Check if mcp is installed
try:
import mcp
from mcp.server.fastmcp import FastMCP
print("✅ MCP package is installed")
except ImportError:
print("❌ MCP package not found. Please install it with: pip install mcp")
sys.exit(1)
# Check Kaggle API credentials
kaggle_creds_path = os.path.expanduser("~/.kaggle/kaggle.json")
if os.path.exists(kaggle_creds_path):
print(f"✅ Kaggle API credentials found at {kaggle_creds_path}")
else:
print(f"⚠️ Kaggle API credentials not found at {kaggle_creds_path}")
print(" You'll need to set up credentials before using the Kaggle tools.")
print(" Visit https://www.kaggle.com/settings/account and click 'Create New API Token'")
print(" Then save the downloaded kaggle.json file to ~/.kaggle/kaggle.json")
print(" Make sure to run: chmod 600 ~/.kaggle/kaggle.json")
# Print available tools
print("\nAvailable MCP tools in Kaggle server:")
for tool_name, tool_handler in mcp.tool_handlers.items():
print(f"- {tool_name}: {tool_handler.__doc__.split('.')[0] if tool_handler.__doc__ else 'No description'}")
print("\n✅ Test completed successfully. The Kaggle MCP server is ready to use.")
print(" To use with Claude Desktop, follow the installation instructions in README.md")