elixir-training-mcp

v0.0.3
elixir-training-mcp Checked 1 day ago Published 1 year ago

A Model Context Protocol (MCP) server to access data about training materials.

Knowledge graphs (KGs) can greatly increase the potential of data by revealing hidden relationships and turning it into useful information. A KG is a graph-based representation of data that stores relations between subjects, predicates and objects in triplestores. These entities are typically described in pre-defined ontologies, which increase interoperability and connect data that would otherwise remain isolated in siloed databases. This structured data representation can greatly facilitate complex querying and applications to deep learning approaches like generative AI.

Summary extracted from the README.

Project 18: Mining the potential of knowledge graphs for metadata on training

PyPI - Version PyPI - Python Version Generate paper PDF

Abstract

Knowledge graphs (KGs) can greatly increase the potential of data by revealing hidden relationships and turning it into useful information. A KG is a graph-based representation of data that stores relations between subjects, predicates and objects in triplestores. These entities are typically described in pre-defined ontologies, which increase interoperability and connect data that would otherwise remain isolated in siloed databases. This structured data representation can greatly facilitate complex querying and applications to deep learning approaches like generative AI.

ELIXIR and its Nodes are making a major effort to make the wealth of open training materials on the computational life sciences reusable, amongst others by guidelines and support for annotating training materials with standardized metadata. One major step in standardizing metadata is the use of the Bioschemas training profile, which became a standard for representing training metadata. Despite being standardized and interoperable, there is still a lot of potential to turn these resources into valuable information, linking training data across various databases.

In this project, we aim to create queryable KGs derived from training metadata in the Bioschemas format available from platforms like TeSS and glittr.org. In a subsequent step, we will investigate the potential of such KGs for several use cases, including construction of custom learning paths, creation of detailed trainer profiles, and connection of training metadata to other databases. These use-cases will also shed light on the limits on the currently available metadata, and will help to make future choices on richer metadata and standards.

Leads

Geert van Geest, Harshita Gupta, Vincent Emonet

🚜 Harvesting training data

Harvest

[!IMPORTANT]

Data is automatically harvested by a workflow every first day of the month, and can be downloaded from GitHub workflows latest run artifacts: https://github.com/elixir-europe-training/ELIXIR-TrP-KG-training-metadata/actions/workflows/harvest.yml

You can unzip the artifact and replace the .ttl files in the folder src/elixir_training_mcp/data/ with the new files from the artifact.

Otherwise you can run harvesting manually (takes ~30min)

Harvest TeSS:

uv run src/elixir_training_mcp/harvest/harvest_tess.py

Harvest GTN:

uv run src/elixir_training_mcp/harvest/harvest_gtn.py

[!NOTE]

TeSS contains training materials and courses from various providers, such as GTN (Galaxy Training Network) training materials. Metadata about material in TeSS and GTN can be matched on schema:url

Deploy a SPARQL endpoint on http://localhost:8000:

uv run rdflib-endpoint serve src/elixir_training_mcp/data/*_harvest.ttl

Or deploy a QLever SPARQL endpoint on http://localhost:7001, loading each data/*.ttl file in its own named graph. Create a .env file with an access token used for SPARQL updates (to insert the VoID description generated from the graph):

echo "QLEVER_ACCESS_TOKEN=$(openssl rand -hex 24)" > .env
docker compose up -d

Once the endpoint is up, the generate-metadata job runs docs/generate-void.ru to store VoID statistics (class and property partitions) in the https://w3id.org/elixir-trainer/graph/void named graph, then loads docs/sparql-examples.ttl in the https://w3id.org/elixir-trainer/graph/sparql-examples named graph. To regenerate them without rebuilding the index:

docker compose run --rm --no-deps generate-metadata

💬 MCP server

A Model Context Protocol (MCP) server to access and search through the training materials of multiple Elixir repositories, such as TeSS and Glittr.

⚡️ Usage

[!IMPORTANT]

Requirement: uv, to easily handle python scripts and virtual environments

Use with STDIO transport:

uv run elixir-training-mcp

Use with Deploy as Streamable HTTP server:

uv run elixir-training-mcp --http

🧰 Available MCP tools

Once the server is running you can call the following tools from your MCP-compatible client:

Tool Description
search_training_materials Proxies the live TeSS API and returns raw JSON results.
keyword_search Searches the harvested TTL datasets (TeSS + GTN) by free-text keyword and returns enriched metadata.
provider_search Filters harvested resources by provider name (case-insensitive).
location_search Returns TeSS course instances in a given country (optionally city).
date_search Finds TeSS course instances starting within a provided ISO date range.
topic_search Matches harvested resources by EDAM identifier or topic label.
dataset_stats Summarises dataset diagnostics (resource counts, type distribution, access modes).

[!NOTE] The local tools read from data/tess_harvest.ttl and data/gtn_harvest.ttl. Regenerate these files with the harvest scripts if you need fresher data.

🔌 Connect client to MCP server

Follow the instructions of your favorite chat client.

To add a new MCP server to VSCode GitHub Copilot:

  • Install the GitHub.copilot extension
  • Open the Command Palette (ctrl+shift+p or cmd+shift+p)
  • Search for MCP: Add Server...
    • Choose STDIO, and provide the command: uvx elixir-training-mcp
    • Or choose HTTP, and provide the MCP server URL, e.g. http://localhost:8000/mcp

To use it with STDIO transport, your VSCode mcp.json should look like:

{
   "servers": {
      "elixir-training-mcp": {
         "type": "stdio",
         "command": "uvx",
         "args": ["elixir-training-mcp"]
      }
   }
}

[!TIP]

You can use a local folder for development:

{
   "servers": {
      "elixir-training-mcp": {
         "type": "stdio",
         "cwd": "~/dev/ELIXIR-TrP-KG-training-metadata",
         "command": "uv",
         "args": ["run", "elixir-training-mcp"]
      }
   }
}

You can also connect to a running server using Streamable HTTP:

{
    "servers": {
        "elixir-training-mcp-http": {
            "url": "http://localhost:8000/mcp",
            "type": "http"
        }
    }
}