================================================================ MCP SERVER PROMPT Have Claude write a small MCP server for one job you define, then wire it into Claude Desktop. ================================================================ BEFORE YOU START Check the one-click list first. Claude Desktop has a directory of reviewed servers under Settings > Extensions > Browse extensions. If what you need is there, install it and stop. Build your own only when you want a procedure rather than a capability. Not "read my files", which already exists, but "check these notes for the term I give you and hand back the date and the line around it, newest first." You will need Node.js installed, and four terminal commands. ================================================================ STEP 1 SET UP THE FOLDER ================================================================ Make a folder, for example Documents/my-mcp-server. In a terminal, type "cd " with the space, drag the folder onto the window, press enter. Then: npm init -y npm install @modelcontextprotocol/sdk ================================================================ STEP 2 THE PROMPT ================================================================ Paste this into Claude. Replace the bracketed parts. ---------------------------------------------------------------- Write me a complete MCP server in Node.js, using the official @modelcontextprotocol/sdk package. WHAT IT SHOULD DO It exposes exactly one tool, called [tool_name]. The tool takes one input: [what the caller supplies]. It should [the one job, stated as a procedure]. It returns, for each result: - [field] - [field] - [field] Sort by [order]. Cap it at [n] results. CONSTRAINTS - Read only. It must never write, move, or delete anything. - If the source is missing or unreadable, return a clear message saying so rather than crashing. - If nothing matches, say nothing matched. Don't return an empty result that looks like an error. - Use stdio transport, so Claude Desktop can start it. - One file. No build step, no TypeScript, no framework. OUTPUT Give me the complete contents of server.js, ready to save. Then tell me, separately, the exact claude_desktop_config.json entry I need, and the exact command to test it by hand first. ---------------------------------------------------------------- The constraints block is where the quality comes from. "Read only" is the line that matters most, and stating it in the prompt beats hoping. Save the result as server.js in the folder you made. ================================================================ STEP 3 TEST IT BY HAND FIRST ================================================================ node server.js Working looks like nothing much. A line saying it is running, or a cursor sitting there. A server waits to be spoken to, so silence is success. Ctrl-C to stop. Broken looks like a block of red text. Copy all of it, paste it back to Claude, say "this is the error, fix it." Do not skip this. Finding a typo here takes seconds. Finding it after wiring in takes twenty minutes in the wrong place. ================================================================ STEP 4 WIRE IT IN ================================================================ Claude menu (top menu bar, not the in-window settings) > Settings > Developer > Edit Config. macOS: ~/Library/Application Support/Claude/ claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json { "mcpServers": { "my-notes": { "command": "node", "args": ["/full/path/to/my-mcp-server/server.js"] } } } Full paths only. No ~, no relative paths, no trailing comma after the last entry. Quit Claude Desktop completely and reopen. Closing the window is not enough. Check under "Add files, connectors, and more" > Connectors > Manage connectors. ================================================================ STEP 5 PROVE IT ================================================================ Ask three things you can verify by hand: 1. A term you know appears. 2. A term you know appears nowhere. You want a clean "nothing matched", not an error. 3. A term in a file whose date you already know. Check the date it reports. The third is the real test. Anything can return results. The right date on the right file is what tells you it works. ================================================================ WHEN IT BREAKS ================================================================ node not recognised Not installed, or the terminal predates the install. Open a new terminal. Cannot find module Wrong folder, or npm install didn't finish. Re-run it in the folder holding server.js. Runs by hand, invisible in Claude The path in the config. Full path, no shortcuts. Check for a trailing comma. Shows up, every call fails Read the log: macOS: ~/Library/Logs/Claude/mcp-server-NAME.log Windows: %APPDATA%\Claude\logs Paste it back to Claude. Returns nothing when there is a match Usually the path in the code. Ask Claude to report how many files it scanned. Zero means wrong folder. Worked yesterday, not today Folder moved, renamed, or synced to a cloud drive that keeps files online rather than on disk. Three rounds and still broken Start a fresh conversation. Long threads patch instead of reconsidering. ================================================================ THE LIMITS, PLAINLY ================================================================ It runs as you. Whatever you can open, it can open. Keep it read only and point it at your own working folders. It is not shareable. Your machine, your paths, no installer. It is not reviewed. The one-click directory has a check behind it. Yours has you. That is fine for a read-only tool over your own notes, and it is the reason to keep it read-only. If a team starts depending on it, hand it to someone who does this properly. Knowing where that line sits is worth as much as the server. ================================================================ bringwhatyouknow.com ================================================================