Skip to content

Skills & MCP Server Registry

MemoryLayer ships two workspace-scoped registries alongside its memory store:

  • Skills (/v1/skills) — agentskills.io-style skill packs (a folder containing SKILL.md plus scripts/, references/, and assets/ files) that an LLM agent can list, fetch, and execute against.
  • MCP Servers (/v1/mcp-servers) — declarative entries describing local or remote MCP servers an agent should connect to (the same shape as .mcp.json / Claude Code’s ~/.claude.json).

Both registries share a common design: they are stored server-side, exposed through MCP tools (skills_* and mcp_servers_*) so an LLM can discover and use them, surfaced via a CLI (memorylayer skills, memorylayer mcp), and resolved through a 4-tier scope precedence so the same name can mean different things in different contexts.


Why a Server-Side Registry?

Putting skills and MCP servers behind the MemoryLayer API gives you:

  • Persistence — the agent’s set of available skills and MCP servers travels with the workspace, not the local filesystem.
  • Scoping — the same skill name (code-review) can resolve to a user-private version, a project-shared version, a personal cross-project version, or a global plugin-provided version depending on who is asking and from where.
  • Two-way sync with disk — memorylayer skills sync / memorylayer mcp sync mirror server records to a local directory or .mcp.json file. source_mode records which side is canonical: server (MemoryLayer is canonical and disk is a checkout), filesystem (disk is canonical and the server is a mirror), or mirrored (bidirectional, with conflict detection by hash).
  • Discoverability — every skill and MCP server entry is mirrored as a memory (subtype skill or mcp_server), so POST /v1/skills/resolve and POST /v1/mcp-servers/resolve can find entries by intent (query) as well as by exact name.
  • Shadowing — precedence is deterministic; higher-priority tiers shadow lower-priority ones unless you opt into include_shadowed.

The 4-Tier Scope Model

Both registries use a 4-tier precedence model, but with slightly different semantics that match how the two concepts are actually used.

Skills: user > workspace > tenant > global

TierWhen it winsWhere it lives
userA skill is bound to user_id and the requesting user matches(workspace_id=<current>, user_id=<caller>)
workspaceA skill is bound to the current workspace, no user pin(workspace_id=<current>, user_id=null)
tenantA skill lives in another workspace under the same tenant (visible only when RBAC explicitly exposes it)(workspace_id=<other>, user_id=null)
globalA skill ships from a plugin or platform-wide source(workspace_id="_global", user_id=null)

In core MemoryLayer, the tenant tier is effectively unused: every caller sees their own workspace plus _global. Since 0.2.0, _global skills appear in workspace listings. A deployment can subclass the resolution service (visible_scopes_for) to add cross-workspace visibility through RBAC without changing the precedence logic.

MCP Servers: local > project > user > global

TierWhen it winsWhere it lives
LOCALUser-private, current workspace(workspace_id=<current>, user_id=<caller>)
PROJECTShared across the workspace (the equivalent of a committed .mcp.json)(workspace_id=<current>, user_id=null)
USERUser-private, cross-workspace (the equivalent of a personal ~/.claude.json)(workspace_id="_global_user", user_id=<caller>)
GLOBALTenant / plugin-wide entry shared with everyone(workspace_id="_global", user_id=null)

The MCP-server tier names mirror the way Claude Code, Cursor, and similar tools think about MCP config (project file vs. user config), so memorylayer mcp migrate-from-local can ingest an existing .mcp.json into the LOCAL or PROJECT tier without surprises.

Tie-Breaking: source_mode

Within a tier, two records with the same name are tie-broken by source_mode, then by updated_at (most recent wins):

source_modeOrigin
server (highest)MemoryLayer is canonical; the filesystem is a checkout (the default for API and CLI writes)
mirroredBidirectional sync; conflicts detected by hash comparison
filesystem (lowest)The local directory is canonical; the server copy is a mirror

This means a deliberately curated server-side record always beats a filesystem-mirrored copy of the same name. An operator can override a wayward local file by POSTing a replacement.


Skill Bundles and Addenda

  • Inline bundle files. POST /v1/skills accepts a files array ({path, content_b64, mime_type}), so a skill and its bundle are created in one call. Files can also be managed one at a time with PUT / DELETE /v1/skills/{id}/files/{path}. GET /v1/skills/{id}/bundle streams the whole bundle as NDJSON or tar.gz.
  • Addenda. Corrections learned from real use can ride alongside a skill without editing its manifest. Store a memory with subtype: "skill_addendum" and metadata {"skill_id": "<id>", "status": "accepted"}. When the skill is read, accepted addenda (up to 25, oldest first) are appended to its body under a ## Learned Addenda heading.
  • Revisions. Skills are versioned resources. GET /v1/skills/{id}/revisions lists revisions, and POST /v1/skills/{id}/delete / restore perform soft delete and restore.

Walkthrough: Resolving a Skill Named code-review

Suppose the workspace ws-platform has three skills called code-review:

Recordworkspace_iduser_idsource_modeupdated_at
A_globalnullmirroredyesterday
Bws-platformnullmirroredlast week
Cws-platformaliceserverthis morning

