Flip Database MCP

Flip Database MCP

A standalone MCP server for querying a PropertyRadar flip-tracking Supabase database. It offers read-only tools for searching properties, retrieving flip history, summarizing metrics, and running SQL queries.

Category
访问服务器

README

Flip Database MCP

A standalone MCP server exposing 3 read-only tools over your PropertyRadar flip-tracking Supabase database (the properties table). Built to let Claude answer questions and summarize data from that database directly, independent of the Deal Analysis Tool.

Tools

  • search_flip_database — filtered search (city, zip, spread %, days held, price range) → matching rows, sorted by spread % descending
  • get_property_flip_history — look up one property by address or RadarID → its full transfer history record
  • summarize_flip_metrics — aggregate stats (avg spread %, avg days held, top performers) for a city/zip/date range — the "advise decisions" tool
  • run_sql_query — open-ended, read-only SQL for questions the other 3 tools can't answer: correlations (corr(sqft, spread_pct)), threshold/ bucket analysis (width_bucket(...)), multi-dimensional grouping ("which areas do best with condos specifically"). Runs as a dedicated flip_readonly Postgres role with only SELECT on properties — no write access anywhere, enforced by the database itself, not just by this code. Also enforces: SELECT-only, single-statement-only, a 5-second timeout, and a hard 500-row cap on every query.

All four only ever read from the properties table. Nothing here writes to it — that stays the job of the separate Python webhook/backfill pipeline.

Setup

1. Create the read-only role

In your flip-tracking Supabase project's SQL Editor, run the flip_readonly role creation block from schema.sql (in the Python pipeline's repo) — replace the placeholder password with a real strong one first.

2. Build the read-only connection string

Supabase's Database settings → Connection string gives you the host/port format. Swap in the flip_readonly role and its password:

postgresql://flip_readonly:YOUR_PASSWORD@YOUR_PROJECT_HOST:5432/postgres

3. Environment variables

Copy .env.example to .env locally for testing, and set the same six in Railway's Variables tab for deployment:

Variable Where it comes from
FLIP_SUPABASE_URL Your flip-tracking Supabase project → Settings → API
FLIP_SUPABASE_SERVICE_KEY Same page — the legacy service_role key (not the new sb_secret_... format — see note below)
FLIP_DB_READONLY_URL The connection string from step 2, using the flip_readonly role
OAUTH_ISSUER Your deployed Railway URL, e.g. https://flip-database-mcp-production.up.railway.app
JWT_SECRET Make up a long random string
MCP_AUTH_TOKEN Make up another random string (a static-token fallback, same pattern as deal-analysis-mcp)

Important: use the legacy service_role key, not the new-format sb_secret_... key. The same library-compatibility issue we hit on the Python webhook service applies here too — the installed @supabase/supabase-js version may not yet support the new key format cleanly.

4. Local dev

npm install
npm run dev

5. Deploy to Railway

Same pattern as deal-analysis-mcp: connect this repo, Railway auto-detects the Dockerfile, set the environment variables above, generate a public domain.

6. Connect it to Claude

Once deployed, add it as a new connector in Claude using its URL:

https://your-app-name.up.railway.app/mcp

Claude will walk through the OAuth flow automatically (dynamic client registration → authorize → token) — same mechanism already proven working with the Deal Analysis Tool connector.

Notes on future integration

If you later want these same 3 tools available inside the Deal Analysis Tool as well (for cross-referencing during comp analysis), the query logic in src/tools/*.ts here is written as plain, dependency-free functions — they can be copied into deal-analysis-mcp's src/tools/ folder with only the Supabase client import changed to point at this project's credentials (registered there under different env var names, e.g. FLIP_SUPABASE_URL, so it never collides with that project's existing SUPABASE_URL used for deal_analyses).

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选