InstantDB MCP server

Provides a robust InstantDB server for executing database queries, retrieving results, and serving code examples across admin, CLI, and data modeling contexts.
Back to servers
Provider
Christopher Sutton
Release date
Mar 08, 2025
Language
TypeScript
Stats
1 star

An MCP server for interacting with InstantDB, providing a read-only interface for querying a database using a dynamically loaded schema and environment configuration. This server makes it easy to execute queries and retrieve query examples based on pre-defined patterns.

Installation

To use the InstantDB MCP server with Claude Desktop, follow these steps:

Prerequisites

Make sure you have:

  • Node.js installed
  • An InstantDB account with app credentials

Setup Configuration

Add the MCP server to your Claude Desktop settings by modifying the configuration file:

On macOS:

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

On Windows:

%APPDATA%/Claude/claude_desktop_config.json

Add the following configuration to your settings file:

{
  "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": []
    }
  }
}

Replace the placeholders with your actual values:

  • /path/to/instantdb-server/build/index.js: The actual path to the built server
  • your_app_id: Your InstantDB application ID
  • your_admin_token: Your InstantDB admin token

Usage

Once configured, you can interact with the InstantDB MCP server through Claude Desktop using the following tools:

Getting Example Queries

Retrieve pre-defined example queries by category:

get_examples("basic_read")

Available categories include:

  • basic_read
  • filtering
  • associations

Executing Queries

Execute a query against your InstantDB database:

queryDB({
  query: "YOUR_QUERY_HERE",
  name: "Descriptive query name"
})

Viewing Query History

List previously executed queries:

list_queries()

This returns details such as query ID, name, timestamp, and structure.

Retrieving Specific Queries

Get a specific query by its ID:

return_query("query_id_here")

Debugging

If you encounter issues with the MCP server, you can use the MCP Inspector to debug:

npm run inspector

This will provide a URL to access tools for monitoring MCP server operations and communications.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later