# Flarelink [Health: Active]

**Category:** ☁️ Cloud Platforms  
**Repository:** https://github.com/flarelink-dev/mcp  
**GitHub Stars:** 1  
**npm Downloads (last month):** 334  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/flarelink

## Description
Build on the Flarelink stack — Cloudflare auth, D1, and R2 — from your AI coding tools.

## Tools
Capabilities this server exposes over MCP:

- **flarelink_stack_overview** — Read this first. The Flarelink stack (Cloudflare auth via better-auth + KV sessions, D1, R2), its cardinal rules, and the two deployment shapes. Call before building auth/database/file features on Cloudflare.
- **flarelink_scaffold** — How to bootstrap a complete, working Flarelink-stack app (auth + D1 + R2): clone command, one-click deploy, file map, and where to add features.
- **flarelink_list_patterns** — List the available canonical code patterns (keys + what each is for). Use flarelink_get_pattern to fetch one.
- **flarelink_get_pattern** — Return the canonical, copy-pasteable code for one Flarelink-stack recipe (auth setup, route guards, identifier-safe D1 queries, R2 uploads/presigning, wrangler bindings, SDK usage). Prefer these over inventing your own — they encode the security + cost rules.
- **flarelink_sdk_reference** — Signatures and return shapes for the @flarelink/client SDK (auth / storage / db). Use when the app talks to a hosted Flarelink auth Worker rather than embedding better-auth.
- **flarelink_cost_patterns** — Design guidance (not a live usage meter) for keeping a Cloudflare bill near zero. Optionally describe the feature you are building to get targeted hints first.
- **flarelink_whoami** — Verify the FLARELINK_API_KEY and show the signed-in user plus the active Cloudflare connection and project. Call this first to confirm management tools are wired up.
- **flarelink_list_projects** — List the Flarelink projects on the active Cloudflare connection.
- **flarelink_list_databases** — List the D1 databases attached to the active Flarelink project (id, name, whether it hosts the auth module).
- **flarelink_query_database** — Run a SQL statement against one of the project's D1 databases via Flarelink. Use bound parameters (? placeholders + params) — never concatenate user input. Returns rows + query meta (duration, rows_read/written). This runs with full database access; prefer SELECT unless you intend to write.
- **flarelink_list_buckets** — List the R2 buckets attached to the active Flarelink project.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "flarelink": {
    "command": "npx",
    "args": ["-y","@flarelink/mcp"],
    "env": {
      "FLARELINK_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `FLARELINK_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What the Flarelink MCP server does

The Flarelink MCP server gives AI coding tools structured guidance for applications built with Flarelink's Cloudflare stack. Its reference material covers Cloudflare authentication using better-auth and KV sessions, D1 databases, R2 object storage, deployment shapes, and the `@flarelink/client` SDK. The guidance emphasizes user-scoped data access, identifier-safe SQL, KV-backed sessions, and presigned R2 operations.

The server is useful when an agent needs more than generic Cloudflare documentation. It can explain the recommended architecture, show how a complete application is organized, and return implementation recipes for common tasks. The available recipes include authentication setup, route guards, D1 access, R2 uploads and presigned URLs, Wrangler bindings, and SDK usage.

## How it works

Run the server through `npx` and add it to an MCP-compatible coding tool. The agent can call informational tools for the stack overview, scaffolding instructions, pattern catalog, individual patterns, SDK signatures, and cost guidance. A `flarelink://stack-guide` resource also exposes the stack guide as attachable context.

The Flarelink MCP server separates documentation tools from management tools. Documentation and scaffolding work without credentials. Management calls use the Flarelink dashboard API and can verify the current identity and connection, list projects, inspect project D1 databases, execute parameterized SQL, and list R2 buckets.

## Setup and configuration

Install is not required as a separate package. Configure the MCP server with the `npx -y @flarelink/mcp` command. Claude Code can add it with `claude mcp add flarelink -- npx -y @flarelink/mcp`; other clients use their MCP JSON configuration.

Set `FLARELINK_API_KEY` when the agent needs management access to actual Flarelink projects. The key is optional for stack knowledge, scaffolding, patterns, SDK references, and cost guidance. Without it, management tools return a message explaining that the variable must be set. The key has the same access as the Flarelink login and should be handled like a password.

## Tools and capabilities

The Flarelink MCP server exposes these capabilities:

- Explain the stack, deployment shapes, and core implementation rules.
- Describe how to bootstrap a complete application and map its files.
- List canonical patterns and return copy-ready code for a selected recipe.
- Provide `@flarelink/client` signatures and return shapes for auth, storage, and database operations.
- Offer Cloudflare cost guidance based on the feature being built.
- Verify the configured key and show the active user, connection, and project.
- List projects, D1 databases, and R2 buckets for the active Cloudflare connection.
- Run parameterized SQL against a project's D1 database.

## Limitations and notes

The management tools require `FLARELINK_API_KEY`; the key is not needed for the educational and scaffolding features. Management requests operate through the Flarelink dashboard API and use the permissions associated with the key. Database queries are described as parameterized SQL operations, so callers should still select statements and targets carefully.

The server communicates through MCP and does not itself replace the deployment, authentication, database, or storage services in the Flarelink stack.

_Full upstream README: https://allmcps.com/mcp/flarelink/readme_

