HH

husamabusafa/hasura_mcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

24 stars 12 forks Качество 55 Тренд 0

Сервер Model Context Protocol (MCP) предоставляет расширенный интерфейс для взаимодействия агентов ИИ (например, в Cursor или Claude Desktop) с конечной точкой Hasura GraphQL.

Обзор

Сервер Model Context Protocol (MCP) предоставляет расширенный интерфейс для взаимодействия агентов ИИ (например, в Cursor или Claude Desktop) с конечной точкой Hasura GraphQL. Он позволяет агентам обнаруживать структуру API, выполнять как запросы только для чтения, так и мутации (с осторожностью), просматривать данные, выполнять агрегации и проверять работоспособность службы. Этот сервер расширяет возможности LLM, позволяя им динамически использовать API Hasura на основе запросов на естественном языке. Этот сервер предоставляет следующие возможности MCP: ** Предоставляет полное определение схемы GraphQL, полученное с помощью стандартной интроспекции. Агенты могут прочитать этот ресурс, чтобы понять полную структуру API, включая типы, поля, аргументы, директивы и т. Д. ** Выполняет запрос GraphQL только для чтения против конечной точки Hasura. Используйте это для получения данных, когда конкретный инструмент недоступен. Убедитесь, что запрос не изменяет данные.

Обзор (машинный перевод)

Версия: 1.1.0

Сервер Model Context Protocol (MCP) предоставляет расширенный интерфейс для взаимодействия агентов ИИ (например, в Cursor или Claude Desktop) с конечной точкой Hasura GraphQL. Он позволяет агентам обнаруживать структуру API, выполнять как запросы только для чтения, так и мутации (с осторожностью), просматривать данные, выполнять агрегации и проверять работоспособность службы.

Этот сервер расширяет возможности LLM, позволяя им динамически использовать API Hasura на основе запросов на естественном языке.

Особенности

Этот сервер предоставляет следующие возможности MCP:

Ресурсы:

** Hasura GraphQL Schema hasura:/schema** Предоставляет полное определение схемы GraphQL, полученное с помощью стандартной интроспекции. ** Тип: ** application/json Агенты могут прочитать этот ресурс, чтобы понять полную структуру API, включая типы, поля, аргументы, директивы и т. Д.

Инструменты:

[[Т2]] *** Описание:** Выполняет только для чтения запрос GraphQL против конечной точки Hasura. Используйте это для получения данных, когда конкретный инструмент недоступен. Убедитесь, что запрос не изменяет данные. Пример: query { users { id name } }

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

Advanced Hasura GraphQL MCP Server

Version: 1.1.0

This Model Context Protocol (MCP) server provides an advanced interface for AI agents (like those in Cursor or Claude Desktop) to interact with a Hasura GraphQL endpoint. It enables agents to discover the API structure, execute both read-only queries and mutations (with caution), preview data, perform aggregations, and check service health.

This server enhances LLM capabilities by allowing them to leverage your Hasura API dynamically based on natural language requests.

Features

This server exposes the following MCP capabilities:

Resources:

  • Hasura GraphQL Schema (hasura:/schema)
    • Provides the full GraphQL schema definition obtained via standard introspection.
    • MIME Type: application/json
    • Agents can read this resource to understand the complete structure of the API, including types, fields, arguments, directives, etc.

Tools:

  • run_graphql_query

    • Description: Executes a read-only GraphQL query against the Hasura endpoint. Use this for fetching data when a specific tool isn’t available. Ensure the query does not modify data. Example: query { users { id name } }
    • Input: { query: string, variables?: object }
    • Note: Performs a basic check to prevent execution of strings starting with mutation. Primarily relies on the query itself being read-only.
  • run_graphql_mutation

    • Description: Executes a GraphQL mutation to insert, update, or delete data. Use with caution, ensure the operation is intended and safe. Relies on Hasura permissions configured for the provided Admin Secret or default role. Example: mutation { insert_users_one(object: {name: "Test"}) { id } }
    • Input: { mutation: string, variables?: object }
    • Security: Allows any mutation permitted by the Hasura role. Ensure appropriate Hasura permissions are configured.
  • list_tables

    • Description: Lists available data tables (or collections) managed by Hasura, organized by schema with descriptions, based on introspection heuristics (looks for object types with an ‘id’ field, excluding internal/aggregate types). Useful for discovering available data sources.
    • Input: { schemaName?: string } (Optional schema name, attempts to infer from field descriptions if possible, defaults to ‘public’ conceptually)
  • describe_table

    • Description: Shows the structure of a specific table including all its columns (fields) with their GraphQL types and descriptions.
    • Input: { tableName: string, schemaName?: string }
  • list_root_fields

    • Description: Lists the available top-level query, mutation, or subscription fields from the GraphQL schema. Useful for understanding the primary entry points for operations.
    • Input: { fieldType?: 'QUERY' | 'MUTATION' | 'SUBSCRIPTION' } (Optional filter)
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { // ... other servers ... "hasura-advanced": { // Key used internally by Claude "command": "/path/to/your/node", // <<< Absolute path from 'which node' "args": [ "/absolute/path/to/mcp-hasura-advanced/dist/index.js", // <<< Absolute path to compiled script "https://YOUR_HASURA_ENDPOINT.com/v1/graphql", // <<< Your endpoint "YOUR_ADMIN_SECRET" // <<< Your secret (REMOVE if no secret) ], // Optional: // "cwd": "/absolute/path/to/mcp-hasura-advanced" } } }