Skip to main content
Glama
lintbase
by lintbase

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.

Why not just let the agent read the code?

Because in document databases, the code lies. The real schema is whatever your live documents actually contain, and that drifts away from the code with every half-finished migration, every renamed field, and every previous AI session that wrote in a hurry. An agent inferring the schema from TypeScript interfaces writes plausible queries against a database that no longer exists. The failure is silent: empty results, undefined values, a new field variant living alongside the old one. LintBase reads the documents, not the code.

Limitations (honest ones)

  • Firestore and MongoDB only. Postgres is the obvious gap and it is next.

  • Large collections are sampled, not fully scanned. Presence rates are estimates on multi-million-document collections.

  • The MCP server is newer than the CLI. Expect rough edges there first.


Related MCP server: Carto MCP Server

๐Ÿค– 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]
  --max-depth <n>   Firestore: tiers to recurse into subcollections
                    (1 = top-level only)                       [default: 2]
  --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

Available Tools

3 tools
lintbase_get_issuesLintBase Get IssuesA

Runs all LintBase analyzers and returns a filtered list of issues. Use this for targeted questions like "any errors in users?", "schema issues only?", or "all security problems?". Lighter than lintbase_scan โ€” returns only actionable issues, no summary metadata. Filter by severity (error/warning/info), collection name, or rule prefix (schema/, security/, perf/, cost/).

ParametersJSON Schema
NameRequiredDescriptionDefault
ruleNoFilter by rule prefix, e.g. "schema/" returns only schema drift issues, "security/" only security issues.
keyPathYesAbsolute or relative path to the Firebase service account JSON file.
severityNoFilter by severity. Omit to return all severities.
collectionNoFilter to a single collection name. Omit to scan all collections.
sampleSizeNoMax documents to sample per collection (default: 50).

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Without annotations, the description carries full burden. It discloses that the tool runs all analyzers, returns only actionable issues, and lists filtering capabilities. It does not mention side effects or authentication details beyond the required keyPath.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, front-loaded with main purpose, no wasted words. Efficient and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a list tool with 5 parameters and no output schema, the description covers main purpose and filtering hints. Missing return format details, but adequate given scope.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description reinforces parameter usage with examples but adds little beyond the schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states 'Runs all LintBase analyzers and returns a filtered list of issues,' providing a specific verb and resource. It further differentiates from sibling tools by contrasting with lintbase_scan, which returns summary metadata.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit usage examples ('targeted questions like ...') and contrasts with lintbase_scan. While it doesn't specify when not to use, the context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

lintbase_get_schemaLintBase Get SchemaA

Returns the ground-truth schema of your Firestore collections by sampling real documents. For each collection you get field names, observed types, and presence rates. Use this BEFORE writing any database code to avoid hallucinating field names. Stable fields (โ‰ฅ80% presence, single type) are safe to use. Fields marked with a note need attention (drift, sparse, or optional).

ParametersJSON Schema
NameRequiredDescriptionDefault
formatNoOutput format. Use "md" to write Obsidian-compatible Markdown files to disk.
keyPathYesAbsolute or relative path to the Firebase service account JSON file.
outPathNoPath to write Markdown output. For a single collection: full file path (e.g. "./docs/schema/users.md"). For all collections: directory path (e.g. "./.lintbase/schema").
collectionNoName of a single collection to inspect. Omit to get the schema of ALL collections.
sampleSizeNoMax documents to sample per collection (default: 50).

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description carries full burden. Discloses sampling behavior, field details (names, types, presence rates), and stable field criteria. Doesn't mention side effects or permissions, but implies read-only operation. Adequate for a schema inspection tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, front-loaded with purpose, efficient structure. Every sentence delivers value: purpose, usage advice, field interpretation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema, but description explains return data (fields, types, rates). However, ambiguity exists: description says 'Returns schema' but format param writes Markdown to disk; unclear if tool returns data or only writes files. Missing explanation of output mode.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

