Provides optional cloud storage backend using Cloudflare R2 for storing and managing dynamic review records with user-defined schemas, enabling production deployment with R2 as an alternative to local filesystem storage.
Record MCP Server
A Model Context Protocol (MCP) server for storing and managing dynamic review records with user-defined schemas. Perfect for organizing reviews of coffee, whisky, wine, or any other category you can think of!
Features
Dynamic Schemas: Create review types with custom fields on-the-fly
Flexible Storage: Local filesystem (dev) or Cloudflare R2 (production)
Type-Safe: Built with TypeScript and runtime validation
Extensible: Add new fields to existing review types
Easy Migration: Switch from local to cloud storage with one environment variable
Quick Start
Installation
Configuration
Copy the example environment file:
For local development (default):
For production with Cloudflare R2:
Running the Server
Development mode (with auto-reload):
Production mode:
Running Tests
MCP Tools
The server provides the following MCP tools:
1. list_review_types
List all review types with their schemas and record counts.
Parameters: None
Example Response:
2. get_review_type
Get detailed information about a specific review type including all records.
Parameters:
typeName(string): Name of the review type
Example:
3. add_review_type
Create a new review type with a custom schema.
Parameters:
name(string): Name of the review type (e.g., "coffee", "whisky")fields(array): Array of field definitions
Supported Field Types:
string: Text valuesnumber: Numeric valuesboolean: True/false valuesdate: ISO 8601 date strings
Example:
4. add_field_to_type
Add a new field to an existing review type's schema.
Parameters:
typeName(string): Name of the review typefieldName(string): Name of the new fieldfieldType(string): Type of the field (string, number, boolean, date)
Example:
5. add_review_record
Add a new review record to a type.
Parameters:
typeName(string): Name of the review typedata(object): Review data matching the type's schema
Example:
Usage Examples
Complete Workflow
Architecture
Project Structure
Storage Abstraction
The server uses a storage abstraction layer that allows easy switching between local files and Cloudflare R2:
Local Storage (Development): Uses Node.js
fs/promisesto store JSON filesR2 Storage (Production): Uses AWS S3-compatible API to store in Cloudflare R2
Both providers implement the same StorageProvider interface, making migration seamless.
Data Format
Each review type is stored as a separate JSON file:
Migration from Local to R2
When you're ready to move to production:
Set up your Cloudflare R2 bucket
Update your
.envfile with R2 credentialsChange
STORAGE_PROVIDER=r2Restart the server
Optional: Use a migration script to copy existing data:
Validation
The server provides comprehensive validation:
Type Names: Alphanumeric, hyphens, and underscores only
Field Types: Must be one of: string, number, boolean, date
Required Fields: All schema fields must be present in records
Extra Fields: Records cannot have fields not in the schema
Type Checking: Field values must match their declared types
Error Handling
All tools return structured error messages:
Common errors:
Duplicate type names
Duplicate field names
Missing required fields in records
Type mismatches
Invalid type/field names
Development
Building
Watching for Changes
Testing
Run all tests:
Run specific test file:
License
MIT
Contributing
Contributions welcome! Please ensure tests pass before submitting PRs.
Support
For issues or questions, please open a GitHub issue.