An MCP server that exposes markdown files in ~/.cursor/commands/*.md
as prompts via the MCP server/prompts
API.
npm install -g cursor-user-commands
Add to ~/.cursor/mcp.json
(or your client’s config):
{
"mcpServers": {
"cursor-user-commands": {
"command": "npx",
"args": ["cursor-user-commands"]
}
}
}
- Create markdown files under
~/.cursor/commands/
(e.g.,~/.cursor/commands/my-template.md
). - Each file is exposed as a prompt named by its filename (without extension).
- Description is taken from the first
# Heading
or the first non-empty line.
Clients can call:
prompts/list
→ returns all available prompt names and descriptions.prompts/get
with{ "name": "my-template" }
→ returns a singleuser
text message containing the file’s markdown.
Create or edit markdown files in your commands folder:
# Ensure the folder exists
mkdir -p ~/.cursor/commands
# Quick single-line example
echo '# Hello\nWrite a friendly greeting.' > ~/.cursor/commands/hello.md
# Or open the folder in Cursor (if the `cursor` CLI is available)
cursor ~/.cursor/commands
Notes:
- Files must have the
.md
extension to be recognized. - Prompts are registered at server startup; after adding files, restart the server or reconnect the MCP client to refresh the list.
yarn install
yarn build
yarn start
src/
├── server.ts # Minimal MCP server setup
└── prompts/
└── commands-prompts.ts # Reads ~/.cursor/commands and registers prompts
This package is ready for publishing:
prepublishOnly
builds and marksdist/server.js
executable.- Binary name:
cursor-user-commands
.