"""Direct test to check mcp attributes"""
import sys
from pathlib import Path
import types
# Add src to path the same way conftest.py does
src_path = Path(__file__).parent / "src"
sys.path.insert(0, str(src_path.parent))
# Create blender_mcp module namespace pointing to src/
blender_mcp = types.ModuleType("blender_mcp")
blender_mcp.__file__ = str(src_path / "__init__.py")
blender_mcp.__path__ = [str(src_path)]
blender_mcp.__package__ = "blender_mcp"
sys.modules["blender_mcp"] = blender_mcp
# Load src/__init__.py into blender_mcp module
with open(src_path / "__init__.py") as f:
exec(f.read(), blender_mcp.__dict__)
from blender_mcp.server import mcp
print(f"MCP object: {mcp}")
print(f"Type: {type(mcp)}")
# Check the managers
tool_mgr = mcp._tool_manager
resource_mgr = mcp._resource_manager
prompt_mgr = mcp._prompt_manager
print(f"\nTool Manager: {type(tool_mgr)}")
if hasattr(tool_mgr, '_tools'):
print(f" Total tools: {len(tool_mgr._tools)}")
print(f"\n All registered tools:")
for tool_name in sorted(tool_mgr._tools.keys()):
print(f" - {tool_name}")
print(f"\nResource Manager: {type(resource_mgr)}")
if hasattr(resource_mgr, '_resources'):
print(f" Total resources: {len(resource_mgr._resources)}")
if resource_mgr._resources:
for name in resource_mgr._resources.keys():
print(f" - {name}")
print(f"\nPrompt Manager: {type(prompt_mgr)}")
if hasattr(prompt_mgr, '_prompts'):
print(f" Total prompts: {len(prompt_mgr._prompts)}")
for name in prompt_mgr._prompts.keys():
print(f" - {name}")