100% schema coverage meets baseline. Description adds usage context (e.g., 'Use this BEFORE...') but does not elaborate on individual parameters beyond schema. Marginal added value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States specific verb and resource: 'Returns the ground-truth schema of your Firestore collections by sampling real documents.' Distinguishes from siblings (lintbase_get_issues, lintbase_scan) by focusing on schema discovery rather than issues or scanning.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly advises use 'BEFORE writing any database code to avoid hallucinating field names.' Provides interpretation guidelines for fields (stable vs need attention). Lacks explicit when-not-to-use or comparison with siblings, but context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

lintbase_scanLintBase Full ScanA

Runs a full LintBase scan against a Firestore database. Detects schema drift, security issues, performance problems, and cost leaks. Returns a structured report with a risk score and actionable issues. Use this before writing any database-related code to get ground-truth schema context.

ParametersJSON Schema
NameRequiredDescriptionDefault
keyPathYesAbsolute or relative path to the Firebase service account JSON file.
sampleSizeNoMax documents to sample per collection (default: 50, max: 500).
collectionsNoOptional list of collection names to scan. Omit to scan all collections.

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It describes the tool as a scan that detects issues, implying read-only behavior, but does not explicitly state whether it modifies data, what authentication is required, or potential performance impacts. The lack of explicit safety declarations is a gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences that are front-loaded and each sentence earns its place: action, detections/returns, and usage guidance. No wasted words, efficient and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description states the output is a structured report with risk score and actionable issues, but lacks details on the report structure or error handling. For a scan tool that produces a complex report, this is adequate but not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage: keyPath, sampleSize, and collections are all described in the schema. The description does not add additional meaning beyond what the schema provides (e.g., it doesn't explain sampleSize constraints or collection format). Baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'runs a full LintBase scan' against a Firestore database, listing specific detections (schema drift, security issues, etc.) and outputs (structured report with risk score). It distinguishes itself from sibling tools by emphasizing 'full scan' and 'ground-truth schema context', implying it covers everything that sibling tools might offer individually.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Use this before writing any database-related code to get ground-truth schema context', providing a clear when-to-use recommendation. It does not, however, specify when not to use it or directly contrast with sibling tools for narrower use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv0.2.0
    • First observedlintbase_get_issues
    • First observedlintbase_get_schema
    • First observedlintbase_scan

TDQS

A4.1/5.0
Disambiguation4/5

The three tools are largely distinct: lintbase_get_issues returns filtered issues for targeted queries, lintbase_get_schema returns schema information, and lintbase_scan returns a full report. Some overlap exists between get_issues and scan (both yield issues), but clear descriptions mitigate confusion.

Naming Consistency4/5

All tools use the 'lintbase_' prefix and snake_case. Two follow the 'get_X' pattern (get_issues, get_schema), while the third uses a bare verb (scan). This slight inconsistency prevents a perfect score, but the pattern is still clear and readable.

Tool Count5/5

With three tools, the surface is well-scoped for a linting/analysis service. Each tool serves a distinct purpose: schema retrieval, filtered issues, and full scans. No tool is redundant, and the count is appropriate for the domain.

Completeness5/5

The tool set covers core analysis needs: obtaining ground-truth schema, running comprehensive scans, and querying specific issues. There are no obvious gaps for typical development workflows involving Firestore linting.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Transforms static coding standards into a queryable live data store for AI agents, delivering task-specific rules and fix guidance on demand. This optimizes context window usage through progressive disclosure, ensuring agents apply relevant governance without loading massive documentation.
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Connect your LLMs to SQL databases safely and intuitively using the Model Context Protocol (MCP). NLP Database acts as a secure, read-only bridge that allows AI agents to explore schemas and query data using natural language.
    3
    MIT
  • F
    license
    B
    quality
    D
    maintenance
    Validates schema files against customizable lint rules using Claude or Gemini AI, supporting JSON and SQL schemas with rules for naming, structure, and migration safety.
    1
    -

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/lintbase/lintbase'

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