Muscle Memory MCP Server
Muscle Memory MCP Server lets an agent build and reuse a library of tested scripts across projects.
List areas and saved scripts with
mm_list, including project-over-personal shadowing.Run saved scripts with arguments via
mm_run; scripts run unsandboxed with your inherited environment.Save or replace reusable scripts through
mm_save, executing tests before saving and supporting custom runners/tests and personal/project scope.Set up personal or project libraries with
mm_setup, including local/existing/clone git modes and optional personal-library auto-push.Approve/use project libraries via trust, while project scripts are never auto-committed or pushed.
Also use the same command as a CLI for list/run/save/setup/test/trust workflows.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Muscle Memory MCP Server find a saved script to convert CSV to JSON and run it on data.csv"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.

Muscle Memory MCP Server
Your agent solves problems by writing scripts, then throws them away like they're nothing. Tomorrow it writes the same script again. Like having to figure out how to tie your shoelaces every morning. It lacks muscle memory.
The Muscle Memory MCP server gives your agent an empty library that it fills with its own tested scripts.
Install
Hermes
hermes mcp add muscle-memory --command uvx --args muscle-memory-mcpClaude Code
claude mcp add muscle-memory -s user -- uvx muscle-memory-mcpTo keep the library somewhere other than the default, set MUSCLE_MEMORY_DIR in the server's environment.
Codex
Add to ~/.codex/config.toml:
[mcp_servers.muscle-memory]
command = "uvx"
args = ["muscle-memory-mcp"]
# env = { MUSCLE_MEMORY_DIR = "/absolute/path/to/library" }Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"muscle-memory": {
"command": "uvx",
"args": ["muscle-memory-mcp"]
}
}
}Related MCP server: engram
Add to your AGENTS.md
Add this standing rule to your AGENTS.md, CLAUDE.md, SOUL.md or equivalent agent instructions:
Before writing helper code, check muscle-memory with mm_list and run a match with mm_run.
Before ending your turn, save reusable new helper scripts (not project code) with mm_save; use a background agent if available so the reply isn't delayed.
If you saved something, name it in the reply.Tool descriptions contain the safety and testing specifics for each operation.
First run and storage
The server exposes mm_list, mm_run, mm_save and mm_setup. If the personal library has not been set up, the tools guide the agent to ask you once where it should live and then call mm_setup.
The personal library defaults to ~/.muscle-memory (%USERPROFILE%\.muscle-memory on Windows); MUSCLE_MEMORY_DIR selects another location. Scripts in the personal library are available across projects.
An optional .muscle-memory/ project library holds scripts specific to one codebase. Project-root detection depends on the MCP client's working directory. Set MUSCLE_MEMORY_PROJECT_DIR to the project's absolute path in the server environment to override detection explicitly. When a script name exists in both libraries, the project copy takes precedence; listings mark the personal copy as shadowed.
For personal libraries, saves write files locally if the folder is not in git. If the library is a git repo, each saved script is committed. Setup asks whether to also push scripts to the git remote automatically; run setup again to change your answer. Project libraries are never committed or pushed automatically: you commit them with your own work. On first project setup, the agent asks whether the library should be shared through git or kept private.
Tools
mm_list(area?)— list available areas and script counts, or list scripts in one area.mm_run(script, args)— run a saved script, passing through arguments.mm_save(name, code, test, area, usage, ...)— save or update a script after its test passes. Supports runner, test selection, and personal/project scope options; see the tool description for the full schema and safety behavior.mm_setup(target, ...)— set up a personal library or optional project library. Ask the user before setup; see the tool description for modes and options.
Advanced: languages and tests
The runner is picked by file extension: Python, bash/zsh, Node, Ruby, Perl, PHP, Swift, Go, Lua, R, PowerShell, and .cmd/.bat on Windows. Other languages need an explicit runner argv when saved. Runtimes are never installed for you; a missing one gives an error naming the command.
By default a script's test uses the same extension and runner. test_name and test_runner allow independent test selection. Tests live under tests/test_<stem>.<ext>; selection metadata is stored beside the script. Tests receive MM_SCRIPT (absolute script path) and MM_LIBRARY (library root). Exit status 0 passes; failed tests prevent saving. Replacing a test extension removes the prior test only after the replacement passes.
Advanced: CLI
The same command is also a CLI:
uvx muscle-memory-mcp list [AREA]
uvx muscle-memory-mcp run SCRIPT [ARGS...]
uvx muscle-memory-mcp save NAME --code FILE --test FILE --area AREA --usage TEXT
uvx muscle-memory-mcp setup [--target personal|project] [OPTIONS]
uvx muscle-memory-mcp test [NAME]
uvx muscle-memory-mcp trust --projectWith no arguments it starts the MCP server over stdio. --help lists the options.
Security and limits
Scripts and tests run as you, with your environment and no sandbox. Passing tests is not a security review.
A project library runs only after you approve the project once with
uvx muscle-memory-mcp trust --project.Project-library detection depends on the client's working directory; set
MUSCLE_MEMORY_PROJECT_DIRif needed.
License
MIT — see LICENSE.
Available Tools
4 toolsmm_listA
List tested scripts; call before code at each reusable substep. Omit area to list areas, then select one. Same-name project scripts shadow personal. No matching script: write code. If unavailable, ask once before mm_setup.
Inputs: area.
mm_runB
Run code as you with inherited environment; no sandbox. Report output. [write]: --dry-run then readback. [irreversible]: --dry-run, show output, wait for explicit yes before execution. Repair via mm_save replace: true.
Inputs: script (required), args.
mm_saveA
Save reusable code and EXECUTE its test, unsandboxed; tests are not security reviews. Untrusted project library: nothing written or run; ask the user. Use args, env secrets, --dry-run for actions. Tests default to script runner/extension; test_name/test_runner override. MM_SCRIPT/MM_LIBRARY set; exit 0 passes. Failed new personal test saves nothing; replacement restores prior files. Personal commits, and pushes if chosen at setup; project never commits. Existing names: replace: true.
Inputs: area (required), code (required), name (required), test (required), +7 more.
mm_setupC
After asking which: personal (mode local/existing/clone) or project (shared true uses project git, false keeps private). push: user's answer to 'Push scripts to git remote automatically?'
Inputs: git, mode, path, push, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct role: mm_list discovers scripts, mm_run executes existing code, mm_save stores reusable code and runs its test, and mm_setup configures personal vs project storage. Although mm_run and mm_save both involve execution, the action boundaries are clearly described and unlikely to be confused.
All tool names follow the same predictable mm_verb pattern: mm_list, mm_run, mm_save, and mm_setup. There are no naming style deviations.
Four tools is well-scoped for a focused script-memory server. Each tool maps to a core operation: discover, execute, save, and configure.
The surface covers the main lifecycle of listing, running, saving/replacing, and configuring script storage. A delete/remove operation and possibly a direct get/inspect operation are missing, but most workflows remain workable through list, run, and save with replace.
Related MCP Connectors
Agent memory: free durable storage (any keypair, no signup) that survives sessions and machines.
Build, test and publish agentic workflows from your AI client: approve steps, read tables, see runs.
Shared long-term memory vault for AI agents with 20 MCP tools.
Persistent memory for AI agents: save, search and connect context across tools and sessions.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to programmatically create, manage, and execute independent Python workflow scripts with full CRUD operations, allowing AI to build and modify automation workflows themselves rather than just executing pre-built ones.62MIT
- AlicenseNot gradedqualityDmaintenanceEnables coding agents to store, recall, and manage persistent memory across sessions through MCP tools, with reviewable handoffs and SQLite-backed local storage.1MIT
- AlicenseAqualityCmaintenanceEnables agents to dynamically create, edit, call, and persist Python tools across sessions.3MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to save, retrieve, semantically search, and document code snippets through MCP tools, including multi-agent workflows for generating style guides and wiki documentation.-