A Model Context Protocol (MCP) server for interacting with Gen3 data commons, with GraphQL query validation to reduce hallucinations.
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 | shCreate a file credentials.json containing your Gen3 API key:
{
"api_key": "xxxx",
"key_id": "xxxx"
}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"
}
}
}
}The MCP server provides the following tools:
get_schema_summary()- Get annotated overview of all entities and their relationshipsget_schema_entity(entity)- Get detailed schema info about a specific entity including all fields
generate_query_template(entity_name, include_relationships=True, max_fields=20)- Generate safe query templates with validated fieldsvalidate_query(query)- Validate GraphQL query syntax and field names against schema
execute_graphql(query)- Execute validated GraphQL queries against the Gen3 data commons
Built with MCP (Model Context Protocol) and designed for Gen3 Data Commons.