-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest_mcp_registration.py
More file actions
26 lines (21 loc) · 866 Bytes
/
test_mcp_registration.py
File metadata and controls
26 lines (21 loc) · 866 Bytes
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
#!/usr/bin/env python3
"""Test MCP tool registration patterns"""
from mcp.server import Server
from mcp.types import Tool
import inspect
# Create a server instance
server = Server("test-server")
# Check if we can create Tool objects
print("Tool class:")
print(f" - Tool type: {Tool}")
print(f" - Tool attributes: {[attr for attr in dir(Tool) if not attr.startswith('_')]}")
# Check server's request_handlers
print("\nServer request handlers:")
print(f" - Type: {type(server.request_handlers)}")
print(f" - Methods: {[m for m in dir(server.request_handlers) if not m.startswith('_')]}")
# Look for tool-related attributes
print("\nChecking for tool storage:")
for attr in dir(server):
value = getattr(server, attr)
if 'tool' in attr.lower() or (hasattr(value, '__name__') and 'tool' in str(value).lower()):
print(f" - {attr}: {type(value)}")