Skip to main content
Glama

LiveKit RAG Assistant

by THENABILMAN
test_mcp.pyโ€ข2.81 kB
""" Test MCP Server and Client connection """ import asyncio import sys import os import subprocess async def test_mcp(): """Test MCP server and client""" print("=" * 60) print("๐Ÿงช Testing MCP Server and Client") print("=" * 60) try: from mcp.client.stdio import stdio_client, StdioServerParameters from mcp.client.session import ClientSession print("โœ… MCP client imported successfully") # Get the path to mcp_server_standard.py server_path = os.path.join(os.path.dirname(__file__), "mcp_server_standard.py") print(f"\n๐Ÿ“ Server path: {server_path}") print(f" Exists: {os.path.exists(server_path)}") print("\n๐Ÿš€ Connecting to MCP Server...") # Create server parameters server_params = StdioServerParameters( command=sys.executable, args=[server_path] ) async with stdio_client(server_params) as (read, write): print("โœ… Connected to MCP Server!") # Create session async with ClientSession(read, write) as session: # Test documentation search directly print("\n๐Ÿ” Testing documentation search...") test_query = "LiveKit installation" print(f" Query: '{test_query}'") try: response = await session.call_tool( name="search_documentation", arguments={ "query": test_query, "top_k": 3 } ) if response and hasattr(response, 'content') and response.content: text = response.content[0].text if hasattr(response.content[0], 'text') else str(response.content[0]) print(f"โœ… Got response ({len(text)} chars)") print(f"\n๐Ÿ“„ Response preview:") print(f" {text[:300]}") else: print(f"โŒ No response: {response}") except Exception as e: print(f"โŒ Error calling tool: {str(e)}") import traceback traceback.print_exc() print("\n" + "=" * 60) print("โœ… MCP test completed successfully!") print("=" * 60) except Exception as e: print(f"\nโŒ Error: {str(e)}") import traceback traceback.print_exc() return False return True if __name__ == "__main__": success = asyncio.run(test_mcp()) sys.exit(0 if success else 1)

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/THENABILMAN/THENABILMAN_LiveKit_MCP_Assistant'

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