When Alice calls skills_get("code-review") from ws-platform:

  1. The resolver lists scopes in precedence order: (ws-platform, alice), (ws-platform), (_global).
  2. Candidate set: C (matches scope 0), B (scope 1), A (scope 2).
  3. Tier rank picks the lowest — C wins (user tier).
  4. If C did not exist, B would win (workspace). If B did not exist either, A would win (global).
  5. If multiple records lived in the same winning tier, source_mode would break the tie (server > mirrored > filesystem), then updated_at desc.

When Bob (different user) makes the same call from ws-platform, he never sees C (it’s pinned to Alice). He gets B.

The same logic applies to MCP servers with the LOCAL > PROJECT > USER > GLOBAL ordering.


CLI: memorylayer skills

The CLI talks to a running server (--server-url, default http://localhost:61001; --api-key for authenticated servers):

Terminal window
# List skills visible to the caller (with shadowing applied)
memorylayer skills list --workspace ws-platform
# Show shadowed variants too
memorylayer skills list --workspace ws-platform --show-shadowed
# Upload a local skill directory
memorylayer skills push ./skills/code-review --workspace ws-platform --scope workspace
# Pull one back to disk
memorylayer skills pull code-review --workspace ws-platform --out ./local
# Materialize every visible skill into a directory (default: ~/.claude/skills)
memorylayer skills materialize --workspace ws-platform --target ./local/skills
# Compare one skill directory with the server and push or pull as needed
memorylayer skills sync ./local/skills/code-review --workspace ws-platform --auto-push --auto-pull
# Watch a directory and auto-push on change
memorylayer skills watch ./local/skills --workspace ws-platform
# Bulk-import skills from ~/.claude/skills (or --dir) into the workspace
memorylayer skills migrate-from-local --dir ~/.claude/skills --scope user --workspace ws-platform

The --scope flag on push controls which tier a skill lands in:

  • user — user tier (bound to the caller’s user_id)
  • workspace — workspace tier (shared, no user pin; the default)
  • global — global tier (writes into _global; typically restricted)

push also takes --mode server|mirrored|filesystem to set source_mode. migrate-from-local accepts --scope user|workspace|tenant, --mode server|mirrored, and --yes to skip the confirmation prompt.


CLI: memorylayer mcp

The MCP-server CLI mirrors the same pattern:

Terminal window
# List MCP server entries (winners only; --all includes disabled, --format json)
memorylayer mcp list --workspace ws-platform
# Push a .mcp.json (one or many server entries inside)
memorylayer mcp push ./.mcp.json --workspace ws-platform
# Pull the workspace's entries back out
memorylayer mcp pull --workspace ws-platform --output ./.mcp.json
# Include secret env/header values in the pull
memorylayer mcp pull --workspace ws-platform --reveal-secrets --output ./.mcp.json
# Two-way sync
memorylayer mcp sync ./.mcp.json --workspace ws-platform
# Materialize resolved entries to a .mcp.json, and optionally into ~/.claude.json
memorylayer mcp materialize --workspace ws-platform --target ./.mcp.json --write-to-claude-json
# Watch and auto-push
memorylayer mcp watch ./.mcp.json --workspace ws-platform
# Import MCP servers from Claude Code's ~/.claude.json (user scope, or a project's local scope)
memorylayer mcp migrate-from-local --workspace ws-platform --scope user
memorylayer mcp migrate-from-local --workspace ws-platform --scope local --project-path ~/code/my-app

mcp materialize --write-to-claude-json also writes the resolved (precedence-winning) entries into Claude Code’s ~/.claude.json at user scope, which keeps agent tooling in sync with the server.


MCP Tools an LLM Sees

When an LLM is connected to MemoryLayer through the MCP server, the same registries are reachable as tools (default cc profile):

ToolPurpose
skills_listList skills visible in the current workspace
skills_getGet a single skill’s metadata (precedence-resolved)
skills_get_fileFetch one file from a skill bundle
skills_searchSemantic search across skill names + descriptions

The full profile adds:

ToolPurpose
skills_saveCreate or update a skill record from the LLM side
mcp_servers_listList MCP server registry entries
mcp_servers_getGet a single entry
mcp_servers_saveCreate or update an entry
mcp_servers_deleteRemove an entry
mcp_servers_importImport a JSON blob (Claude Code or .mcp.json shape)

See MCP Server for the full tool reference.


Authentication & Authorization

With core MemoryLayer’s default authentication, every caller is a single open user, so both registries are effectively flat by workspace_id. When the server runs with real identity, for example through Aether or in MemoryLayer Enterprise:

  • Each request carries an authenticated user_id and tenant_id. That is what makes the user-pinned tiers (skills user, MCP LOCAL and USER) meaningful.
  • visible_scopes_for(ctx) can be overridden to filter cross-workspace tenant visibility through RBAC.
  • MCP server env and headers values pass through a pluggable at-rest encryption hook. With no encrypter registered (the default), they are stored as-is, so protect the database accordingly.

The precedence and resolution logic is the same in both editions. Identity and visibility are what change.


  • CLI Reference — complete memorylayer skills and memorylayer mcp subcommand reference
  • MCP Server — MCP tool catalog for skills + MCP-server registry
  • Workspaces — workspace isolation model
  • The OpenClaw integration can sync MemoryLayer skills into OpenClaw’s skills directory (MEMORYLAYER_SKILLS_SYNC=1)