Skip to main content
Glama

Corporate LXP MCP

test_connection.pyโ€ข2.22 kB
#!/usr/bin/env python3 """ Test MCP Connection - Shows exactly how to connect to the MCP server """ import asyncio import json import subprocess import sys import os async def test_mcp_connection(): """Test connecting to MCP server via subprocess""" print("๐Ÿงช Testing MCP Server Connection...") # Start the MCP server with stdin pipe print("๐Ÿš€ Starting MCP server...") process = await asyncio.create_subprocess_exec( "python3", "mcp_server_standalone.py", stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env={**dict(os.environ), "PYTHONPATH": "."} ) print(f"โœ… Server started with PID: {process.pid}") try: # Wait a moment for server to start await asyncio.sleep(2) # Check if process is still running if process.returncode is None: print("โœ… Server is running!") # Get stderr to see startup messages stderr_data = await process.stderr.read() if stderr_data: print(f"๐Ÿ“‹ Server logs:\n{stderr_data.decode()}") print("๐ŸŽฏ MCP Server is ready for connections!") print("๐Ÿ’ก The server would wait for JSON-RPC commands via stdin") # Test services directly sys.path.insert(0, '.') from corporate_lxp_mcp.services.employee_service import EmployeeService employee_service = EmployeeService() employees = employee_service.get_all_employees() print(f"๐Ÿ“Š Services working: {len(employees)} employees available") else: print(f"โŒ Server exited with code: {process.returncode}") stderr_data = await process.stderr.read() if stderr_data: print(f"Error: {stderr_data.decode()}") finally: # Clean up if process.returncode is None: print("๐Ÿ›‘ Stopping server...") process.terminate() await process.wait() print("โœ… Server stopped") if __name__ == "__main__": asyncio.run(test_mcp_connection())

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/karthikrajkumar/corporate_lxp_mcp'

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