Skip to content
Conduit

mcp server

AgSKAN

A Live farming map, uses devices gps to track location and sync everyone together on a sattelite map, with the ability to add landmarks and mark completed work.

Lucho-git/AgSKANcommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

This project does not publish an install method we can turn into a config. Follow the README instead.

README

synced Oct 26, 2026

AgSKAN

AgSKAN is a field mapping and live machinery tracking app for farming teams. It records vehicle trails, shows shared map activity, supports offline field work, and packages the SvelteKit web app into native iOS and Android shells with Capacitor.

The app is intentionally built as a static Capacitor app. Client-side code talks directly to Supabase, Supabase Edge Functions, Stripe-hosted billing flows, Mapbox, and native Capacitor plugins. SvelteKit server routes are not part of the production runtime.

Core Stack

  • SvelteKit with static adapter
  • Capacitor for iOS and Android packaging
  • Supabase Auth, Postgres, Realtime, Storage, and Edge Functions
  • Stripe Checkout and Stripe Customer Portal
  • Mapbox GL, Mapbox Draw, Turf, and PostGIS-backed trail data
  • Dexie/IndexedDB for offline queues and crash-safe sync
  • TransistorSoft Background Geolocation and custom raw GPS plugins
  • Tailwind CSS and DaisyUI

App Areas

  • Marketing, login, onboarding, account, and billing screens
  • Map viewer with fields, markers, overlays, drawing tools, and trail layers
  • Live vehicle state sharing through Supabase Realtime
  • Foreground and background GPS tracking for native devices
  • Offline persistence for pending trail coordinates, closures, and marker edits
  • Supabase Edge Functions for billing, notifications, and contact flows

Local Development

Install dependencies:

npm install

Run the web app locally:

npm run dev

Run checks:

npm run check
npm run lint
npm run format_check
npm run test

Build the static web app:

npm run build

Environment

The app expects Supabase, Mapbox, Stripe, push notification, and email/contact related environment variables depending on which feature is being exercised. Common local variables include:

PUBLIC_SUPABASE_URL=
PUBLIC_SUPABASE_ANON_KEY=
PUBLIC_MAPBOX_ACCESS_TOKEN=
PUBLIC_SITE_NAME=AgSKAN
PUBLIC_APP_VERSION=

Private service-role and Stripe secrets are used by scripts or Supabase Edge Functions, not by the static client bundle.

Static Runtime Notes

  • The production app is generated with @sveltejs/adapter-static into build/.
  • Capacitor packages the static build into the native projects under ios/ and android/.
  • Runtime backend behavior should live in Supabase, Supabase Edge Functions, Stripe, or Postgres RPCs.
  • Avoid adding SvelteKit +server routes for production app behavior, since the app must keep working as a static native bundle.

Native Builds

After a web build, sync Capacitor assets into native projects:

npx cap sync

Open native projects:

npx cap open ios
npx cap open android

Repository Notes

  • src/lib/components/map contains the main map, trail, marker, field, and vehicle UI.
  • src/lib/services contains GPS/background/offline service code.
  • src/lib/api contains client-side API wrappers for Supabase and Edge Functions.
  • supabase/functions contains deployable Supabase Edge Functions.
  • scripts contains operational maintenance scripts for trail, billing, and data cleanup work.

Supabase Project & MCP Access (for AI agents)

Project ref: hmxxqacnzxqpcheoeidn (AgSKAN, region ap-southeast-2).

AI agents that need direct database/storage/function access should connect to the Supabase MCP server. The MCP server runs on Supabase's infrastructure, so it works even when the machine's IP isn't allow-listed for direct Postgres connections.

Register the MCP server

Add it with the Copilot CLI (or edit ~/.copilot/mcp-config.json directly):

copilot mcp add --transport http supabase "https://mcp.supabase.com/mcp?project_ref=hmxxqacnzxqpcheoeidn&features=docs%2Caccount%2Cdatabase%2Cdebugging%2Cdevelopment%2Cfunctions%2Cbranching"

Equivalent ~/.copilot/mcp-config.json entry:

{
  "mcpServers": {
    "supabase": {
      "type": "http",
      "url": "https://mcp.supabase.com/mcp?project_ref=hmxxqacnzxqpcheoeidn&features=docs%2Caccount%2Cdatabase%2Cdebugging%2Cdevelopment%2Cfunctions%2Cbranching"
    }
  }
}

The features= parameter is required — it enables the database, debugging, development, functions, branching, account, and docs tool groups. Without it, write tools such as apply_migration/execute_sql are unavailable.

Authenticate

copilot -i /mcp

Select the supabase server and complete the browser OAuth flow (sign in with a Supabase account that has access to the project).

After authorizing, reload the VS Code window (Developer: Reload Window) so the Copilot Chat extension re-establishes its MCP connection with the fresh token — authorizing via the CLI alone does not refresh an already-running agent session.

Verify

A quick sanity check once connected:

  • get_project / list_projects should return AgSKAN.
  • execute_sql with SELECT 1; should succeed.

Fallback (if MCP is unavailable)

The Supabase CLI is authenticated on this machine:

npx supabase projects list

Direct db commands (e.g. supabase db query --linked) require the machine's IP to be in the project's database allow-list and will fail otherwise — prefer the MCP server for schema changes and data queries.

If the MCP write tools are disabled (read-only), scripts/supabase-sql-runner.ps1 can run SQL via the Supabase Management API instead (uses the CLI access token from the Windows Credential Manager, never printed):

powershell -File scripts/supabase-sql-runner.ps1 -SqlFile path/to/query.sql
↑↓ navigate openesc close