Skills & MCP Server Registry
MemoryLayer ships two workspace-scoped registries alongside its memory store:
- Skills (
/v1/skills) — agentskills.io-style skill packs (a folder containingSKILL.mdplusscripts/,references/, andassets/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 syncmirror server records to a local directory or.mcp.jsonfile.source_moderecords which side is canonical:server(MemoryLayer is canonical and disk is a checkout),filesystem(disk is canonical and the server is a mirror), ormirrored(bidirectional, with conflict detection by hash). - Discoverability — every skill and MCP server entry is mirrored as a memory (
subtypeskillormcp_server), soPOST /v1/skills/resolveandPOST /v1/mcp-servers/resolvecan find entries by intent (query) as well as by exactname. - 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
| Tier | When it wins | Where it lives |
|---|---|---|
| user | A skill is bound to user_id and the requesting user matches | (workspace_id=<current>, user_id=<caller>) |
| workspace | A skill is bound to the current workspace, no user pin | (workspace_id=<current>, user_id=null) |
| tenant | A skill lives in another workspace under the same tenant (visible only when RBAC explicitly exposes it) | (workspace_id=<other>, user_id=null) |
| global | A 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
| Tier | When it wins | Where it lives |
|---|---|---|
| LOCAL | User-private, current workspace | (workspace_id=<current>, user_id=<caller>) |
| PROJECT | Shared across the workspace (the equivalent of a committed .mcp.json) | (workspace_id=<current>, user_id=null) |
| USER | User-private, cross-workspace (the equivalent of a personal ~/.claude.json) | (workspace_id="_global_user", user_id=<caller>) |
| GLOBAL | Tenant / 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_mode | Origin |
|---|---|
server (highest) | MemoryLayer is canonical; the filesystem is a checkout (the default for API and CLI writes) |
mirrored | Bidirectional 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/skillsaccepts afilesarray ({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 withPUT/DELETE /v1/skills/{id}/files/{path}.GET /v1/skills/{id}/bundlestreams the whole bundle as NDJSON ortar.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 Addendaheading. - Revisions. Skills are versioned resources.
GET /v1/skills/{id}/revisionslists revisions, andPOST /v1/skills/{id}/delete/restoreperform soft delete and restore.
Walkthrough: Resolving a Skill Named code-review
Suppose the workspace ws-platform has three skills called code-review:
| Record | workspace_id | user_id | source_mode | updated_at |
|---|---|---|---|---|
| A | _global | null | mirrored | yesterday |
| B | ws-platform | null | mirrored | last week |
| C | ws-platform | alice | server | this morning |
When Alice calls skills_get("code-review") from ws-platform:
- The resolver lists scopes in precedence order:
(ws-platform, alice),(ws-platform),(_global). - Candidate set: C (matches scope 0), B (scope 1), A (scope 2).
- Tier rank picks the lowest — C wins (
usertier). - If C did not exist, B would win (
workspace). If B did not exist either, A would win (global). - If multiple records lived in the same winning tier,
source_modewould break the tie (server>mirrored>filesystem), thenupdated_atdesc.
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):
# List skills visible to the caller (with shadowing applied)memorylayer skills list --workspace ws-platform
# Show shadowed variants toomemorylayer skills list --workspace ws-platform --show-shadowed
# Upload a local skill directorymemorylayer skills push ./skills/code-review --workspace ws-platform --scope workspace
# Pull one back to diskmemorylayer 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 neededmemorylayer skills sync ./local/skills/code-review --workspace ws-platform --auto-push --auto-pull
# Watch a directory and auto-push on changememorylayer skills watch ./local/skills --workspace ws-platform
# Bulk-import skills from ~/.claude/skills (or --dir) into the workspacememorylayer skills migrate-from-local --dir ~/.claude/skills --scope user --workspace ws-platformThe --scope flag on push controls which tier a skill lands in:
user— user tier (bound to the caller’suser_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:
# 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 outmemorylayer mcp pull --workspace ws-platform --output ./.mcp.json
# Include secret env/header values in the pullmemorylayer mcp pull --workspace ws-platform --reveal-secrets --output ./.mcp.json
# Two-way syncmemorylayer mcp sync ./.mcp.json --workspace ws-platform
# Materialize resolved entries to a .mcp.json, and optionally into ~/.claude.jsonmemorylayer mcp materialize --workspace ws-platform --target ./.mcp.json --write-to-claude-json
# Watch and auto-pushmemorylayer 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 usermemorylayer mcp migrate-from-local --workspace ws-platform --scope local --project-path ~/code/my-appmcp 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):
| Tool | Purpose |
|---|---|
skills_list | List skills visible in the current workspace |
skills_get | Get a single skill’s metadata (precedence-resolved) |
skills_get_file | Fetch one file from a skill bundle |
skills_search | Semantic search across skill names + descriptions |
The full profile adds:
| Tool | Purpose |
|---|---|
skills_save | Create or update a skill record from the LLM side |
mcp_servers_list | List MCP server registry entries |
mcp_servers_get | Get a single entry |
mcp_servers_save | Create or update an entry |
mcp_servers_delete | Remove an entry |
mcp_servers_import | Import 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_idandtenant_id. That is what makes the user-pinned tiers (skillsuser, MCPLOCALandUSER) meaningful. visible_scopes_for(ctx)can be overridden to filter cross-workspacetenantvisibility through RBAC.- MCP server
envandheadersvalues 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.
Related Pages
- CLI Reference — complete
memorylayer skillsandmemorylayer mcpsubcommand 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)