Skip to main content
Glama

grist-mcp

MCP server for Grist — enables LLMs to create and manage Grist applications through natural language.

19 tools covering document creation, schema management, data operations, and full UI control (pages, widgets, layouts, linking).

Quick Start

npm install
npm run build

Claude Code / Claude Desktop

Add to your MCP settings (~/.claude/settings.json for Claude Code, or Claude Desktop config):

{
  "mcpServers": {
    "grist": {
      "command": "node",
      "args": ["/path/to/grist-mcp/dist/index.js"],
      "env": {
        "GRIST_API_URL": "http://localhost:8484",
        "GRIST_API_KEY": "your-api-key"
      }
    }
  }
}

Streamable HTTP

GRIST_API_URL=http://localhost:8484 GRIST_API_KEY=your-key node dist/index.js --http 3000

Server listens at http://localhost:3000/mcp with a health check at /health.

Related MCP server: mcp-google-sheets

Configuration

Variable

Required

Description

GRIST_API_URL

Yes

Base URL of the Grist instance (e.g. http://localhost:8484)

GRIST_API_KEY

Yes

API key for authentication

GRIST_DOC_ID

No

Default document ID — avoids passing doc_id to every tool call

Tools

Document Tools

Tool

Description

list_documents

List workspaces and documents

create_document

Create a new empty document

describe_document

Full schema as Python class definitions

Schema Tools

Tool

Description

create_tables

Create tables with typed columns

add_columns

Add columns to an existing table

modify_columns

Change column types, add formulas, rename

delete_columns

Remove a column

Data Tools

Tool

Description

get_records

Read records with filter, sort, limit

add_records

Insert records

update_records

Update records by ID

delete_records

Delete records by ID

UI Tools

Tool

Description

create_page

Create a page with multiple widgets, layout, and linking

add_widget_to_page

Add a widget to an existing page

link_widgets

Master-detail linking between widgets

configure_page_layout

Rearrange widgets (stacked, side_by_side, left_panel, grid_2x2)

rename_page

Rename a page

create_summary_table

Grouped/pivot view of a table

Power Tools

Tool

Description

run_sql

Read-only SQL queries against the document

apply_user_actions

Raw UserAction escape hatch

Resources

URI

Description

grist://docs/{docId}/schema

Document schema as Python classes

grist://column-types

Column type reference documentation

Prompts

Prompt

Description

create_application

Guided workflow for building a Grist app from a use-case description

write_formula

Guided workflow for writing a Grist Python formula

Column Types

Text, Numeric, Int, Bool, Date, DateTime, Choice, ChoiceList, Ref:<Table>, RefList:<Table>, Attachments, Any

Testing

Integration tests (requires a running Grist instance)

# Start Grist in Docker
docker run -d --name grist-test -p 8484:8484 \
  -e GRIST_DEFAULT_EMAIL=test@example.com \
  -e GRIST_FORWARD_AUTH_HEADER=X-Forwarded-User \
  -e GRIST_FORWARD_AUTH_LOGOUT_PATH=_unused \
  gristlabs/grist

# Create an API key via the Grist UI, then:
npm run build
GRIST_API_URL=http://localhost:8484 GRIST_API_KEY=your-key node dist/test-integration.js

The integration test creates a document, exercises all 19 tools and both resources, and verifies results (50 assertions).

License

Apache-2.0

Authored by Evan Wies evan@neomantra.net

Available Tools

19 tools
add_columnsC

Add new columns to an existing table.

Inputs: columns (required), table_id (required), doc_id.

add_recordsB

Add new records (rows) to a table. Each record is an object mapping column names to values.

Inputs: records (required), table_id (required), doc_id.

add_widget_to_pageC

Add a widget to an existing page.

Inputs: type (required), table_id (required), page_name (required), title, +6 more.

apply_user_actionsB

Apply raw Grist UserActions for operations not covered by other tools. Actions are arrays like ["AddTable", "Name", [{id: "Col", type: "Text"}]]. Use sparingly — prefer the higher-level tools when possible.

Inputs: actions (required), doc_id.

configure_page_layoutC

Rearrange widgets on a page using a layout preset or custom layout spec.

Inputs: page_name (required), doc_id, layout, custom_layout.

create_documentC

Create a new empty Grist document in a workspace.

Inputs: name (required), workspace_id (required).

create_pageB

Create a new page with one or more widgets (grid, card, chart, form, etc.). Supports configuring layout and master-detail linking between widgets in a single call.

Inputs: name (required), widgets (required), doc_id, layout.

create_summary_tableA

Create a summary (pivot/grouped) view of a table. Groups rows by the specified columns and automatically adds a count column. Additional aggregate formulas can be added after creation.

Inputs: group_by (required), table_id (required), title, doc_id, +3 more.

create_tablesA

Create one or more new tables with typed columns. Grist will automatically create associated views and pages. Column types: Text, Numeric, Int, Bool, Date, DateTime, Choice, ChoiceList, Ref:, RefList:.

Inputs: tables (required), doc_id.

delete_columnsC

Delete a column from a table.

Inputs: col_id (required), table_id (required), doc_id.

delete_recordsC

Delete records from a table by their row IDs.

Inputs: table_id (required), record_ids (required), doc_id.

describe_documentB

Get the full schema of a Grist document — all tables, columns, and their types — formatted as Python class definitions. This is the best way to understand a document's structure.

Inputs: doc_id.

get_recordsB

Read records from a table, with optional filtering, sorting, and limit.

Inputs: table_id (required), sort, limit, doc_id, +1 more.

list_documentsB

List all workspaces and documents accessible to the current user. Use org_id=0 for the user's personal org.

Inputs: org_id.

modify_columnsC

Modify existing columns — change type, add/update formulas, rename, etc.

Inputs: columns (required), table_id (required), doc_id.

rename_pageC

Rename a page in the document.

Inputs: new_name (required), old_name (required), doc_id.

run_sqlA

Execute a read-only SQL query against the document's SQLite database. Useful for analysis, aggregation, and joins across tables.

Inputs: sql (required), args, doc_id.

update_recordsB

Update existing records by ID. Each record must include 'id' and 'fields' to update.

Inputs: records (required), table_id (required), doc_id.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 19 tools

    Disambiguation4/5

    Tools are organized by distinct resources (documents, tables, columns, records, pages/widgets), and descriptions make the boundaries clear. Minor overlap exists between apply_user_actions and the higher-level tools (it is explicitly the escape hatch), and create_summary_table borrows the 'table' name for what is really a grouped view.

    Naming Consistency5/5

    Every tool follows a consistent snake_case verb_noun pattern (create_document, add_columns, get_records, delete_records, rename_page, etc.). No mixed cases or inconsistent verb conventions across the set.

    Tool Count4/5

    19 tools is slightly above the ideal band but justified: it spans five resource types (documents, tables, columns, records, pages) each requiring separate operations. No tool looks redundant or filler.

    Completeness4/5

    Records and columns have full CRUD, and pages/widgets have create, link, layout, and rename operations. Gaps remain for deletes on documents, tables, and pages/widgets, but apply_user_actions provides a documented workaround for these.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      B
      maintenance
      An MCP server for interacting with the Grist API, enabling language models to manage organizations, documents, tables, and records. It supports advanced features like SQL querying, data filtering, and attachment management for comprehensive Grist database interaction.
      54
      97 PyPI
      56
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables reading and writing to Grist documents via natural language through MCP tools, allowing users to manage data, schemas, documents, and more using AI assistants like Perplexity.
      -