Skip to main content
Glama
linkml-mcp
by sandervd

linkml-mcp

MCP server for commit-addressed editing of LinkML YAML schemas.

See SCOPE.md for the project scope and milestone boundaries.

Setup

uv sync --dev

Related MCP server: mcp-server-git-history

Run The MCP Server

For local editor/Codex testing, HTTP is currently the recommended transport:

uv run linkml-mcp --transport http --host 127.0.0.1 --port 8765

To accept requests through a hostname or reverse proxy, bind beyond localhost and allow the external Host header:

uv run linkml-mcp \
  --transport http \
  --host 0.0.0.0 \
  --port 8765 \
  --allowed-host essentialcomplexity.eu

If the proxy forwards a different Host header, pass that value with another --allowed-host.

Use this MCP config:

{
  "servers": {
    "linkml-server": {
      "type": "http",
      "url": "http://127.0.0.1:8765/mcp"
    }
  },
  "inputs": []
}

Stdio is also available:

uv run linkml-mcp

The server stores workspaces under .linkml-mcp/workspaces by default. Override this with:

export LINKML_MCP_WORKSPACE_ROOT=/path/to/workspaces
export LINKML_MCP_GENERATOR_OUTPUT_ROOT=/path/to/generated

Test Client

Create a workspace:

uv run linkml-mcp-client init --name test_schema

Apply a semantic changeset:

uv run linkml-mcp-client apply-change \
  --workspace-id ws_... \
  --base-commit abc123 \
  --changes-json examples/add_person.json \
  --message "Add Person"

Read a schema at a commit:

uv run linkml-mcp-client read-schema \
  --workspace-id ws_... \
  --commit-id def456

Run tests:

uv run pytest

Available Tools

9 tools
apply_changesetA

Apply an atomic ordered semantic changeset to a LinkML workspace. Requires base_commit; validates before and after edits; returns a new commit id. Supported operations include create/delete/rename class, slot, enum, prefix, import, file, plus set_field, unset_field, list_append, list_remove, list_replace, map_set, and map_remove.

Inputs: changes (required), base_commit (required), workspace_id (required), message.

describe_generatorA

Describe one supported LinkML generator and the option format accepted by run_generator. Generator options are passed as CLI-style option names without leading dashes.

Inputs: name (required).

get_entityA

Fetch one LinkML entity from a schema file at a specific commit. entity_type must be class, slot, enum, prefix, or import.

Inputs: name (required), commit_id (required), entity_type (required), workspace_id (required), +1 more.

init_workspaceA

Create a new LinkML editing workspace backed by a bare git repository. Returns workspace_id and initial_commit. If files are omitted, creates a minimal schema.yaml.

Inputs: name, files, schema_id, description.

list_filesA

List files present in a LinkML workspace at a specific commit. Use this before targeting imported local schema files.

Inputs: commit_id (required), workspace_id (required).

list_generatorsA

List the LinkML generators supported by this MCP server. Milestone generators are shacl, owl, and doc.

Inputs: no named parameters.

read_schemaA

Read a LinkML YAML schema file from a specific workspace commit. Use path to read schema.yaml or another local imported YAML file.

Inputs: commit_id (required), workspace_id (required), path.

run_generatorA

Run a supported LinkML generator against a schema file at a specific commit. Does not validate automatically and does not commit generated artifacts. Returns inline content for small outputs or a temporary path for large/multi-file outputs.

Inputs: commit_id (required), generator (required), workspace_id (required), path, +1 more.

validate_schemaA

Validate a LinkML YAML schema at a specific workspace commit. This performs schema validation only and does not create a commit.

Inputs: commit_id (required), workspace_id (required), path.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool targets a distinct concern: workspace setup, file listing, schema reading, entity retrieval, validation, semantic editing, and generator metadata/execution. Even related tools like validate_schema and apply_changeset are clearly separated by read-only vs. mutating behavior.

    Naming Consistency5/5

    Tool names consistently follow a verb_noun pattern using lowercase snake_case: list_files, init_workspace, read_schema, get_entity, validate_schema, apply_changeset, list_generators, describe_generator, run_generator. There are no mixed conventions or vague verbs.

    Tool Count5/5

    Nine tools is well-scoped for a LinkML workspace server. The count covers setup, inspection, validation, modification, and generation without redundant or bloated surface area.

    Completeness4/5

    The tool set covers the core workflow well: creating a workspace, reading files, fetching entities, validating, applying semantic changes, and running generators. Minor gaps exist, such as no direct list-entities operation or workspace metadata lookups, but these can be worked around with read_schema and get_entity.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides MCP tools that give AI agents persistent, append-only memory in a git repository, letting them record observations, decisions, and corrections while retrieving context briefs, current facts, conflicts, and traceable event history without a vector database.
      4 npm
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Exposes a version-controlled knowledge base as MCP tools so agents can read merged identity/state summaries and next recommended actions at runtime, plus run deterministic schema validation and cross-reference link checks. This lets agents fetch live state and verify integrity via self-describing calls instead of re-reading raw files.
      -