FI
OfficialDatabase

Fireproof Database Integration Example for MCP Server

Integrate a Fireproof database with an MCP server using this simple example to plug secure data and code into AI systems like Claude Desktop.

Quick Install
npx -y @fireproof-storage/mcp-database-server

Overview

This repository provides a minimal Model Context Protocol (MCP) server that plugs a Fireproof-backed JSON document store into AI systems that support MCP (for example, Claude Desktop). It exposes basic document database operations (create, read, update, delete) plus a simple query/sort capability so your AI assistant can fetch and manipulate structured data during a conversation.

The server is intended as an educational example and starting point for integrating secure, persistent application data into an AI toolchain. Because it uses Fireproof for storage, you get an immutable, verifiable backing store for documents while the MCP layer presents a small set of tools the AI can call via the MCP transport (stdio for desktop clients).

Features

  • CRUD operations for JSON documents (create / read / update / delete)
  • Query documents with sorting by any field
  • Fireproof-backed persistence for integrity and durability
  • Simple MCP-compatible server process (communicates over stdio)
  • Example configuration for use with Claude Desktop
  • Debugging support via an MCP Inspector script

Installation / Configuration

Install dependencies and build the project:

npm install
npm run build

Run the server directly (it communicates over standard input/output):

node build/index.js

To register this MCP server with Claude Desktop, add a server entry to the Claude Desktop configuration file.

macOS:

  • ~/Library/Application Support/Claude/claude_desktop_config.json

Windows:

  • %APPDATA%/Claude/claude_desktop_config.json

Example config snippet:

{
  "mcpServers": {
    "fireproof": {
      "command": "/path/to/fireproof-mcp/build/index.js"
    }
  }
}

Adjust the “command” path to point to the built index.js file in your clone.

Available Tools

The MCP server exposes a handful of tools (MCP “methods”) that the AI can invoke. Each tool accepts and returns JSON.

Tool namePurposeKey parameters
createDocumentCreate a new JSON documentcollection, document (object)
readDocumentRetrieve a document by idcollection, id
updateDocumentModify fields of an existing documentcollection, id, changes (partial object)
deleteDocumentRemove a document by idcollection, id
queryDocumentsFind documents with optional sortcollection, filter, sortBy, sortOrder, limit

Example create request:

{
  "method": "createDocument",
  "params": {
    "collection": "notes",
    "document": { "title": "Meeting", "body": "Sync at 10am", "createdAt": 1680000000 }
  }
}

Example response:

{
  "result": { "id": "doc_abc123", "document": { "title": "Meeting", "body": "Sync at 10am", "createdAt": 1680000000 } }
}

Query example (sort by field):

{
  "method": "queryDocuments",
  "params": {
    "collection": "notes",
    "filter": {},
    "sortBy": "createdAt",
    "sortOrder": "desc",
    "limit": 10
  }
}

Available Resources

  • Repository: https://github.com/fireproof-storage/mcp-database-server
  • Fireproof: https://fireproof.storage/
  • Model Context Protocol (MCP) project and inspector:
    • MCP repo: https://github.com/modelcontextprotocol
    • Inspector tool (useful for debugging MCP stdio interactions)

This project includes an npm script to launch an MCP Inspector that wraps the server and exposes a browser-based debug UI:

npm run inspector

The inspector prints a URL you can open to trace messages and inspect tool calls between the client and server.

Use Cases

  • Augment a conversational AI with a private note store: let the assistant create, fetch, and update notes on behalf of the user.
  • Provide reference data to the assistant: store product records, knowledge snippets, or user preferences in Fireproof and let the assistant query and present results during dialogue.
  • Enable task automation: the AI can look up items, change statuses, and persist workflow events reliably in an immutable-backed store.
  • Prototyping integrations: use this simple server as a template to add authentication, richer query languages, or custom domain tools that surface application logic to an MCP-enabled assistant.

Notes for Developers

  • This example focuses on clarity rather than production readiness. If you plan to use it in production, add authentication, input validation, rate limiting, and proper error handling.
  • Because MCP servers typically communicate over stdio, debugging can be more difficult than HTTP servers; use the included Inspector or run the server inside a supervised wrapper during development.
  • Fireproof provides content-addressed, tamper-evident storage semantics — design your client interactions accordingly (e.g., explicit ids or versioning on updates).

Use this repository as a practical starting point to connect secure document storage with MCP-aware AI tools.