1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
# Memory MCP Server Claude Code Configuration ๐ง
A production-grade Claude Code configuration specialized for building MCP servers with memory persistence, vector search, and AI companion systems.
## โจ Features
This configuration provides comprehensive support for:
- **Memory Systems** - Vector-indexed persistence with pgvector
- **MCP Protocol** - Complete server implementation toolkit
- **Database Architecture** - PostgreSQL 17 with Neon serverless
- **AI Companions** - Multi-tenant architecture patterns
- **Production Deployment** - Docker, Kubernetes, monitoring
## ๐ฆ Installation
1. Copy the `.claude` directory to your MCP server project:
```bash
cp -r memory-mcp-server/.claude your-mcp-project/
cp memory-mcp-server/CLAUDE.md your-mcp-project/
```
2. The configuration will be automatically loaded when you start Claude Code.
## ๐ค Specialized Agents (15 total)
### MCP Protocol Experts
| Agent | Description | Use Cases |
|-------|-------------|-----------|
| `mcp-protocol-expert` | Protocol debugging and compliance | Connection issues, protocol validation |
| `mcp-sdk-builder` | SDK implementation patterns | Building new MCP servers |
| `mcp-transport-expert` | Transport layers (stdio, HTTP, SSE) | Session management, optimization |
| `mcp-types-expert` | TypeScript and Zod schemas | Type safety, JSON-RPC formats |
### Database & Vector Search
| Agent | Description | Use Cases |
|-------|-------------|-----------|
| `neon-drizzle-expert` | Neon PostgreSQL with Drizzle ORM | Database setup, migrations |
| `pgvector-advanced` | Advanced pgvector v0.8.0 features | Binary vectors, HNSW indexes |
| `vector-search-expert` | Semantic search and embeddings | OpenAI embeddings, similarity search |
### Memory & Architecture
| Agent | Description | Use Cases |
|-------|-------------|-----------|
| `memory-architecture` | Database design and indexing | Schema design, retrieval optimization |
| `memory-lifecycle` | Consolidation and expiration | Memory decay models, deduplication |
| `memory-validator` | Data integrity and validation | CRUD operations, testing |
| `companion-architecture` | Multi-tenant AI systems | Isolation strategies, scaling |
### Development & Operations
| Agent | Description | Use Cases |
|-------|-------------|-----------|
| `code-reviewer` | Comprehensive code review | Security focus, best practices |
| `debugger` | Systematic debugging | Root cause analysis |
| `test-runner` | Automated testing | MCP protocol validation |
| `production-deployment` | HTTPS deployment | Containerization, monitoring |
## ๐ ๏ธ Commands (7 total)
### Development Workflow
```bash
/setup quick # Quick project setup with essentials
/setup full # Complete environment with all dependencies
/setup database # Database-focused initialization
```
### Testing & Review
```bash
/test # Generate comprehensive test suites
/review # Security-focused code review
/explain # Context-aware code explanation
```
### MCP Operations
```bash
/mcp-debug # Debug MCP protocol issues
/memory-ops # Test memory CRUD operations
/perf-monitor # Performance profiling
```
## ๐ช Automation Hooks
### TypeScript Development Hook
Automatically triggered on file modifications:
- โ
Type checking with `tsc --noEmit`
- โจ Prettier formatting
- ๐ง ESLint fixing
- ๐งช Test execution for test files
- ๐ Smart filtering (skips node_modules, build dirs)
### Command Logging
- ๐ Logs all executed Bash commands
- โฑ๏ธ Timestamps for debugging
- ๐ Audit trail maintenance
## โ๏ธ Configuration Details
### Security Permissions
```json
{
"permissions": {
"allow": [
"Read", "Grep", "Glob", "LS",
"Bash(npm test:*)",
"Write(**/*.ts)",
"Bash(npx drizzle-kit:*)",
"Bash(psql:*)"
],
"deny": [
"Read(./.env)",
"Bash(rm -rf:*)",
"Bash(git push:*)"
]
}
}
```
### Environment Variables
Pre-configured for MCP development:
- `DATABASE_URL` - PostgreSQL connection
- `OPENAI_API_KEY` - For embeddings
- `MCP_SERVER_PORT` - Server configuration
- `NEON_DATABASE_URL` - Serverless PostgreSQL
## ๐ Usage Examples
### Building an MCP Memory Server
```bash
# 1. Set up the project
> /setup full
# 2. Design memory schema
> Use memory-architecture agent to design the database schema
# 3. Implement MCP server
> Use mcp-sdk-builder agent to create the server
# 4. Add vector search
> Use vector-search-expert to implement semantic search
# 5. Deploy to production
> Use production-deployment agent for containerization
```
### Debugging MCP Connections
```bash
# Debug protocol issues
> /mcp-debug
# The debugger will:
# - Validate protocol compliance
# - Check message formats
# - Test transport layer
# - Identify connection issues
```
## ๐ Technology Stack
Optimized for:
- **TypeScript** & Node.js
- **PostgreSQL 17** with Neon serverless
- **Drizzle ORM v0.44.4** for type-safe database
- **pgvector v0.8.0** for vector similarity
- **@modelcontextprotocol/sdk** for MCP
- **OpenAI embeddings** for semantic search
- **Docker & Kubernetes** for deployment
## ๐ฏ Key Features
### Memory Persistence
- Vector-indexed storage with pgvector
- Semantic search capabilities
- Memory consolidation and lifecycle
- Multi-tenant isolation
### MCP Protocol Support
- Complete SDK implementation patterns
- Transport layer optimization
- Protocol compliance validation
- Session management
### Production Ready
- Docker containerization
- Kubernetes orchestration
- Prometheus/Grafana monitoring
- Structured logging
## ๐ง Customization
Edit `.claude/settings.json` to customize:
- Permissions for your security needs
- Environment variables for your services
- Hook configurations for your workflow
- Agent selections for your domain
## ๐ Best Practices
This configuration enforces:
1. **Type Safety** - Full TypeScript with Zod validation
2. **Security First** - Input validation, authentication
3. **Performance** - Optimized vector search, caching
4. **Testing** - Comprehensive test coverage
5. **Monitoring** - Structured logging, metrics
6. **Documentation** - Clear code comments, API docs
## ๐ Troubleshooting
### Common Issues
**Hooks not executing:**
```bash
chmod +x .claude/hooks/*.sh
```
**Database connection issues:**
```bash
# Check environment variables
echo $DATABASE_URL
# Test connection
psql $DATABASE_URL
```
**MCP protocol errors:**
```bash
/mcp-debug
```
## ๐ Resources
- [MCP SDK Documentation](https://modelcontextprotocol.io)
- [pgvector Documentation](https://github.com/pgvector/pgvector)
- [Neon Documentation](https://neon.tech/docs)
- [Drizzle ORM Documentation](https://orm.drizzle.team)
---
**Built for production MCP server development** ๐
*Transform your MCP server development with specialized AI assistance and automation.*
|