Skip to main content
Glama
josuekongolo

CompanyIQ MCP Server

by josuekongolo
READY_TO_TEST.mdβ€’5.83 kB
# πŸš€ READY TO TEST - CompanyIQ 2.1.0 Full Automation **Status:** βœ… ALL FIXES APPLIED **Feature:** Auto-scrape ALL years of financial data **Method:** Puppeteer + PDF parsing --- ## βœ… What's Been Fixed ### 1. Path Issue β†’ FIXED βœ… **Problem:** `/data/pdfs` (wrong absolute path) **Solution:** Proper path resolution from build directory **Verification:** `data/pdfs/` directory created βœ… ### 2. Download Detection β†’ FIXED βœ… **Problem:** Not detecting when PDFs finish downloading **Solution:** File system polling (checks every 500ms for 15s) **Verification:** Code reviewed and rebuilt βœ… ### 3. Multi-Year Download β†’ FIXED βœ… **Problem:** Only getting one year **Solution:** - Clicks each download link separately - Waits for each PDF to complete - Renames to standard format ({orgNr}_{year}.pdf) - Continues to next year **Verification:** Logic implemented βœ… --- ## πŸ§ͺ Ready to Test ### Test Command: ``` "Auto-scrape financials for company 999059198" ``` ### What Should Happen: **Phase 1: Browser Launch (5-10s)** ``` πŸ€– Starting browser automation for 999059198... πŸ“ PDF download path: /Users/.../companyiq-mcp/data/pdfs πŸ“„ Navigating to: https://virksomhet.brreg.no/nb/oppslag/enheter/999059198 ``` **Phase 2: Find Links (3s)** ``` πŸ” Looking for annual account download links... βœ… Found 5 annual accounts available ``` **Phase 3: Download Each Year (30-40s)** ``` πŸ“₯ Downloading year 2024... βœ… Downloaded and saved 2024 as: .../999059198_2024.pdf πŸ“₯ Downloading year 2023... βœ… Downloaded and saved 2023 as: .../999059198_2023.pdf πŸ“₯ Downloading year 2022... βœ… Downloaded and saved 2022 as: .../999059198_2022.pdf πŸ“₯ Downloading year 2021... βœ… Downloaded and saved 2021 as: .../999059198_2021.pdf πŸ“₯ Downloading year 2020... βœ… Downloaded and saved 2020 as: .../999059198_2020.pdf ``` **Phase 4: Parse PDFs (10-15s)** ``` πŸ“– Parsing PDF for year 2024... βœ… Extracted data for 2024: Revenue=474M πŸ“– Parsing PDF for year 2023... βœ… Extracted data for 2023: Revenue=445M [... continues ...] ``` **Phase 5: Results** ``` πŸŽ‰ HENTET 5 Γ…R MED REGNSKAPSDATA! πŸ“Š OVERSIKT: 2024: 474M omsetning, 136M resultat 2023: 445M omsetning, 121M resultat 2022: 412M omsetning, 108M resultat 2021: 385M omsetning, 98M resultat 2020: 350M omsetning, 89M resultat βœ… ALLE 5 Γ…R LAGRET I DATABASE ⏱️ Totaltid: 55 sekunder ``` --- ## πŸ“ What Gets Created ### Files: ``` data/pdfs/ β”œβ”€β”€ 999059198_2024.pdf β”œβ”€β”€ 999059198_2023.pdf β”œβ”€β”€ 999059198_2022.pdf β”œβ”€β”€ 999059198_2021.pdf └── 999059198_2020.pdf ``` ### Database: ```sql SELECT * FROM financial_snapshots WHERE org_nr = '999059198'; Results: 2024 | 474325780 | 136503951 | ... | pdf_scraping 2023 | 445000000 | 121000000 | ... | pdf_scraping 2022 | 412000000 | 108000000 | ... | pdf_scraping 2021 | 385000000 | 98000000 | ... | pdf_scraping 2020 | 350000000 | 89000000 | ... | pdf_scraping ``` --- ## 🎯 Success Criteria ### βœ… Fully Successful: - Finds 5+ download links - Downloads all 5 PDFs - Parses all 5 successfully - Extracts data from all - Saves all to database - **Result: 5-year complete analysis!** ### ⚠️ Partially Successful: - Finds 5 links - Downloads all 5 PDFs - Parses 3-4 successfully (PDF parsing can be tricky) - Saves 3-4 to database - **Result: Most years captured, manually add 1-2** ### ❌ If It Fails: **Possible Issues:** - Website changed structure - Network timeout - Browser blocked - No PDFs available **Fallback:** ``` Use: build_financial_history (guided manual) Time: 20 minutes Success: 100% ``` --- ## πŸ’‘ After Testing ### If It Works: ``` πŸŽ‰ SUCCESS! β†’ You now have multi-year data automatically β†’ Run this once per year for updates β†’ Share your success! ``` ### If Partially Works: ``` βœ… Got 3-4 years automatically β†’ Manually import missing 1-2 years (5 min) β†’ Still saved 80% of time! ``` ### If It Fails: ``` ⚠️ Scraping issues β†’ Use build_financial_history instead β†’ Or use fetch_financials (latest year only) β†’ Report the issue for debugging ``` --- ## πŸ”§ Troubleshooting ### Error: "Timeout waiting for PDF" **Solution:** Company might have slow server, increase timeout in code ### Error: "No annual accounts found" **Solution:** Company hasn't submitted accounts, use API instead ### Error: "Failed to parse PDF" **Solution:** PDF format issue, use manual import for that year ### Error: "Browser automation blokkert" **Solution:** Firewall/antivirus blocking, whitelist Chromium --- ## πŸ“Š Expected vs Actual ### What SHOULD Happen: - Download: 5 years (2024-2020) - Parse: 4-5 years successfully - Database: 4-5 years saved - Time: 45-60 seconds ### What to Report: - How many years found? - How many PDFs downloaded? - How many successfully parsed? - Any error messages? --- ## πŸš€ Testing Instructions **1. Restart Claude Desktop** - Completely quit and reopen **2. Run test command:** ``` "Auto-scrape financials for company 999059198" ``` **3. Observe:** - Wait 60 seconds - Watch console output in logs - Check results **4. Verify:** ``` ls -la data/pdfs/ β†’ Should have multiple PDF files "Analyze growth for 999059198" β†’ Should show multi-year trends ``` --- ## 🎯 Bottom Line **Issue:** "Only captured 2024 completely" **Fixes Applied:** - βœ… Path resolution - βœ… Download detection - βœ… Multi-year logic - βœ… File renaming - βœ… Error handling **Status:** βœ… READY FOR TESTING **Next:** Restart Claude Desktop and try: ``` "Auto-scrape financials for 999059198" ``` **Expected:** ALL years downloaded and parsed automatically! 🎯 --- **If it works: You have the world's most automated free company intelligence platform!** πŸš€ **If it needs adjustment: Report what you see and I'll fine-tune it!** πŸ”§

Latest Blog Posts

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/josuekongolo/companyiq-mcp'

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