Skip to main content
Glama

Finizi B4B MCP Server

by finizi-app
MIT License
test_full_integration.py•2.48 kB
#!/usr/bin/env python3 """ Full integration test for Finizi B4B MCP Server. Tests the complete flow: connect -> list tools -> login -> call authenticated tool """ import asyncio from mcp import ClientSession, StdioServerParameters from mcp.client.stdio import stdio_client async def test_full_integration(): print("šŸ”„ Starting full integration test...\n") # Server parameters matching Claude Desktop config server_params = StdioServerParameters( command="/Users/trunghuynh/.local/bin/uv", args=[ "--directory", "/Users/trunghuynh/development/finizi-mcp", "run", "python", "run_mcp_server.py" ], env={ "B4B_API_BASE_URL": "http://localhost:8000", "B4B_API_VERSION": "v1", "LOG_LEVEL": "INFO" } ) async with stdio_client(server_params) as (read, write): async with ClientSession(read, write) as session: # Initialize session await session.initialize() print("āœ… Session initialized!\n") # List tools tools = await session.list_tools() print(f"āœ… Found {len(tools.tools)} tools:\n") for i, tool in enumerate(tools.tools, 1): print(f"{i:2d}. {tool.name}") print() # Test login print("šŸ”„ Testing login...") login_result = await session.call_tool( "login", arguments={ "phone": "+84909495665", "password": "Admin123@" } ) print(f"āœ… Login result: {login_result.content[0].text}\n") # Test whoami (requires authentication) print("šŸ”„ Testing whoami (authenticated call)...") whoami_result = await session.call_tool("whoami", arguments={}) print(f"āœ… Whoami result: {whoami_result.content[0].text}\n") # Test list_entities (requires authentication) print("šŸ”„ Testing list_entities (authenticated call)...") entities_result = await session.call_tool( "list_entities", arguments={"page": 1, "page_size": 5} ) print(f"āœ… Entities result: {entities_result.content[0].text[:200]}...\n") print("āœ… All integration tests passed!") if __name__ == "__main__": asyncio.run(test_full_integration())

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