Skip to main content
Glama

License Scanner MCP Server

by RyanCadby
debug_mcp.py1.74 kB
#!/usr/bin/env python3 """ Debug script to test MCP server functionality """ import asyncio import json from fastmcp import FastMCP # Initialize FastMCP server mcp = FastMCP("Debug Test Server") @mcp.tool() def test_tool(message: str = "Hello") -> str: """ A simple test tool that echoes a message. Args: message: The message to echo Returns: The echoed message with a prefix """ return f"Echo: {message}" @mcp.tool() def get_info() -> str: """ Get information about this MCP server. Returns: Server information as JSON string """ return json.dumps({ "server_name": "Debug Test Server", "tools": ["test_tool", "get_info"], "status": "running" }) async def test_server(): """Test the server functionality""" print("Testing MCP server...") # Get tools tools = await mcp.get_tools() print(f"Tools type: {type(tools)}") print(f"Tools content: {tools}") # Check if tools is a list or dict if isinstance(tools, list): print(f"Number of tools: {len(tools)}") for i, tool in enumerate(tools): print(f"Tool {i}: {type(tool)} - {tool}") elif isinstance(tools, dict): print(f"Tools dict keys: {list(tools.keys())}") for name, tool in tools.items(): print(f"Tool '{name}': {type(tool)} - {tool}") else: print(f"Unexpected tools format: {tools}") if __name__ == "__main__": print("Starting Debug MCP Server...") print("Available tools should be: test_tool, get_info") # Run the async test asyncio.run(test_server()) # Then start the server print("\nStarting server...") mcp.run()

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RyanCadby/mcp-license-scanner'

If you have feedback or need assistance with the MCP directory API, please join our Discord server