Mastra Code
Mastra Code
- mastracode
LibSQL database for threads and memory. No headless mode yet, so no invoke.
- Invoke
- no headless mode
- Models
- no listing
- MCP
- json · mastracode
- Agents file
- none stable
Access
- Get
getHarness("mastracode") - CLI
harnesses paths mastracode --json - Trymastracode in the explorer
Mastra Code stores everything it remembers in one LibSQL database under ~/.local/share/mastracode/ on Linux, threads and messages alongside its observational memory. Hooks are a JSON file rather than a directory, at project and user scope, and MCP servers sit in .mastracode/mcp.json and its global twin.
It reads Claude's files as its own: CLAUDE.md, .claude/CLAUDE.md, ~/.claude/CLAUDE.md and both skills directories, beside AGENTS.md and .mastracode/. No non-interactive mode is recorded, so invoke rejects before spawning and the CLI's run refuses it with the same message. MCP servers come from four local files, lowest first: mcpServers in the project's .claude/settings.local.json, ~/.mastracode/mcp.json, the project's .mcp.json and .mastracode/mcp.json, later names winning, with ~/.claude.json and Codex's config.toml joining on opt-in. The registry maps the three that are MCP files, so listMcpServers reads them and syncMcpServers rewrites the user one. Project writes go to .mastracode/mcp.json, and .mcp.json is listed as Claude's to edit. The settings file is Claude's too and stays out. All of them are the plain { command, args, env } and { url, headers } family, and the type field means nothing to Mastra Code: an entry is stdio when it has command, HTTP when it has url, and SSE gets settled at connect time. That's why the registry gives it its own mastracode dialect. A stale type next to a command doesn't turn the listing into SSE, the writer leaves type out, and an enabled flag on the master list is dropped rather than rewritten on every sync, because Mastra Code has no such switch.
Capabilities and invocation
- mcp: yes
- vision: yes
- audio: no
- video: no
- tools: yes
- streaming: yes
No non-interactive invocation is recorded, so invoke() rejects before spawning anything and every invocation mode reports false.
Paths
Templates as the registry stores them. ~, ${HOME}, ${TMPDIR} and %VAR% expand in resolve(); entries tagged with a platform are dropped on the others. Open in the explorer to see them expanded for a home directory of your choice.
config
.mastracode/mcp.jsonProject-scoped MCP server configurations.
~/.mastracode/mcp.jsonGlobal MCP server configurations.
.mcp.jsonClaude Code compatible project MCP servers, read below .mastracode/mcp.json.
.mastracode/hooks.jsonProject-scoped hooks.
~/.mastracode/hooks.jsonGlobal hooks.
sessions
~/.local/share/mastracode/mastra.dbLibSQL database with threads, messages, and observational memory.
instructions
AGENTS.mdCLAUDE.mdSupported for Claude Code compatibility.
.claude/CLAUDE.mdClaude Code compatible.
.mastracode/AGENTS.mdAlternative project-level location.
~/.claude/CLAUDE.mdClaude Code compatible.
~/.mastracode/AGENTS.mdGlobal user-level instructions.
skills
.mastracode/skills/~/.mastracode/skills/Global user-level skills.
.claude/skills/Claude Code compatible.
~/.claude/skills/Claude Code compatible.
commands
.mastracode/commands/Markdown prompt commands; subdirectories become colon-separated command names.
~/.mastracode/commands/Global Markdown prompt commands.
.claude/commands/Claude compatibility.
~/.claude/commands/Claude compatibility.
.opencode/command/Mastra's OpenCode compatibility loader uses the singular command directory.
~/.opencode/command/Mastra's OpenCode compatibility loader uses the singular command directory.
promptTemplates
.mastracode/commands/Markdown prompt commands; subdirectories become colon-separated command names.
~/.mastracode/commands/Global Markdown prompt commands.
.claude/commands/Claude compatibility.
~/.claude/commands/Claude compatibility.
.opencode/command/Mastra's OpenCode compatibility loader uses the singular command directory.
~/.opencode/command/Mastra's OpenCode compatibility loader uses the singular command directory.
hooks
.mastracode/hooks.json~/.mastracode/hooks.jsonGlobal hooks.
Empty
tempThat is not the same as the feature being missing.
MCP servers
~/.mastracode/mcp.jsonuser · json · mastracode · mcpServers.mastracode/mcp.jsonproject · json · mastracode · mcpServers.mcp.jsonproject · json · mastracode · mcpServers
Detection
envVars
None. Detection is by project markers only.
projectMarkers
- .mastracode
Persistence
- JSON - MCP and hooks config files. (official)
- SQLite - LibSQL database for threads, messages, and observational memory. (official)
No stable user-scope instructions file, so syncAgentsFiles skips this harness.