Cover image
Try Now
2025-03-22

MCP服务器实现用于Grist API集成

3 years

Works with Finder

1

Github Watches

1

Github Forks

0

Github Stars

Grist MCP Server

An MCP server implementation that provides tools for interacting with the Grist API, enabling integration between Grist spreadsheets and language models.

Features

  • Access Grist data directly from language models
  • List organizations, workspaces, documents, tables, and columns
  • Query, add, update, and delete records in Grist tables
  • Filter and sort data with rich query capabilities
  • Secure API key-based authentication

Tools

list_organizations

List all Grist organizations that the user has access to.

Returns: A list of organizations with their IDs, names, and domains.

list_workspaces

List all workspaces in a Grist organization.

Inputs:

  • org_id (int or string): The ID of the organization to list workspaces for

Returns: A list of workspaces with their IDs and names.

list_documents

List all documents in a Grist workspace.

Inputs:

  • workspace_id (int): The ID of the workspace to list documents for

Returns: A list of documents with their IDs and names.

list_tables

List all tables in a Grist document.

Inputs:

  • doc_id (string): The ID of the document to list tables for

Returns: A list of tables with their IDs.

list_columns

List all columns in a Grist table.

Inputs:

  • doc_id (string): The ID of the document containing the table
  • table_id (string): The ID of the table to list columns for

Returns: A list of columns with their IDs and field data.

list_records

List records in a Grist table with optional filtering, sorting, and limiting.

Inputs:

  • doc_id (string): The ID of the document containing the table
  • table_id (string): The ID of the table to list records from
  • filter_json (string, optional): JSON string for filtering records (e.g., '{"column_name": ["value1", "value2"]}')
  • sort (string, optional): Comma-separated list of columns to sort by (prefix with '-' for descending order)
  • limit (int, optional): Maximum number of records to return

Returns: A list of records with their IDs and field data.

add_grist_records

Add records to a Grist table.

Inputs:

  • doc_id (string): The ID of the document containing the table
  • table_id (string): The ID of the table to add records to
  • records (array): List of records to add as dictionaries of field values

Returns: A list of IDs for the newly created records.

update_grist_records

Update records in a Grist table.

Inputs:

  • doc_id (string): The ID of the document containing the table
  • table_id (string): The ID of the table to update records in
  • records (array): List of records to update (each must include "id" and field values)

Returns: A list of IDs for the updated records.

delete_grist_records

Delete records from a Grist table.

Inputs:

  • doc_id (string): The ID of the document containing the table
  • table_id (string): The ID of the table to delete records from
  • record_ids (array): List of record IDs to delete

Returns: A dictionary containing the operation status and a message.

Usage

The Grist MCP Server is designed for:

  • Analyzing and summarizing Grist data
  • Creating, updating, and deleting records programmatically
  • Building reports and visualizations based on Grist data
  • Answering questions about data stored in Grist tables
  • Connecting Grist with language models for natural language queries

Requirements

  • Python 3.8+
  • A valid Grist API key
  • The following Python packages: fastmcp, httpx, pydantic, python-dotenv

Setup

Environment Variables

Create a .env file with the following:

GRIST_API_KEY=your_api_key_here
GRIST_API_HOST=https://docs.getgrist.com/api

Replace your_api_key_here with your actual Grist API key, which you can find in your Grist account settings.

Configuration

Usage with Claude Desktop

Add this to your claude_desktop_config.json:

Direct Python

{
  "mcpServers": {
    "grist-mcp": {
      "command": "python",
      "args": [
        "-m", "grist_mcp_server"
      ]
    }
  }
}

Docker

{
  "mcpServers": {
    "grist-mcp": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e", "GRIST_API_KEY=your_api_key_here",
        "-e", "GRIST_API_HOST=https://docs.getgrist.com/api",
        "mcp/grist-mcp-server"
      ]
    }
  }
}

Building

Docker:

docker build -t mcp/grist-mcp-server .

Installation

pip install mcp-server-grist

Or manually:

git clone https://github.com/yourusername/mcp-server-grist.git
cd mcp-server-grist
pip install -r requirements.txt

License

This MCP server is licensed under the MIT License.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

    Reviews

    4 (1)
    Avatar
    user_lswTfsTB
    2025-04-16

    I have been using mcp-server-grist by nic01asFr and it has been an essential tool for my projects. The seamless integration and robust server capabilities make it a standout choice. The documentation is clear and the setup process is straightforward, making it accessible even for those new to server management. Highly recommend it!