Stashly can act as a Model Context Protocol server, so an AI assistant (Claude Code, Codex, opencode, VS Code, Cursor, Gemini CLI, Windsurf, Zed, Cline, Antigravity and other MCP clients) can use it as a place to keep notes: create a stash for a topic, push notes into it, edit, tag and retitle them, check when things expire, and read them back later.
Three things decide what an assistant can do, and all three are checked by the server:
A stash an assistant creates is its person’s own and is switched on for assistants, with secret and burn notes kept from them.
Switching stashes on. In a stash’s settings, as above, or from My stashes: the menu of a stash you own has Let AI assistants use this (or Stop AI assistants using this), and a stash that assistants may use wears an AI tag. To switch on every stash you make from now on, tick Let AI assistants use the stashes I make from now on in User Settings > MCP (shown when the server runs MCP). New stashes then start switched on with secret and burn-after-reading notes kept from assistants; older stashes keep their own choice, and you can change any stash afterwards.
MCP_ENABLED=true).ADMIN_PASSWORD, because accounts need the admin area.Some assistants cannot be given a token to paste. They run in the vendor’s cloud and ask the server to let you sign in instead. Stashly supports that sign-in (OAuth 2.1 with PKCE, the way the MCP specification describes), so you add Stashly to them as a custom connector with only its address:
PUBLIC_URL) to that address, for example https://stash.example.com, so the sign-in describes itself correctly. Behind a reverse proxy, pass /mcp, /oauth/ and /.well-known/ through.https://<your stashly>/mcp. Choose OAuth if it asks, and leave any client ID and secret empty: the app registers itself.What the app gets is an access token like the ones you make by hand: it acts as you, reaches only the stashes switched on for assistants, and shows in User Settings > MCP as a signed in app with the app’s name. Revoke signs it out at once. Its access token lasts an hour, and a refresh token the app keeps (used once, valid 90 days if not used) gets it a new one without asking you again; an app that is not used for 90 days has to be approved again. Approving the same app again replaces its earlier sign-in. The tokens count towards your 10.
The endpoints, for anyone writing a client: /.well-known/oauth-protected-resource, /.well-known/oauth-authorization-server, POST /oauth/register (dynamic client registration; public clients only, redirect addresses are https, plain http on this computer, or the app’s own scheme), /oauth/authorize (a page), and POST /oauth/token (authorization_code with code_verifier, and refresh_token). Only S256 PKCE is accepted.
The address is https://<your stashly>/mcp and every request carries Authorization: Bearer <token>. Replace the address and token below.
Claude Code
claude mcp add --transport http stashly https://stash.example.com/mcp --header "Authorization: Bearer stm_..."
Codex (the token goes in an environment variable; or put [mcp_servers.stashly] with url and bearer_token_env_var = "STASHLY_TOKEN" in ~/.codex/config.toml)
export STASHLY_TOKEN=stm_...
codex mcp add stashly --url https://stash.example.com/mcp --bearer-token-env-var STASHLY_TOKEN
opencode (opencode.json; oauth: false because the token is the credential)
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"stashly": {
"type": "remote",
"url": "https://stash.example.com/mcp",
"oauth": false,
"headers": { "Authorization": "Bearer {env:STASHLY_TOKEN}" }
}
}
}
VS Code (.vscode/mcp.json, or your user mcp.json)
{
"servers": {
"stashly": {
"type": "http",
"url": "https://stash.example.com/mcp",
"headers": { "Authorization": "Bearer stm_..." }
}
}
}
Antigravity (mcp_config.json: MCP servers > Manage MCP servers > View raw config)
{
"mcpServers": {
"stashly": {
"serverUrl": "https://stash.example.com/mcp",
"headers": { "Authorization": "Bearer stm_..." }
}
}
}
Cursor (~/.cursor/mcp.json, or .cursor/mcp.json in a project; set STASHLY_TOKEN in the environment Cursor starts from)
{
"mcpServers": {
"stashly": {
"url": "https://stash.example.com/mcp",
"headers": { "Authorization": "Bearer ${env:STASHLY_TOKEN}" }
}
}
}
Gemini CLI (saves to the current project; add -s user after add for ~/.gemini/settings.json)
gemini mcp add --transport http --header "Authorization: Bearer stm_..." stashly https://stash.example.com/mcp
Windsurf (~/.codeium/windsurf/mcp_config.json: Cascade > MCP servers > View raw config)
{
"mcpServers": {
"stashly": {
"serverUrl": "https://stash.example.com/mcp",
"headers": { "Authorization": "Bearer stm_..." }
}
}
}
Zed (settings.json)
{
"context_servers": {
"stashly": {
"url": "https://stash.example.com/mcp",
"headers": { "Authorization": "Bearer stm_..." }
}
}
}
Cline (cline_mcp_settings.json: MCP Servers > Configure)
{
"mcpServers": {
"stashly": {
"type": "streamableHttp",
"url": "https://stash.example.com/mcp",
"headers": { "Authorization": "Bearer stm_..." }
}
}
}
Claude Desktop, or any client that starts a program (needs Node 22 and the file bin/stashly-mcp.js from Stashly; replace the path). With a token the program only passes the client’s messages on to the server’s /mcp endpoint, so the server decides what the token may do:
{
"mcpServers": {
"stashly": {
"command": "node",
"args": ["/path/to/stashly/bin/stashly-mcp.js"],
"env": { "STASHLY_URL": "https://stash.example.com", "STASHLY_TOKEN": "stm_..." }
}
}
}
After npm link (or npm install -g .) the command is also available as stashly-mcp, with no path. For Claude Code: claude mcp add stashly --env STASHLY_URL=... --env STASHLY_TOKEN=... -- node /path/to/stashly/bin/stashly-mcp.js.
The client commands above were written from each client’s documentation; if one has changed its syntax, the address, the Authorization: Bearer header and the token are all it needs.
| Tool | What it does |
|---|---|
create_stash |
topic (required), visibility, password, ttl. Makes a stash for a topic, owned by the token’s person and returns its name and link. It is private by default: only that person, signed in, can open it (assistants acting for them still can), and it is switched on for assistants with secret and burn notes hidden. An assistant makes an open stash only when told to: visibility: "link" (anyone with the link) or a password (anyone who knows it); the person can change it any time in Stash Settings > Access. A stash that is not private has a name that is the topic plus a random tail (q3-launch-plan-x7k2pq) when it has no password, because then the name is the only lock. Run without a token (the program on its own), there is no person to keep the stash private for, so it is open as before. |
add_note |
stash (name or link), text, title, tags (up to 8), password, create_if_missing. Adds a note and tags it. With create_if_missing a stash that does not exist is made first, private like create_stash makes it. |
list_stashes |
search, limit (1-100, default 50). The stashes this person can use through assistants: their own and the ones shared with them that are switched on for AI, with name, link and access. Needs an access token (the stdio program without one cannot list). |
list_notes |
stash, search, tag, limit (1-100, default 20), password. Lists items newest first with id, date, title, tags, whether pinned, when each expires, and the start of each note, plus the tags in use. |
read_note |
stash, id, password. Reads one note in full, with its tags, created and edited times and when it expires. |
get_stash |
stash, password. The stash’s details: created, when it expires (or never, and how long is left), whether it has a password, what it holds, how full it is, the newest-N limit, the tags in use, and what the person may do in it. |
update_note |
stash, id, text, title, tags, password. Edits a note: its text (the whole new text replaces the old), title and/or tags (a file takes only a title and tags). Tags replace the old ones (an empty list clears them); an empty title goes back to the first words of the note; changing only the text keeps the title. The edit is refused if someone changed the note after the assistant read it, so a newer edit is never overwritten, and a note cannot be made empty. |
A typical use: “Research X and keep what you find in a stash for it”. The assistant calls create_stash once, then add_note for each finding, tags and refines them as it learns more with update_note, and gives you the link.
REQUIRE_ADMIN_TO_CREATE or REQUIRE_LOGIN_TO_CREATE) refuses create_stash for people who may not.password in the call.mcp.tool_called: the tool, whether it failed, the person and the token’s id, never what was in it or the token), along with user.mcp_token_created, user.mcp_token_revoked, user.mcp_default, admin.mcp_token_revoked and stash.mcp.GET and DELETE /mcp answer 405.bin/stashly-mcp.js without STASHLY_TOKEN works as any visitor of the server does, through its API: whoever has a stash’s name (or password) can use it, and a stash’s AI assistants switch does not apply. It is for a server you run for yourself; for anything shared, give it a token. It takes STASHLY_URL (default http://localhost:3000) and STASHLY_PASSWORD (a password to try for password-protected stashes; a tool call can give its own).