devonfox/notes-mcp
If you are the rightful owner of notes-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
An MCP (Model Context Protocol) server that facilitates the creation and management of markdown notes and tasks, with integration to Discord and local file systems.
Markdown Notes MCP Server
An MCP (Model Context Protocol) server that creates markdown files and sends them to Discord, with support for local file saving and task management.
Features
- Send Markdown Notes: Create markdown files and send them to Discord as file attachments
- Task Management: Add tasks to a weekly todo list (local file or Discord)
- Local File Saving: Optionally save files locally in addition to Discord
- MCP Protocol: Full MCP protocol support via HTTP
- Docker Support: Easy deployment with Docker
Requirements
- Node.js 18+ (for native FormData and Blob support)
- Docker (optional, for containerized deployment)
Setup
1. Install Dependencies
npm install
2. Create a Discord Webhook
- Go to your Discord server
- Navigate to the channel where you want to receive notes
- Click on the channel settings (gear icon)
- Go to "Integrations" → "Webhooks"
- Click "New Webhook" or "Create Webhook"
- Give it a name (e.g., "AI Notes")
- Copy the webhook URL
3. Configure Environment Variables
Create a .env file in the project root (you can copy from .env.example):
cp .env.example .env
Then edit .env and configure your settings:
# Required: Discord webhook URL
DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/your_webhook_id/your_webhook_token
# Optional: Local file path to save markdown files
# If set, files will be saved to this directory in addition to being sent to Discord
LOCAL_FILE_PATH=/Users/yourname/Documents/notes
# Optional: Path to tasks.md file for weekly todo list
# If set, tasks will be appended to this file when running locally
# If not set, tasks will be sent to Discord with a timestamped filename
TASKS_FILE_PATH=/Users/yourname/Documents/tasks.md
Or export them in your shell:
export DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/your_webhook_id/your_webhook_token
export LOCAL_FILE_PATH=/Users/yourname/Documents/notes
export TASKS_FILE_PATH=/Users/yourname/Documents/tasks.md
4. Build the Project
npm run build
Usage
Running the MCP Server
The server runs on HTTP (default port 3000) and exposes MCP protocol endpoints.
npm start
For development:
npm run dev
The server will start on http://localhost:3000 (or the port specified by the PORT environment variable).
Connecting MCP Clients
Connect to the server using the MCP endpoint:
- MCP Inspector:
npx @modelcontextprotocol/inspectorand connect tohttp://localhost:3000/mcp - Cursor: Add MCP server with URL
http://localhost:3000/mcp - ChatGPT: Turn on Development mode, and Create new connector with URL
http://localhost:3000/mcp - Claude Desktop: Configure in settings with URL
http://localhost:3000/mcp - VS Code: Add MCP server configuration
API Endpoints
GET /
API information endpoint.
GET /health
Health check endpoint.
Response:
{
"status": "ok"
}
POST /mcp
MCP protocol endpoint. This is the main endpoint for MCP clients.
MCP Tools
The server exposes two tools:
1. send_markdown_to_discord
Creates a markdown note/document and sends it to Discord as a file attachment.
When to use: General notes, documents, summaries, or any content that should be saved as a markdown file.
Parameters:
prompt(required): The content to convert into a markdown notetitle(optional): Title for the markdown notewebhookUrl(optional): Discord webhook URL. If not provided, usesDISCORD_WEBHOOK_URLfrom environment
Behavior:
- Creates a markdown file with the content
- Sends to Discord as a file attachment
- If
LOCAL_FILE_PATHis set, also saves the file locally
Example usage in MCP client:
"Create a markdown note about today's meeting: We discussed the new feature..."
"Save this summary as a markdown file: [content]"
2. add_tasks
Adds tasks or todo items to a weekly todo list.
When to use: When you want to add tasks, todos, action items, or checklist items.
Parameters:
items(required): Array of task items. Items starting with spaces or dashes will be treated as subtasks and indented.
Behavior:
-
If
TASKS_FILE_PATHis set (local mode):- Reads existing
tasks.mdfile - Appends new tasks to the bottom
- Formats tasks as markdown checkboxes (
- [ ] task) - Subtasks are indented with 2 spaces
- Reads existing
-
If
TASKS_FILE_PATHis not set (remote mode):- Sends tasks to Discord as a file attachment
- Filename format:
tasks_to_add_YYYYMMDD_HHMMSS.md(UTC-8 timestamp)
Example usage in MCP client:
"Add these tasks to my todo list: Review the PR, Write documentation, Test the feature"
"Add these items to my checklist: [list items]"
How It Works
Markdown Notes (send_markdown_to_discord)
- Receives content and optional title
- Formats as markdown (adds title as
# Titleif provided) - Creates a markdown file in memory
- Sends to Discord as a file attachment
- Optionally saves locally if
LOCAL_FILE_PATHis configured
Task Management (add_tasks)
- Receives array of task items
- Formats as markdown checkboxes (
- [ ] task) - Detects subtasks (items with leading spaces/tabs) and indents them
- Local mode (if
TASKS_FILE_PATHis set):- Reads existing tasks from file
- Appends new tasks
- Writes back to file
- Remote mode (if
TASKS_FILE_PATHis not set):- Generates timestamped filename (UTC-8)
- Sends to Discord as file attachment
Environment Variables
| Variable | Required | Description |
|---|---|---|
DISCORD_WEBHOOK_URL | Yes | Discord webhook URL for sending files |
PORT | No | Server port (default: 3000) |
LOCAL_FILE_PATH | No | Directory path to save markdown files locally |
TASKS_FILE_PATH | No | Full path to tasks.md file for local task management |
Docker Deployment
Using Docker Compose (Recommended)
-
Create a
.envfile with your configuration (see above) -
Build and run with Docker Compose:
docker-compose up -d
- View logs:
docker-compose logs -f
- Stop the container:
docker-compose down
Using Docker Directly
- Build the Docker image:
docker build -t discord-markdown-notes-mcp .
- Run the container:
docker run -it --rm \
-e DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/your_webhook_id/your_webhook_token \
-e LOCAL_FILE_PATH=/app/notes \
-e TASKS_FILE_PATH=/app/tasks.md \
-p 3000:3000 \
discord-markdown-notes-mcp
Or use a .env file:
docker run -it --rm \
--env-file .env \
-p 3000:3000 \
discord-markdown-notes-mcp
Docker Notes
- The HTTP server runs on port 3000 inside the container
- Port 3000 is exposed and mapped to your host machine
- Environment variables can be passed via
-eflags,--env-file, or indocker-compose.yml - The container runs the built TypeScript code from the
distdirectory - You can access the server at
http://localhost:3000when running with Docker
Example Usage
Using MCP Client (Recommended)
When connected via an MCP client like Cursor or Claude Desktop, you can use natural language:
For markdown notes:
- "Create a markdown note about today's meeting"
- "Save this summary as a markdown file"
- "Send this document to Discord"
For tasks:
- "Add these tasks to my todo list: [list tasks]"
- "Add these items to my checklist: [list items]"
- "Add these action items: [list items]"
Using curl (for testing)
# Send a markdown note
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "send_markdown_to_discord",
"arguments": {
"prompt": "This is a test note with **markdown** formatting.",
"title": "Test Note"
}
},
"id": 1
}'
# Add tasks
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "add_tasks",
"arguments": {
"items": ["Review PR", "Write docs", "Test feature"]
}
},
"id": 2
}'
Development
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run in development mode
npm run dev
License
ISC