Gel Database MCP Server logo

Gel Database MCP Server

by MCP-Mirror

A TypeScript-based Model Context Protocol (MCP) server designed to streamline Gel database operations with EdgeQL queries. It provides tools for LLM Agents to automate learning about your schema, and writing, validating, and executing database queries.

View on GitHub

Last updated: N/A

What is Gel Database MCP Server?

The Gel Database MCP Server is a TypeScript-based server that enables LLM agents to interact with Gel databases using EdgeQL queries via the Model Context Protocol. It provides tools for schema discovery, query validation, execution, and documentation search, allowing for natural language interaction with your Gel database.

How to use Gel Database MCP Server?

  1. Install dependencies using yarn install. 2. Copy your dbschema folder. 3. Initialize a Gel project using npx gel project init. 4. Generate EdgeQL JavaScript query builder files using npx @gel/generate edgeql-js. 5. Update connection settings in src/index_gel.ts. 6. Build the project using yarn build. 7. Run the server using node build/index.js or with the inspector npx @modelcontextprotocol/inspector node build/index.js. 8. (Recommended) Include the gel_llm.txt documentation file. Connect the MCP Server in Cursor by adding a new server with type 'Command' and entering node your/full/path/to/build/index.js.

Key features of Gel Database MCP Server

  • Schema Discovery (describe-schema)

  • EdgeQL Query Validation (validate-query)

  • EdgeQL Query Execution (execute-edgeql)

  • Gel Documentation Search (search-gel-docs)

  • Typescript Query Execution (execute-typescript)

Use cases of Gel Database MCP Server

  • Automating database interactions with LLM agents.

  • Generating and validating EdgeQL queries using natural language.

  • Integrating Gel databases with LLM-powered applications.

  • Providing LLM agents with access to database schema and documentation.

FAQ from Gel Database MCP Server

What is the Model Context Protocol (MCP)?

The Model Context Protocol is a standard that enables LLMs to interact with tools and services, allowing them to perform tasks such as database querying and code execution.

How do I provide Gel documentation to the LLM agent?

Include the gel_llm.txt file in your project root and use the search-gel-docs tool for targeted queries. This hybrid approach provides both direct file access and targeted search capabilities.

What LLMs are compatible with this server?

While primarily tested with Cursor's agent using Claude-3.7-sonnet-thinking, it should work with other agents and LLMs that support the Model Context Protocol.

How do I handle JavaScript syntax errors when using execute-typescript?

General JavaScript syntax errors can crash the server. If the connection appears closed, refresh the crashed server in Cursor MCP settings or restart the server.

What are the best practices for using execute-typescript?

Use await gelClient.query() with console.log to display results. Use ORDER BY with THEN, not commas (e.g., ORDER BY .field1 THEN .field2). Keep code simple and focused on a single operation.