MCPatterns
About
A server for storing and retrieving personalized coding patterns from a local JSONL file.
Details
- Author
- nicholasrubright
- Categories
- Developer Tools, Knowledge Base, Productivity
Jump to
Setup
Install MCPatterns in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/nicholasrubright/MCPatterns
Follow the installation instructions in the repository README, then restart your MCP client.
MCPatterns is a Model Context Protocol (MCP) server that enables users to save and retrieve personalized coding patterns. It helps LLMs learn how an individual codes by storing structured patterns categorized by technology, use case, and style.
This server acts as a persistent memory layer for LLM agents, allowing them to reference a user's preferred coding styles, patterns, and conventions. It supports:
- Personalized code generation based on stored patterns
- Consistent refactoring following user preferences
- Style-aware suggestions using familiar patterns
- Long-term memory of coding practices across sessions
interface Pattern { name: string; // Unique identifier category: string; // e.g., "Backend", "Frontend", "Database" description: string; // What this pattern does use_cases: string[]; // When to use this pattern technologies: string[]; // Languages, frameworks, libraries code_examples: { [language: string]: string }; // Code samples by language }
{ "name": "Error Handling Middleware", "category": "Backend", "description": "Express middleware for consistent error handling with structured responses", "use_cases": ["API development", "Middleware composition", "Error standardization"], "technologies": ["Node.js", "Express", "TypeScript"], "code_examples": { "JavaScript": "app.use((err, req, res, next) => {\n console.error(err.stack);\n res.status(500).json({ error: 'Something went wrong!' });\n});", "TypeScript": "app.use((err: Error, req: Request, res: Response, next: NextFunction) => {\n console.error(err.stack);\n res.status(500).json({ error: 'Something went wrong!' });\n});" } }
MCPatterns provides the following MCP tools:
Create multiple new coding patterns in the database.
{ "patterns": [Pattern, ...] }
Add new code examples to existing patterns.
{ "additions": [ { "patternName": "string", "examples": { "language": "code" } } ] }
{ "patternNames": ["pattern1", "pattern2"] }
Remove specific code examples from patterns.
{ "deletions": [ { "patternName": "string", "languages": ["JavaScript", "TypeScript"] } ] }
Search patterns by query across all fields.
{ "query": "search term" }
{ "names": ["pattern1", "pattern2"] }
MCPatterns uses JSONL (newline-delimited JSON) format for data storage:
- File location: Configurable viaPATTERNS_FILE_PATHenvironment variable
- Default location:patterns.jsonin the server directory
- Format: Each line contains a JSON object withtype: "pattern"
- Atomic operations: Full file rewrite ensures data consistency
git clone https://github.com/nicholasrubright/mcpatterns.git cd mcpatterns pnpm install
- PATTERNS_FILE_PATH: Custom path for the patterns database file
- Can be absolute path or relative to script directory
- Defaults topatterns.jsonin server directory
Add to yourclaude_desktop_config.json:
{ "mcpServers": { "mcpatterns": { "command": "npx", "args": ["-y", "@mcpatterns/server"] } } }
{ "mcpServers": { "mcpatterns": { "command": "npx", "args": ["-y", "@mcpatterns/server"], "env": { "PATTERNS_FILE_PATH": "/path/to/custom/patterns.json" } } } }
Add to your VS Code settings (settings.json):
{ "mcp": { "servers": { "mcpatterns": { "command": "npx", "args": ["-y", "@mcpatterns/server"] } } } }
MCPatterns works best when integrated into your AI workflow with prompts like:
Before generating code, search my patterns for relevant examples using the technologies I'm working with. Use my established patterns and coding style preferences when creating new code.
- Use descriptive names that clearly identify the pattern's purpose
- Group related patterns with consistent category naming
- Include comprehensive use cases to improve searchability
- Provide examples in multiple languages when applicable
- Atomic patterns: Store focused, single-purpose patterns
- Rich metadata: Include detailed use cases and technology tags
- Version examples: Keep code examples up-to-date with current practices
- Search-friendly: Use descriptive language in descriptions and use cases
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Local stdio MCP server that lets AI coding agents read and maintain structured architecture, rules, and decisions directly from your repository.
Official Context7 MCP server that brings up-to-date, version-specific library documentation and code examples into AI coding prompts.
Remote, no-auth MCP server providing AI-powered codebase context and answers
Governed memory for coding agents with trust lifecycle, conflict detection, staleness tracking, and health scoring. SQLite + FTS5, zero infrastructure. Works with Claude Code, Cursor, Codex, Windsurf.
Searching and access your AI coding sessions from Claude Code, Gemini CLI, opencode, and OpenAI Codex.
Anchor is local repo and org memory for AI coding agents. It indexes GitHub PR history, current code, tests, regressions, architecture, and cross-repo impact locally, then exposes concise cited context through MCP and CLI workflows. Local-first. Read-only GitHub access. No CLI telemetry. No SaaS. No remote LLM calls.
Persistent project memory + architectural decisions + pre-execution safety hooks for Claude Code. Local-only storage, multi-repo workspace, automatic knowledge extraction via background auditor.
Hebbian memory for AI agents — learns file access patterns, builds neural pathways, predicts next tools/files, saves tokens
MCP server that ingests project docs once and lets Claude search by meaning instead of reading everything — saving tokens on large codebases
knowledge network for AI coding agents. Developers connect their agents to a shared pool of verified solutions — saving tokens, reducing debugging time, and getting better results. Solution authors earn when their work helps others.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





