Lintbase

Lintbase

Developers are constantly feeding context files to AI tools like Cursor, Windsurf, Copilot Workspace, and Claude Code. If your agent doesn't understand your real database schema, it writes code that fails in production. LintBase acts as the bridge. It connects directly to your database, reads the ground truth of your live documents, and generates structured context optimized for AI. 🤖 Stops AI

Category
访问服务器

README

LintBase

Ground Truth for AI Coding Agents. LintBase gives AI agents real-time knowledge of your database schema, security rules, and architecture so they stop hallucinating your codebase.

npx lintbase export-context firestore --key ./service-account.json

npm version npm downloads License: MIT


Why LintBase?

Developers are constantly feeding context files to AI tools like Cursor, Windsurf, Copilot Workspace, and Claude Code. If your agent doesn't understand your real database schema, it writes code that fails in production.

LintBase acts as the bridge. It connects directly to your database, reads the ground truth of your live documents, and generates structured context optimized for AI.

  • 🤖 Stops AI Hallucinations — Generates exact schema, field presence rates, and types.
  • 📐 Catches Schema Drift — CI protection with lintbase check against schema snapshots.
  • 🔒 Security Context — Highlights missing rules or exposed PII before your AI writes queries.
  • 💸 Cost Awareness — Prevents AI from writing unbounded queries on 2M+ document collections.
  • 🍃 Universal NoSQL — Works effortlessly with Firestore and MongoDB.

🤖 AI Context Export (For Cursor, Claude, Windsurf)

The fastest way to give your AI agent perfect database knowledge.

npx lintbase export-context firestore --key ./service-account.json

Output:

/lintbase-context/
├── database-schema.md
├── collections.md
├── security-rules.md
├── architecture.md
└── risk-report.md

Drop the lintbase-context folder into your AI's context window, or mention it in .cursorrules. Your agent will now write perfect, drift-free database queries.


Quick Start

1. Get a service account key

Firebase Console → Project Settings → Service Accounts → Generate new private key

Save the JSON file. Never commit it to git.

2. CI Pipeline Protection (Schema Drift)

LintBase acts as "Version Control for your Schema". Run the snapshot command to create a baseline:

npx lintbase snapshot firestore --key ./service-account.json

Commit .lintbase/schema.json to your repository. Then, add the check command to your CI/CD pipeline (GitHub Actions, GitLab CI):

npx lintbase check firestore --key ./service-account.json --fail-on error

If a query or deployment accidentally deletes a critical field or changes a type (e.g., string to number), your CI build will fail instantly.

3. Run a general scan

npx lintbase scan firestore --key ./service-account.json

You'll see a full report in your terminal:

 LintBase — Firestore Scan
 ─────────────────────────────────────────────
 Collections scanned:  12
 Documents sampled:    847
 Issues found:         23  (4 errors · 11 warnings · 8 infos)
 Risk score:           67 / 100  [HIGH]

 ERRORS
 ✖  users         no-auth-check        Documents readable without authentication
 ✖  orders        missing-index        Query on `status` + `createdAt` has no composite index
 ✖  debug_logs    large-collection     Collection has 2.4M docs — estimated $340/mo in reads

 WARNINGS
 ⚠  products      schema-drift         Field `price` found as both Number and String
 ⚠  sessions      ttl-missing          No expiry field — stale docs accumulate indefinitely
 ...

3. Save to your dashboard (optional)

Track your database health over time at lintbase.com:

npx lintbase scan firestore \
  --key ./service-account.json \
  --save https://www.lintbase.com \
  --token <your-api-token>

Get your token at lintbase.com/dashboard/settings.


Supported Databases

  • Firestore: npx lintbase scan firestore --key ./sa.json
  • MongoDB: npx lintbase scan mongodb --uri mongodb+srv://user:pass@cluster.mongodb.net/test

🤖 AI Agent Integration (MCP)

Using Cursor, Claude Desktop, or Windsurf? Install lintbase-mcp to give your AI agent real-time Firestore schema context — so it stops hallucinating field names.

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "lintbase": {
      "command": "npx",
      "args": ["-y", "lintbase-mcp"]
    }
  }
}

Now when you ask your AI "add a field to users", it will check your real schema first before writing a line of code.

Full setup guide & tools reference


What it catches

🔒 Security

Rule What it detects
no-auth-check Collections readable/writable without auth
exposed-pii Email, phone, SSN fields without encryption markers
world-readable Documents with overly permissive security rules

💸 Cost

Rule What it detects
large-collection Collections with 100k+ docs and high read cost
unbounded-query Queries without limit() that scan entire collections
missing-index Filter combinations that fall back to full collection scans
debug-collection Collections that look like temporary data that was never cleaned up

📐 Schema Drift

Rule What it detects
type-inconsistency Field stored as different types across documents
missing-required-field Field present in 90%+ of docs but absent in some
nullable-id Reference fields that are sometimes null

⚡ Performance

Rule What it detects
deep-nesting Document fields nested > 3 levels deep
large-document Documents approaching the 1MB Firestore limit
hot-document Single document updated by many users simultaneously
no-pagination Collections without a standard pagination field

Options

lintbase <command> <database> [options]

Commands:
  scan <database>             Scan a database and print diagnostic report
  export-context <database>   Export schema to markdown/JSON for AI agents
  snapshot <database>         Generate local schema snapshot for CI comparison
  check <database>            Run in headless CI mode (fails on schema drift)

Options:
  --key <path>      Path to Firebase service account JSON 
  --uri <uri>       MongoDB connection URI
  --limit <n>       Max documents to sample per collection     [default: 100]
  --fail-on <lvl>   Fail pipeline if issues exceed severity (error, warning, info)
  --save <url>      Dashboard URL to save results
  --token <token>   API token for dashboard (from lintbase.com)
  --collections     Comma-separated list of collections to scan
  -h, --help        Show help

Dashboard

The CLI is free forever. The dashboard visualizes your scan results as an interactive schema map — your credentials never leave your machine.

What Pro gets you via --save:

  • ⬡ Schema Map — every collection as a draggable card, with real field names, types, presence rates, and issue badges
  • ◎ Health Radar — per-collection spider chart across Schema, Security, Performance, and Cost axes
  • ⊕ Priority Quadrant — 2×2 bubble chart of Impact vs. Ease of Fix — tells you what to fix first
  • ≋ Drift Timeline — stored history across scans so you can replay your schema architecture over time.

CLI Local Tooling: 100% Free · Pro: $39/month — unlimited history, dashboards, and shared team workflow.


Security

  • Your service account key never leaves your machine — it is only read locally
  • Document sampling is hard-capped at --limit (default 100) to prevent accidental read costs
  • The --save flag only sends the scan summary and issue list — never raw document data

License

MIT © Mamadou Dia

推荐服务器

Baidu Map

Baidu Map

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

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

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

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

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

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

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

官方
精选
本地
TypeScript
VeyraX

VeyraX

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

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

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

官方
精选