A local MCP server that gives LLMs access to a hierarchical pattern database. Patterns are organized into domains > categories > patterns, and LLMs can discover, match, and suggest new patterns through three simple tools.
This project is intended for local use only and is not production-ready. Auth is session-based and in-memory, there's no rate limiting, and the SQLite database lives on disk alongside the code. Treat it as a personal development tool.
npm installThe most common way to use this. Clone the repository and then add it to your MCP client config (e.g. Claude Code, Claude Desktop):
{
"mcpServers": {
"patterns": {
"command": "npx",
"args": ["tsx", "path/to/src/stdio.ts"]
}
}
}Or run directly:
npm run start:stdioStarts both the MCP endpoint and a management web app:
ADMIN_SECRET=your-secret npm run start:http- Web UI: http://127.0.0.1:3001
- MCP endpoint: http://127.0.0.1:3001/mcp
Set PORT to change the default port.
| Tool | Description |
|---|---|
discover |
Given a domain, returns its available categories |
match |
Given a domain + categories, returns matching patterns with templates |
suggest |
Submit a new pattern suggestion with source tracking |
Patterns are stored in a local SQLite database (patterns.db). Each pattern has a label, description, intention (what the user wants), and a template (structured prompt).
The typical flow:
- LLM calls
discoverwith a domain (e.g."software-engineering") - Server returns the domain's categories
- LLM calls
matchwith relevant categories - Server returns patterns with templates the LLM can apply
The web UI provides full CRUD for managing domains, categories, and patterns, plus a review workflow for community-submitted suggestions.
npm run build # compile TypeScript
npm test # run tests
npm run test:watch # run tests in watch modeTypeScript, MCP SDK, Express 5, better-sqlite3, Zod, Vitest