{"_id":"@any-ai/memany","name":"@any-ai/memany","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@any-ai/memany","version":"0.1.0","description":"memany, a standalone stdio MCP server for personal and shared team memory, usable from any coding agent","type":"module","license":"MIT","bin":{"memany":"dist/cli.js","memany-http":"dist/http-cli.js","memany-auth":"dist/auth-cli.js","memany-credentials":"dist/credentials-cli.js"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./cli":{"types":"./dist/cli.d.ts","default":"./dist/cli.js"},"./http-cli":{"types":"./dist/http-cli.d.ts","default":"./dist/http-cli.js"},"./auth-cli":{"types":"./dist/auth-cli.d.ts","default":"./dist/auth-cli.js"}},"scripts":{"clean":"shx rm -rf dist","build":"tsc -p tsconfig.build.json && shx chmod +x dist/cli.js dist/http-cli.js dist/auth-cli.js dist/credentials-cli.js","dev":"tsc -p tsconfig.build.json --watch --preserveWatchOutput","test":"vitest --run","typecheck":"tsc -p tsconfig.build.json --noEmit"},"dependencies":{"@modelcontextprotocol/sdk":"^1.30.0","jose":"^6.1.3","zod":"^4.4.3"},"devDependencies":{"@types/node":"^24.3.0","shx":"^0.4.0","typescript":"^5.7.3","vitest":"^4.1.9"},"keywords":["memany","mcp","memory","coding-agent","claude-code","codex","cursor"],"engines":{"node":">=22.8.0"},"author":{"name":"Kerem Nalbant"},"repository":{"type":"git","url":"git+https://github.com/any-cli/any.git","directory":"packages/memany"},"_id":"@any-ai/memany@0.1.0","gitHead":"b57a95cf6e4145184794e62aa05965acda801b21","bugs":{"url":"https://github.com/any-cli/any/issues"},"homepage":"https://github.com/any-cli/any#readme","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-vKhz7WxVr+PFWZVgVWd19bgKMWwQL2oSm0AC8dZqjThj7a/vwErm5HbJ2vbniJrlK1qstJvtSN+AiPuT1VnuJQ==","shasum":"b2c02a01a9c4cf08b8c3f7ae76160acaa1bd4e00","tarball":"https://registry.npmjs.org/@any-ai/memany/-/memany-0.1.0.tgz","fileCount":102,"unpackedSize":281387,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIG9KW7DjiubnEcpbumRBMPrRj3hJ05N6ewTXWfNaCEpDAiEAmw0yTt6EqFfGWda2dl4VfydCkvbwlQrrwb6F9Rq05mg="}]},"_npmUser":{"name":"keremnalbant","email":"kerem.nalbant@hotmail.com"},"directories":{},"maintainers":[{"name":"keremnalbant","email":"kerem.nalbant@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/memany_0.1.0_1786132246569_0.41463573569316803"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-07T19:50:46.115Z","0.1.0":"2026-08-07T19:50:46.707Z","modified":"2026-08-07T19:50:47.095Z"},"maintainers":[{"name":"keremnalbant","email":"kerem.nalbant@hotmail.com"}],"description":"memany, a standalone stdio MCP server for personal and shared team memory, usable from any coding agent","homepage":"https://github.com/any-cli/any#readme","keywords":["memany","mcp","memory","coding-agent","claude-code","codex","cursor"],"repository":{"type":"git","url":"git+https://github.com/any-cli/any.git","directory":"packages/memany"},"author":{"name":"Kerem Nalbant"},"bugs":{"url":"https://github.com/any-cli/any/issues"},"license":"MIT","readme":"# memany\n\nA stdio MCP server that gives any coding agent a memory that survives the session, the tool and the machine.\n\nPublished as `@any-ai/memany`.\n\nTwo kinds of memory, each of which can apply to one repository or to all of them:\n\n| kind | who can read it | typical content |\n| --- | --- | --- |\n| `personal` | only you, ever. Not teammates, not org admins | your habits, your shell, your opinions, half-formed ideas |\n| `shared` | everyone in your org | build commands, architecture decisions, conventions, traps |\n\nPersonal memories live in physically separate storage on the server (a distinct Postgres schema with no\njoin path to organizations), so a bug in a team query cannot return them. A personal memory can be\npromoted to shared. Nothing can go the other way.\n\nWorks with Claude Code, Codex, Cursor, Gemini CLI, and anything else that speaks stdio MCP.\n\n---\n\n## Step 1, required: install the server\n\nNode 22 or newer.\n\n```bash\nnpm install -g @any-ai/memany\n```\n\nThat puts `memany` and `memany-auth` on your PATH. To run it from a clone instead:\n\n```bash\ngit clone <this repo> && cd any\nnpm install\nnpm --prefix packages/memany run build\nnpm install -g ./packages/memany\n```\n\nThen sign in once. This stores a token in the macOS keychain, or in a `0600` file elsewhere, and\nrecords the service url:\n\n```bash\nmemany-auth login\nmemany-auth whoami\n```\n\nAfter that no config file needs to hold a secret.\n\n### Claude Code\n\n```bash\nclaude mcp add memany -s user -- memany\n```\n\n`-s user` makes it available in every project. Use `-s project` to commit it to the repo instead.\nCheck it with `claude mcp list`.\n\n### Codex\n\nAdd this to `~/.codex/config.toml`, or to `.codex/config.toml` for one project:\n\n```toml\n[mcp_servers.memany]\ncommand = \"memany\"\nargs = []\n```\n\nOr from the CLI:\n\n```bash\ncodex mcp add memany -- memany\n```\n\nCheck it with `codex mcp list`, or type `/mcp` in the Codex TUI.\n\n### Any other stdio client\n\nCursor reads `~/.cursor/mcp.json` (or `.cursor/mcp.json` per project). Gemini CLI reads the\n`mcpServers` object in its `settings.json`. Both take the same block:\n\n```json\n{\n  \"mcpServers\": {\n    \"memany\": {\n      \"command\": \"memany\",\n      \"args\": []\n    }\n  }\n}\n```\n\nIf you would rather not sign in, pass credentials by environment instead. This works in every client\nabove, but it puts a token in a config file:\n\n```json\n{\n  \"mcpServers\": {\n    \"memany\": {\n      \"command\": \"memany\",\n      \"args\": [],\n      \"env\": {\n        \"ANY_API_URL\": \"https://memory.example.com\",\n        \"ANY_API_TOKEN\": \"any_...\"\n      }\n    }\n  }\n}\n```\n\n---\n\n## Step 2, required: tell your agent to use it\n\nInstalling the server is not enough. An MCP server can advertise itself through the protocol's\n`instructions` field, and we measured that this is not sufficient: Codex ignored it entirely. What\ndoes work is an explicit instruction in the agent's own instructions file.\n\nPaste the block below into whichever file your agent already reads:\n\n| agent | for every project | for one project |\n| --- | --- | --- |\n| Claude Code | `~/.claude/CLAUDE.md` | `./CLAUDE.md` or `./.claude/CLAUDE.md` |\n| Codex | `~/.codex/AGENTS.md` | `./AGENTS.md` |\n| Gemini CLI | `~/.gemini/GEMINI.md` | `./GEMINI.md` |\n| Cursor | a rule file under `~/.cursor/rules/` | a rule file under `.cursor/rules/` |\n\nCodex reads every `AGENTS.md` from the project root down to your working directory, so a nested one\nworks too.\n\n```markdown\n## Memory\n\nYou have a persistent memory through the `memany` MCP server. It outlives this session.\n\n- At the start of a session, call `session_context` once. Do it before you read files, plan, or\n  answer. It is cheap and it is capped.\n- Call `recall` before you assume how this project is built, tested, deployed or reviewed, and\n  before you ask me something a previous session may already have been told.\n- Call `remember` the moment I state something durable: a preference, a convention, a gotcha, a\n  decision, a command that works. Do not wait to be asked. One fact per call, one sentence.\n- Choose `kind` by asking who the fact is true for. `personal` when it is true of me and not of the\n  code: my habits, my machine, my opinions, anything I said with \"I\" or \"my\". `shared` when a\n  colleague hitting the same wall would need it. When unsure, use `personal`; it can be promoted\n  later, and a shared memory can never be made private again.\n- Only call `promote` when I ask you to share something with the team.\n- Do not store secrets, tokens, or anything that is stale next week.\n```\n\nTrim it if you like, but keep the first three bullets. They are the difference between the tools\nbeing used and being ignored.\n\n---\n\n## The tools\n\n| tool | what it does |\n| --- | --- |\n| `remember` | Store one fact. Takes `note`, `kind` (`personal` or `shared`), and an optional `project`. |\n| `recall` | Read everything that applies here, in four labelled groups. Optional `query` to search. |\n| `session_context` | A short, budgeted memory block for the top of a session. Cheaper than `recall`. |\n| `promote` | Move one of your personal memories into shared team memory. One way, author preserved. |\n| `forget` | Delete a memory by the id `recall` printed. |\n\n`recall` returns the four groups clearly labelled, so the model can tell private from team:\n\n```\nYour personal memory, applies everywhere (only you can see this):\n- I want plain language with no emoji in every reply (2026-08-07, id=46b35e45-...)\n\nYour personal memory for github.com/acme/widgets (only you can see this):\n- I debug widgets with console.log and delete them before committing (2026-08-07, id=e8b3be0c-...)\n\nShared team memory, applies everywhere:\n- The team reviews every PR within one working day (Alice Author, 2026-08-07, id=57e5d5ed-...)\n\nShared team memory for github.com/acme/widgets:\n- Widgets deploys from the release branch only (Alice Author, 2026-08-07, id=f5e915e8-...)\n```\n\n### Which project a memory belongs to\n\nThe `project` argument on `remember` is optional and you rarely need it:\n\n- omitted: the repository you are in right now, detected from `git remote get-url origin`\n- `\"everywhere\"`: no repository, so the fact follows you into every repo\n- `\"acme/widgets\"` or a full git remote url: that specific repository\n\nRemote urls are normalised, so `git@github.com:Acme/Widgets.git`, `https://github.com/acme/widgets`\nand `acme/widgets` are all the same project.\n\n---\n\n## Configuration\n\nEverything comes from the environment or from `~/.any`. Nothing is read from a config file the agent\ncontrols.\n\n| variable | meaning |\n| --- | --- |\n| `ANY_API_URL` | Memory service base url. Falls back to the url saved by `memany-auth login`. |\n| `ANY_API_TOKEN` | Bearer token. Falls back to the keychain, then a `0600` credentials file. |\n| `ANY_STATE_DIR` | Where credentials live. Default `~/.any`. |\n| `ANY_REPO_REMOTE` | Override repository detection instead of shelling out to git. |\n| `ANY_SESSION_CONTEXT_BUDGET` | Character budget for `session_context`. Clamped to 200..20000. |\n\nCredentials resolve in this order: environment, then `~/.any/credentials.json`, then the macOS\nkeychain (`any-cli` / `api-token`), then the legacy `api-url` and `api-token` files.\n\nThe server never writes memories to disk. With no service configured, every tool fails with a clear\nmessage rather than quietly saving somewhere only you can see. Losing the connection should look like\na failure, not like success.\n\n`stderr` stays completely silent on the happy path, because several TUI clients treat any child\noutput as protocol corruption. Errors come back as MCP tool errors instead.\n\n---\n\n## Talking to the API directly\n\n`GET /v1/memories` always returns an object with `items`, `next_cursor` and `text`. `items` is always\npresent, and is `[]` when there is nothing to show, so you never have to test for a missing key:\n\n```json\n{ \"items\": [], \"next_cursor\": null, \"text\": \"No shared memories yet.\", \"authors\": [] }\n```\n\nThose three keys are the stable contract. Further keys may be added, like `authors` above, so read the\nones you need rather than asserting on the whole object.\n\nAny non-2xx response is a FastAPI error body instead, with a single `detail` key and no `items`:\n\n```json\n{ \"detail\": \"invalid or missing api token\" }\n```\n\nSo check the status code before reading `items`. `GET /v1/memories/context` is a different shape on\npurpose: `{ items, text, used_chars, budget, truncated }`, where `budget` must be between 200 and\n20000.\n\n---\n\n## Account commands\n\n```bash\nmemany-auth login                 # sign in through the service and store a token\nmemany-auth whoami                # who the stored token belongs to\nmemany-auth invite you@team.dev   # add a teammate, --role member|admin\nmemany-auth members               # everyone in your org\nmemany-auth logout                # forget the token\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-72b88dc6a467166d2dd3d6b9214dc4fb"}