--- name: flocon-mcp description: Use when debugging a mobile app (Android, iOS, KMP) connected to Flocon Desktop - inspecting network calls, mocking a response or error, reading app files, analytics events, feature flags, accessibility events, crashes, WebView logs or SQLite databases. --- # Debugging a mobile app with Flocon Flocon Desktop receives what happens in the mobile app connected to it and exposes it through the `flocon` MCP server (tools `mcp__flocon__*`). ## Prerequisites - Flocon Desktop must be running (the MCP server listens on `http://localhost:9042/mcp`, loopback only). - The app must be connected to Flocon. If a tool fails to connect or returns no device, ask the user to start Flocon Desktop and the app. ## Targeting By default every tool targets the device and app selected in Flocon Desktop. Call `list_devices` to see the others (each has a `connectionType`: `default` for localhost, `wifi` when connected through the connect module), then pass `deviceId` and `packageName`. ## What to use for what | Goal | Tools | |---|---| | Understand what the app did around a moment ("before the crash", "at 14:32", "recently"), or know if an event was sent | `get_timeline` first: one narrative of every source with the anomalies first (crash, HTTP errors, loops, responses over 1 MB). Give nothing to let it choose (the latest crash, otherwise the last 2 minutes) and read `window.reason`; `mode` / `at` / `from` / `to` / `eventId` to choose; `search` to know if an event was sent; `excludeSources: ["database"]` if the database lines are noise. Then use the ids of its lines (`network:` for `get_network_call`, `crash:` for `get_crash_report`) | | Show the user a zone of the timeline (a crash, an error, a loop, a large call) in Flocon | `show_in_timeline` (`eventId` of `get_timeline`, or a time, or nothing: the latest crash then the main anomaly; `view` graph or list). It selects the device and app, opens the timeline and centers the graph. Flocon is not brought to the front: tell the user to go to the Flocon app. Read `hiddenBy` and the message: if a filter of the user hides the event, say it, the filters are never changed | | Find a failing or slow call | `list_network_calls`, `search_network_calls` (summaries), then `get_network_call` with a `callId` for headers, bodies and the cURL command | | Make the app receive a fake response or exception | `create_network_mock` (`fromCallId` starts from a captured call), `update_network_mock`, `list_network_mocks`, `get_network_mock`, `delete_network_mock` | | Check a file written by the app | `list_files` ("files" / "caches" directories), `read_file` | | Read a custom dashboard of the app | `list_dashboards`, `get_dashboard` for its elements and values | | Investigate a crash | `list_crash_reports` for the exception type and message, `get_crash_report` for the full stack trace | | Debug a WebView (JS console errors, failed page loads, calls from the page to native code) | `list_webview_events` (filters: `kind` console / page / bridge, text, start timestamp); the requests made by the page are not captured yet | | Check analytics events | `count_analytics_events` for an overview per event name, `list_analytics_events` for the properties, `list_analytics_tables` | | Check the deeplinks of the app | `list_deeplinks` (declared links and parameters), `list_deeplink_history`, `open_deeplink` (opens a link on the device, fill its parameters first) | | See the current screen, or keep a visual trace | `take_screenshot` (saves a PNG and returns the image) | | See what the Flocon desktop app itself displays (the screen the user is looking at in Flocon) | `take_flocon_desktop_screenshot` (returns the image of the visible window, nothing is saved; not the device screen) | | Show the user something in the Flocon desktop app (a screen, another device / app, the graph or list view of the timeline) | `flocon_navigate_into_desktop_app` (`screen`, `deviceId`, `packageName`, `timelineView`; Flocon is not brought to the front, so tell the user to go to the Flocon app to see it) | | Reproduce a bug on video | `start_screen_recording`, do the scenario, then `stop_screen_recording` (returns the mp4 path; Android stops by itself after 3 minutes) | | Show the user the saved screenshots, videos or exports | `open_flocon_folder` (opens the Flocon documents folder, optional `Screenshot` / `ScreenRecord` sub folder) | | Check SharedPreferences | `list_shared_preferences` (gives the `sharedPreferenceId` and the storage `type`), `get_shared_preference_values` (typed values, optional text filter) | | Check feature flags | `list_feature_flags` (provider, name, state, variant, filters), `get_feature_flag` for the full payload | | Check what a screen reader gets (focus order, announcements, content descriptions) | `get_accessibility_state` first (is TalkBack / VoiceOver on, is capture supported), then `list_accessibility_events` (type and text filters), `clear_accessibility_events`; walk the focus order with `move_accessibility_focus` (`next` / `previous`, needs TalkBack on) and read where it is with `get_accessibility_focused_node` | | Check which images the app loaded | `list_images` (urls and load times) | | Check persisted data | `list_databases` (gives the `databaseId`), `list_database_tables` (schema), `query_database`, `list_database_query_logs` (queries run by the app) | | Check custom tables | `list_tables` (gives the `tableId`), `list_table_items` (rows, optional text filter) | ## Rules - Mocks change the app behavior: prefer disabling a mock (`update_network_mock`) over deleting it, and tell the user which mocks you left enabled. - `query_database` is read only (`SELECT`, `PRAGMA` without value, `EXPLAIN`): always add a `LIMIT`. - Files, calls and databases cannot be modified, only mocks can. - `get_timeline` only reads. The times are those of the phone, not the computer. Read `window.reason`, `truncated` and `notes` before concluding: an empty answer can mean the window was wrong, not that nothing happened. - `show_in_timeline` changes what the user sees and selected in Flocon (device, app, the timeline view saved in their preferences) but never their filters. The graph draws network, database and analytics events only: for a crash or another source, say that its row is in the list (`view: list`). The request is only registered: it does not tell that the user saw it. - `flocon_navigate_into_desktop_app` changes what the user selected in Flocon (device, app) and saves the timeline view in their preferences: use it when asked to show something, say what you changed, and ask them to go to the Flocon app. - `take_screenshot`, `start_screen_recording` and `open_flocon_folder` act on the device / computer (iOS: the booted Simulator only): use them when asked or when seeing the screen helps. `take_screenshot`, `start_screen_recording` and `open_deeplink` use adb on Android, so they fail for a device whose `connectionType` (in `list_devices`) is `wifi`. - `take_flocon_desktop_screenshot` only reads: it captures the Flocon main window as displayed, with its open dialogs, menus and popups (separate windows such as About are not included). - Start from summaries and fetch details only for the calls you need, bodies can be large.