Gel Database MCP Server

by christian561

Integrations

  • Provides support for executing TypeScript Gel queries made with query builder syntax to interact with Gel databases.

ゲルデータベースMCPサーバー

TypeScriptベースのモデルコンテキストプロトコル(MCP)サーバーは、EdgeQLクエリによるGelデータベース操作を効率化するために設計されています。このプロジェクトは、LLMエージェント(Cursor Agent、Claude Codeなど)向けのツールを提供し、スキーマの学習、データベースクエリの作成、検証、実行を自動化します。自然言語でGelデータベースを簡単に操作できます。Vibeコーダーの皆様、お待たせしました!

注: LLMはより柔軟なクエリを記述できるため、クエリ生成は含まれていません。Claude-3.7-sonnet-thinkingを使用したカーソルエージェントでこれをテストし、関連ウェブページへのリンクを含むGelドキュメントを提供した後、良好な結果が得られました。

クイックスタートガイド

# 1. Install dependencies yarn install # 2. Copy your dbschema folder into the project if you have one already # cp -r /path/to/your/dbschema ./ # or just copy and paste # 3. Initialize a Gel project npx gel project init # Follow prompts to set up a new project # Can point to an existing gel instance by providing the name of your instance # -Import migrations if it asks # 4. Generate EdgeQL JavaScript query builder files npx @gel/generate edgeql-js # Note: Re-run this command after any schema changes # 5. Update connection settings # Edit src/index_gel.ts lines 19-25 with your database, host, port, user, password # Edit src/index_gel.ts line 37 with your branch name # 6. Build the project yarn build # 7. (optional) Test the server runs without errors node build/index.js # 7.1 (if you have errors) Test server with a UI that provides more clear error logs using: npx @modelcontextprotocol/inspector node build/index.js # 8. (Recommended) Include the gel_llm.txt documentation file # Download the Gel documentation file and place it in your project root # This allows both the search tool and direct file access for your LLM agent # curl -o gel_llm.txt https://raw.githubusercontent.com/yourorg/gel-docs/main/gel_llm.txt # Note: Replace the URL with the actual source of your gel_llm.txt file

カーソルでMCPサーバーに接続

  1. 右上の歯車アイコンをクリック > MCP > +新しいサーバーを追加
  2. 好きな名前を付けてください
  3. タイプを選択: コマンド
  4. これを入力します: node your/full/path/to/build/index.js

**注:**このサーバーは主にCursorのエージェントでテストされていますが、モデルコンテキストプロトコルをサポートする他のエージェントやLLMでも動作するはずです。他のエージェントでテストした場合は、ぜひ結果をお寄せください。

利用可能なツール

Gel データベース MCP サーバーは次のツールを提供します。

スキーマの記述

これにより、LLMエージェントは手動でコードを検査することなく、データベース構造を学習・理解できるようになります。エージェントは利用可能なエンティティタイプ、そのプロパティ、リレーションシップ、制約を検出し、より正確なクエリを生成できます。

**使用する場合:**エージェントがクエリを実行する前にデータベース エンティティの構造を理解する必要があるとき。

検証クエリ

これにより、LLM エージェントは生の EdgeQL クエリ構文を実行せずに検証できるため、生成されたクエリをデータベースに対して実行する前に安全に検証できます。

**使用する場合:**クエリの開発中に、実行による副作用のリスクなしに構文をチェックします。

実行エッジQL

これにより、LLMエージェントはEdgeQLクエリの実行、データの取得、そしてユーザーの指示に基づいた操作の実行を通じて、データベースと直接やり取りできるようになります。LLMはEdgeQLクエリを生成し、自律的に実行することができます。

例:

SELECT Product { name, price } FILTER .price > 100;

ゲルドキュメントを検索

このツールにより、LLMエージェントはGelドキュメントを検索し、EdgeQLの構文、機能、例などに関する関連情報を見つけることができます。また、Gelデータベースの概念をより深く理解できるよう、コンテキストを含む包括的な結果を返します。

**使用する場合:**エージェントが特定の Gel/EdgeQL 機能について学習したり、構文を理解したり、データベース操作を実装するための例を見つけたりする必要がある場合。

例:

search_term: "for loop" context_lines: 10 # Optional: Number of context lines to show (default: 5) match_all_terms: true # Optional: Require all terms to match (default: false)

**ドキュメントのハイブリッド アプローチに関する注意:**最適な結果を得るには、次の両方をお勧めします。

  1. gel_llm.txtファイルをプロジェクトルートに含める(直接ファイルにアクセスするために)
  2. 対象を絞ったクエリにsearch-gel-docsツールを使用する

このハイブリッド アプローチにより、LLM エージェントは特定の用語を柔軟に検索できると同時に、より広範なコンテキストが必要な場合には完全なドキュメントにアクセスできるようになります。

TypeScript を実行する

execute-edgeql に似ていますが、クエリ ビルダー構文で作成された Typescript Gel クエリのテストと実行に使用できます。

ツールには指示が含まれていますが、エージェントにどのような指示があるのかを尋ねて、状況に応じて読み込んでもらうことをお勧めします。こうすることで、指示が飛ばされることがなくなります。

注意: 一般的な JavaScript 構文エラーによってサーバーがクラッシュする可能性があるため、接続が閉じられているように見える場合は、カーソル MCP 設定でクラッシュしたサーバーを更新するか、サーバーを再起動する必要があります。

LLM に次のベストプラクティスを伝えます。

  • 結果を表示するには、console.log でawait gelClient.query()を使用します。
  • ORDER BY はカンマではなく THEN と一緒に使用します (例: ORDER BY .field1 THEN .field2)
  • コードをシンプルに保ち、単一の操作に集中する

例:

console.log(await gelClient.query(` SELECT Product { name, price } FILTER .price > 100 ORDER BY .price DESC LIMIT 5; `));

**使用する場合:**プログラムによるロジックを必要とする複雑なクエリの場合、または JavaScript を使用してクエリ結果を処理する必要がある場合。

もっと詳しく知る

モデル コンテキスト プロトコルの詳細については、 modelcontextprotocol.io/quickstartをご覧ください。

-
security - not tested
F
license - not found
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

LLM エージェントが自然言語を通じて Gel データベースと対話できるようにし、データベース スキーマを学習し、EdgeQL クエリを検証および実行するためのツールを提供する、TypeScript ベースの MCP サーバーです。

  1. Quick Start Guide
    1. Connect MCP Server in Cursor
      1. Available Tools
      2. Learn More

    Related MCP Servers

    • -
      security
      F
      license
      -
      quality
      A TypeScript-based server that provides a memory system for Large Language Models (LLMs), allowing users to interact with multiple LLM providers while maintaining conversation history and offering tools for managing providers and model configurations.
      Last updated -
      20
      JavaScript
      • Apple
    • -
      security
      F
      license
      -
      quality
      A TypeScript-based MCP server that enables users to manage text notes and generate summaries, showcasing key MCP concepts like resource representation and LLM integration.
      Last updated -
      1,667
      JavaScript
      • Apple
    • -
      security
      A
      license
      -
      quality
      An MCP server that provides tools to load and fetch documentation from any llms.txt source, giving users full control over context retrieval for LLMs in IDE agents and applications.
      Last updated -
      177
      Python
      MIT License
      • Apple
    • -
      security
      F
      license
      -
      quality
      A TypeScript MCP server that allows querying documents using LLMs with context from locally stored repositories and text files through a RAG (Retrieval-Augmented Generation) system.
      Last updated -
      1
      JavaScript
      • Apple
      • Linux

    View all related MCP servers

    ID: xxwoav0t36