InstantDB

by christophersutton

Not rated
GitHub

About

Provides a robust InstantDB server for executing database queries, retrieving results, and serving code examples across admin, CLI, and data modeling contexts.

Details

Author
christophersutton
Repository
christophersutton/instantdb-mcp
Categories
Database, Other, AI, Design, Developer Tools, Search, Infrastructure

- Dynamic detection of the InstantDB permissions file from common file locations.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name InstantDB
    Command (node, npx, python, etc.) node
    Arguments
    • Argument 1 /path/to/instantdb-server/build/index.js
    Environment
    • INSTANT_APP_ID your_app_id
    • INSTANT_APP_ADMIN_TOKEN your_admin_token

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

To use the server with Claude Desktop, add the following configuration to your Claude Desktop settings:

On macOS:
<code>~/Library/Application Support/Claude/claude_desktop_config.json</code>
On Windows:
<code>%APPDATA%/Claude/claude_desktop_config.json</code>

Example configuration:

{
"mcpServers": {
"instantdb-server": {
"command": "node",
"args": ["/path/to/instantdb-server/build/index.js"],
"env": {
"INSTANT_APP_ID": "your_app_id",
"INSTANT_APP_ADMIN_TOKEN": "your_admin_token"
},
"disabled": false,
"autoApprove": []
}
}
}

- Dynamic loading of the InstantDB schema from common file locations relative to a provided project directory (e.g., <code>instant.schema.ts</code>, <code>src/instant.schema.ts</code>, <code>app/instant.schema.ts</code>).
- Environment variable configuration is loaded from the project’s <code>.env</code> file. Essential variables include:
- <code>INSTANT_APP_ID</code>
- <code>INSTANT_APP_ADMIN_TOKEN</code>

get_examples

Returns pre-defined example queries for various categories (e.g., 'basic_read', 'filtering', 'associations').

queryDB

Executes a specific query against InstantDB. Requires a 'query' and a descriptive 'name' parameter.

list_queries

Retrieves the history of executed queries with details such as query ID, name, timestamp, and structure.

return_query

Retrieves a specific query by its unique ID for later reference or implementation.

- <code>get_examples</code>
Returns pre-defined example queries for various categories (e.g., "basic_read", "filtering", "associations").

- <code>queryDB</code>
Executes a specific query against InstantDB. Requires a <code>query</code> and a descriptive <code>name</code> parameter.

- <code>list_queries</code>
Retrieves the history of executed queries with details such as query ID, name, timestamp, and structure.

- <code>return_query</code>
Retrieves a specific query by its unique ID for later reference or implementation.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "instantdb": {
            "env": {
                "INSTANT_APP_ID": "your_app_id",
                "INSTANT_APP_ADMIN_TOKEN": "your_admin_token"
            },
            "args": [
                "/path/to/instantdb-server/build/index.js"
            ],
            "command": "node"
        }
    }
}

Linux

{
    "env": {
        "INSTANT_APP_ID": "your_app_id",
        "INSTANT_APP_ADMIN_TOKEN": "your_admin_token"
    },
    "args": [
        "/path/to/instantdb-server/build/index.js"
    ],
    "command": "node"
}

Macos

{
    "env": {
        "INSTANT_APP_ID": "your_app_id",
        "INSTANT_APP_ADMIN_TOKEN": "your_admin_token"
    },
    "args": [
        "/path/to/instantdb-server/build/index.js"
    ],
    "command": "node"
}

Windows

{
    "env": {
        "INSTANT_APP_ID": "your_app_id",
        "INSTANT_APP_ADMIN_TOKEN": "your_admin_token"
    },
    "args": [
        "/path/to/instantdb-server/build/index.js"
    ],
    "command": "node"
}

instantdb-server MCP Server

An MCP server for interacting with InstantDB.

This server provides a read-only interface for querying InstantDB using a dynamically loaded schema and environment configuration. It includes tools to execute queries and retrieve query examples based on pre-defined patterns.

Features

Tools

- <code>get_examples</code> Returns pre-defined example queries for various categories (e.g., "basic_read", "filtering", "associations").

- <code>queryDB</code>
Executes a specific query against InstantDB. Requires a <code>query</code> and a descriptive <code>name</code> parameter.

- <code>list_queries</code>
Retrieves the history of executed queries with details such as query ID, name, timestamp, and structure.

- <code>return_query</code>
Retrieves a specific query by its unique ID for later reference or implementation.

Schema and Environment Integration

- Dynamic loading of the InstantDB schema from common file locations relative to a provided project directory (e.g., <code>instant.schema.ts</code>, <code>src/instant.schema.ts</code>, <code>app/instant.schema.ts</code>). - Environment variable configuration is loaded from the project’s <code>.env</code> file. Essential variables include: - <code>INSTANT_APP_ID</code> - <code>INSTANT_APP_ADMIN_TOKEN</code>

Pending Features

- Dynamic detection of the InstantDB permissions file from common file locations.

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Installation

To use the server with Claude Desktop, add the following configuration to your Claude Desktop settings:

On macOS:
<code>~/Library/Application Support/Claude/claude_desktop_config.json</code>
On Windows:
<code>%APPDATA%/Claude/claude_desktop_config.json</code>

Example configuration:

{
"mcpServers": {
"instantdb-server": {
"command": "node",
"args": ["/path/to/instantdb-server/build/index.js"],
"env": {
"INSTANT_APP_ID": "your_app_id",
"INSTANT_APP_ADMIN_TOKEN": "your_admin_token"
},
"disabled": false,
"autoApprove": []
}
}
}

Debugging

For debugging MCP server communications, use the MCP Inspector:

npm run inspector

The Inspector will provide a URL to access tools for monitoring MCP server operations.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.