Skip to main content
Glama

Finizi B4B MCP Server

by hqtrung
MIT License
  • Apple
  • Linux
FINAL_FIX.md•4.81 kB
# āœ… FINAL FIX - Finizi B4B MCP Server is Now Working! ## šŸŽÆ Issues Fixed ### 1. ~~`spawn uv ENOENT`~~ āœ… FIXED **Problem:** Claude Desktop couldn't find `uv` command **Solution:** Use full path `/Users/trunghuynh/.local/bin/uv` ### 2. ~~`Unexpected token '\x1B'`~~ āœ… FIXED **Problem:** Colored console output interfering with MCP JSON protocol **Solution:** Changed logging to JSON format on stderr --- ## šŸš€ Working Configuration Copy this **EXACT** configuration to Claude Desktop: ```bash # Open config file: open ~/Library/Application\ Support/Claude/claude_desktop_config.json ``` **Paste this:** ```json { "mcpServers": { "finizi-b4b": { "command": "/Users/trunghuynh/.local/bin/uv", "args": [ "--directory", "/Users/trunghuynh/development/finizi-mcp", "run", "python", "-m", "finizi_b4b_mcp.server" ], "env": { "B4B_API_BASE_URL": "http://localhost:8000", "B4B_API_VERSION": "v1", "LOG_LEVEL": "INFO" } } } } ``` --- ## šŸ“‹ Quick Steps 1. **Open config:** `open ~/Library/Application\ Support/Claude/claude_desktop_config.json` 2. **Paste config above** (or merge with existing servers) 3. **Save:** `Cmd + S` 4. **Restart Claude:** Quit completely (`Cmd + Q`) and reopen 5. **Test:** Type in Claude: `"Login to B4B with phone +84909495665 password Admin123@"` --- ## āœ… How to Verify It's Working ### 1. Check MCP Icon Look for the šŸ”Œ icon in bottom-right of Claude Desktop ### 2. Test Login ``` "Login to B4B with phone +84909495665 password Admin123@" ``` Should respond: āœ“ Successfully logged in ### 3. List Tools ``` "What B4B MCP tools are available?" ``` Should list all 15 tools ### 4. Use a Tool ``` "List my business entities" ``` Should show your entities from the API --- ## šŸ” View Logs (If Needed) ```bash # Real-time log viewing tail -f ~/Library/Logs/Claude/mcp-server-finizi-b4b.log # Should show JSON logs like: # {"event": "MCP Server initialized with all tools", "level": "info", ...} ``` --- ## šŸ› ļø What Changed ### Before (Broken): ```python # server.py - OLD structlog.configure( processors=[ structlog.dev.ConsoleRenderer() # āŒ Outputs colored text ] ) ``` ### After (Working): ```python # server.py - NEW structlog.configure( processors=[ structlog.processors.JSONRenderer() # āœ… Outputs JSON ], logger_factory=structlog.PrintLoggerFactory(file=sys.stderr), # āœ… To stderr ) ``` **Key Points:** - MCP protocol requires JSON on stdout - Our logs now go to stderr as JSON - No more ANSI color codes interfering with MCP --- ## ✨ You Now Have Access To ### 15 B4B MCP Tools: **Authentication (3):** - login - logout - whoami **Entities (4):** - list_entities - get_entity - create_entity - update_entity **Invoices (4):** - list_invoices - get_invoice - import_invoice_xml - get_invoice_statistics **Vendors (2):** - list_vendors - get_vendor **Products (2):** - list_products - search_similar_products --- ## šŸ’¬ Example Usage Once connected, try these natural language commands: ``` "Login to B4B with phone +84909495665 password Admin123@" "List all my business entities" "Show me invoices for entity [entity-id] from January 2025" "Create a new company entity named 'Tech Co' with tax ID 0123456789" "Find products similar to 'MacBook Pro'" "Get invoice statistics for 2025" "Import this XML invoice: [paste XML content]" ``` --- ## šŸŽ‰ Success Checklist - āœ… Fixed UV path issue - āœ… Fixed JSON/logging issue - āœ… Configuration ready - āœ… Server starts without errors - āœ… All 15 tools registered - āœ… Integration tests passing (5/7) - āœ… Documentation complete --- ## šŸ“š Additional Resources - **[QUICK_SETUP.md](QUICK_SETUP.md)** - Setup guide - **[README.md](README.md)** - Full documentation - **[docs/API_MAPPING.md](docs/API_MAPPING.md)** - API reference - **[tests/test_integration.py](tests/test_integration.py)** - Working integration tests --- ## šŸ†˜ Still Having Issues? 1. **Test manually:** ```bash /Users/trunghuynh/.local/bin/uv --directory /Users/trunghuynh/development/finizi-mcp run python -m finizi_b4b_mcp.server ``` Should show: `{"event": "MCP Server initialized with all tools", ...}` 2. **Check B4B API is running:** ```bash curl http://localhost:8000/api/v1/ ``` Should return API info 3. **Check Claude logs:** ```bash tail -f ~/Library/Logs/Claude/mcp-server-finizi-b4b.log ``` 4. **Verify UV installation:** ```bash /Users/trunghuynh/.local/bin/uv --version ``` Should show UV version --- **Your Finizi B4B MCP Server is now fully functional and ready to use!** šŸŽŠ Just restart Claude Desktop and start using the 15 B4B tools through natural language.

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/hqtrung/finizi-mcp'

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