Skip to main content
Glama

Finizi B4B MCP Server

by finizi-app
MIT License
test_mcp_connection.py•2.51 kB
#!/usr/bin/env python3 """Test MCP server connection without Claude Desktop.""" import asyncio import json from mcp import ClientSession, StdioServerParameters from mcp.client.stdio import stdio_client async def test_mcp_server(): """Test connecting to the MCP server and listing tools.""" # Server parameters server_params = StdioServerParameters( command="/Users/trunghuynh/.local/bin/uv", args=[ "run", "python", "/Users/trunghuynh/development/finizi-mcp/run_mcp_server.py" ], env={ "B4B_API_BASE_URL": "http://localhost:8000", "B4B_API_VERSION": "v1" } ) print("šŸ”„ Connecting to MCP server...") try: async with stdio_client(server_params) as (read, write): async with ClientSession(read, write) as session: # Initialize print("šŸ”„ Initializing session...") await session.initialize() print("āœ… Session initialized!") # List tools print("\nšŸ”„ Listing available tools...") tools_result = await session.list_tools() print(f"\nāœ… Found {len(tools_result.tools)} tools:\n") for i, tool in enumerate(tools_result.tools, 1): print(f"{i:2d}. {tool.name}") if tool.description: desc = tool.description.split('\n')[0][:80] print(f" {desc}") # Test login tool print("\n\nšŸ”„ Testing login tool...") try: result = await session.call_tool( "login", arguments={ "phone": "+84909495665", "password": "Admin123@" } ) print("āœ… Login tool called successfully!") print(f" Result: {result.content[0].text if result.content else 'No content'}") except Exception as e: print(f"āš ļø Login test failed: {e}") print("\nāœ… MCP server is working correctly!") return True except Exception as e: print(f"\nāŒ Error connecting to MCP server:") print(f" {e}") return False if __name__ == "__main__": success = asyncio.run(test_mcp_server()) 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/finizi-app/finizi-mcp'

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