Minimal MCP Server
by AlekOmOm
A minimal MCP server designed for retrieving and reading markdown notes. It implements the Model-Context-Protocol to provide notes as a knowledge source.
View on GitHub
Last updated: N/A
minimal MCP server design
- retrieving and reading notes.
Requirements
- Create a minimal MCP server that implements the Model-Context-Protocol
- Provide capability to retrieve and read markdown notes
- Use the provided notes_MCP as knowledge source
- Keep implementation minimal (MVP)
- Use plain JavaScript (no TypeScript)
Tech Stack
- Runtime: Node.js
- Framework: Express.js (lightweight web framework)
- Dependencies:
- express (HTTP server)
- cors (Cross-Origin Resource Sharing)
- fs (Node.js file system for reading notes)
- path (Path manipulation utilities)
Architecture
A simple client-server architecture:
+-------------------+ +-------------------+ +-----------------+
| LLM Host | ----> | MCP Server | ----> | File System |
| (Claude/other LLM)| | (Express Server) | | (Notes Storage) |
| | <---- | | <---- | |
+-------------------+ +-------------------+ +-----------------+
Directory Structure
mcp-notes-server/
├── package.json
├── server.js # Main entry point
├── routes/
│ └── mcp-router.js # MCP protocol router
├── tools/
│ └── notes-tool.js # Notes retrieval implementation
└── notes/ # Directory containing your markdown notes
└── ... (your .md files)
Components
1. MCP Router
Handles MCP protocol requests:
- Discovery endpoint (
/discover
): Returns available tools and functions - Invocation endpoint (
/invoke
): Processes tool function calls
2. Notes Tool
Implements note retrieval functions:
list_notes
: Lists available notesread_note
: Retrieves content of a specific notesearch_notes
: Simple search functionality for notes
Implementation Plan
- Set up basic Express server with CORS support
- Implement MCP router with discovery and invocation endpoints
- Create notes tool with basic file operations
- Connect components and test with an LLM host