Skip to main content
Glama

Gen3 MCP Server

A Model Context Protocol (MCP) server for interacting with Gen3 data commons, with GraphQL query validation to reduce hallucinations.

Install and Configure

These instructions are for using the server in a chat client. For development, see Development.

# Clone the repository
git clone <repository-url>

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

Create Gen3 credentials file

Create a file credentials.json containing your Gen3 API key:

{
  "api_key": "xxxx",
  "key_id": "xxxx"
}

Configure chat client

Example for Claude Desktop ~/.config/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "gen3-mcp-server": {
      "command": "uvx",
      "args": [
        "--from", "/path/to/gen3-mcp",
        "gen3-mcp"
      ],
      "env": {
        "GEN3_CREDENTIALS_FILE": "/path/to/credentials.json",
        "GEN3_BASE_URL": "https://gen3.datacommons.io/",
        "GEN3_LOG_LEVEL": "INFO"
      }
    }
  }
}

Related MCP server: GraphQL MCP Toolkit

Example Usage in chat client

Screenshot of Claude chat

Available Tools

The MCP server provides the following tools:

Schema Discovery Tools

  • get_schema_summary() - Get annotated overview of all entities and their relationships

  • get_schema_entity(entity) - Get detailed schema info about a specific entity including all fields

Query Building Tools

  • generate_query_template(entity_name, include_relationships=True, max_fields=20) - Generate safe query templates with validated fields

  • validate_query(query) - Validate GraphQL query syntax and field names against schema

Query Execution Tool

  • execute_graphql(query) - Execute validated GraphQL queries against the Gen3 data commons

Acknowledgments

Built with MCP (Model Context Protocol) and designed for Gen3 Data Commons.

Available Tools

5 tools
execute_graphqlA

Execute your GraphQL query and retrieve data from the Gen3 data commons.

Runs your validated GraphQL query against the Gen3 data commons and returns the actual data. This is where you get real research data back. Make sure your query is validated first to avoid errors.

Args: query: A valid GraphQL query string (validated with validate_query)

Returns: The data results from your query. On success, data contains the requested information. On error, includes specific error details and suggestions for fixing the query.

Workflow: get_schema_summary → get_schema_entity → generate_query_template → validate_query → You are here

IMPORTANT

Always run validate_query on the query before calling this.

Inputs: query (required).

generate_query_templateA

Generate a ready-to-use GraphQL query template for any data type.

Takes an entity name (from get_schema_summary) and creates a complete, valid GraphQL query with the most useful fields and relationships. This gives you a working starting point that you can customize.

Args: entity_name: Name of the data type to query (e.g., 'subject', 'sample') include_relationships: Whether to include related data types in template max_fields: Maximum number of fields to include (controls template size)

Returns: A complete GraphQL query template ready to use or customize. Copy the template from data.template and modify as needed.

Workflow: get_schema_summary → get_schema_entity → You are here → validate_query → execute_graphql

Inputs: entity_name (required), include_relationships, max_fields.

get_schema_entityA

Get detailed information for a specific entity including all fields.

Retrieves complete entity definition with all scalar fields, relationships, and metadata. Use this after get_schema_summary() to explore specific entities in detail before building queries.

Args: entity_name: Name of the entity to retrieve (from get_schema_summary)

Returns: Complete entity data including all fields, relationships, and metadata.

Workflow: get_schema_summary → You are here → generate_query_template → validate_query → execute_graphql

Inputs: entity_name (required).

get_schema_summaryA

Discover the data model structure of a Gen3 data commons.

This is your starting point! Get an overview of all available nodes (entities) in the Gen3 data commons, including their relationships and metadata. Field details are omitted for conciseness - use get_schema_entity to explore specific entities in detail.

Returns: Schema overview with entity names, relationships, and metadata.

Workflow: Start here → get_schema_entity → generate_query_template → validate_query → execute_graphql

Inputs: no named parameters.

validate_queryA

Check if your GraphQL query is valid before executing it.

Validates your GraphQL query syntax and verifies that all entities and fields exist in the schema. Catches errors early and provides specific suggestions for fixing issues. Always validate before executing to avoid runtime errors.

Args: query: The GraphQL query string to validate

Returns: Validation results with detailed error messages and fix suggestions if issues are found. A valid query means it's safe to execute.

Workflow: get_schema_summary → get_schema_entity → generate_query_template → You are here → execute_graphql

IMPORTANT

Always run this before calling execute_graphql

Inputs: query (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a distinct, clearly defined role in the query workflow, from schema discovery to execution. There is no overlap; even the two 'get_schema' tools differ in scope (summary vs. entity details).

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in snake_case (e.g., execute_graphql, get_schema_entity). The verbs are descriptive and match the tool's action.

    Tool Count5/5

    With five tools, the server covers the essential steps for querying a Gen3 data commons without being overly minimal or bloated. Each tool serves a necessary function in the documented workflow.

    Completeness4/5

    The tools cover the full query lifecycle from schema exploration to execution. However, there is no direct support for advanced query editing or result management, which slightly limits completeness for power users.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables LLMs to interact with GraphQL APIs by providing schema introspection and query execution capabilities.
      3
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A governed, audited Model Context Protocol server that provides AI agents with secure, read-only access to a clinical knowledge base through least-privilege tools, policy validation, and append-only audit logging.
      MIT