Skip to main content
Glama
sandervd
by sandervd
README.md
# linkml-mcp

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

See [SCOPE.md](SCOPE.md) for the project scope and milestone boundaries.

## Setup

```bash
uv sync --dev
```

## Run The MCP Server

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

```bash
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:

```bash
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:

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

Stdio is also available:

```bash
uv run linkml-mcp
```

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

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

## Test Client

Create a workspace:

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

Apply a semantic changeset:

```bash
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:

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

Run tests:

```bash
uv run pytest
```

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.

Maintenance

ActivityMaintained
ResponsivenessNo issues