Your Personal AI Memory Hub - Store and retrieve your personal data from any MCP-enabled AI assistant.
SelfHub is a Model Context Protocol (MCP) server that acts as your personal digital memory. Store notes, preferences, code snippets, tasks, and any information you want - then access them seamlessly from any AI assistant that supports MCP (Claude Desktop, VS Code Copilot, etc.).
Think of it as your personal knowledge base that travels with you across all AI conversations.
git clone https://github.com/Sagargupta16/SelfHub.git
cd SelfHub
pnpm install
cp .env.example .env # set MONGODB_URI to your MongoDB connection string
pnpm build
# Optional: load sample data
pnpm seedOpen the Claude Desktop configuration file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Add this configuration (replace with your actual path):
{
"mcpServers": {
"selfhub": {
"command": "node",
"args": ["C:\\absolute\\path\\to\\SelfHub\\build\\index.js"]
}
}
}Important for Windows: Use double backslashes (\\) in the path!
Completely quit and restart Claude Desktop.
In Claude, try:
- "List all my memories"
- "Search my memories for typescript"
- "Store that I prefer dark mode in all applications"
pnpm buildCreate .vscode/mcp.json in your workspace (replace with your actual path):
{
"servers": {
"selfhub": {
"type": "stdio",
"command": "node",
"args": ["C:\\absolute\\path\\to\\SelfHub\\build\\index.js"]
}
}
}Then reload VS Code: Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) β Type "Reload Window" β Press Enter
Open GitHub Copilot Chat (Ctrl+Alt+I) and try:
@workspace list my memories
@workspace search my memories for "typescript"
@workspace store in my memory: I love using pnpm for package management
Note: You need GitHub Copilot extension installed and enabled.
Store new information in your memory hub.
Example:
Store that I prefer TypeScript over JavaScript for all new projects
Parameters:
content(required) - The information to storetype- Memory type:short-term,long-term,contextualcategory- Category:personal,professional,learning,projects,code,tasks, etc.title- Optional titletags- Array of tagsimportance- 1-5 importance level
Get a specific memory by its ID.
Example:
Retrieve memory mem_001
List memories with optional filters.
Example:
List all my professional memories
Show me memories tagged with 'typescript'
List my personal memories
Parameters:
type- Filter by typecategory- Filter by categorytags- Filter by tagscontextId- Filter by contextlimit- Max results (default: 50)offset- Pagination offset
Search through your memories using text queries.
Example:
Search my memories for "typescript"
Find memories about "API design"
Parameters:
query(required) - Search querycategory- Filter by categorytype- Filter by typetags- Filter by tagslimit- Max results (default: 10)
Delete a memory by ID.
Example:
Delete memory mem_005
Create a new organizational context.
Example:
Create a new context called "Machine Learning Project" for project type
Parameters:
name(required) - Context nametype(required) -conversation,project,topic,temporaldescription- Optional descriptiontags- Array of tagsmemoryIds- Initial memory IDs to include
Activate a context and load its memories.
Example:
Activate the "SelfHub Development" context
List all contexts with optional filters.
Example:
List all my project contexts
Show active contexts
Get usage statistics and insights.
Example:
Show me my memory statistics
Returns:
- Total memories count
- Memories by type breakdown
- Memories by category breakdown
- Total contexts
- Most used tags
Store that I prefer dark mode in all applications
Store my favorite TypeScript coding conventions
Remember that I use pnpm for package management
Search my memories for "preferences"
Create a new context called "SelfHub Development" for project type
Store in SelfHub context: Database schema uses Drizzle ORM
Activate the SelfHub Development context
List all memories in the SelfHub context
Store as learning: Vector embeddings represent text as numerical arrays
Tag with "machine-learning" and "embeddings"
Search my learning memories for "embeddings"
List all my learning-related memories
Store this code snippet: const sum = (a, b) => a + b
Category: code, Tags: javascript, utility
Search my code for "utility functions"
Run pnpm seed to load 6 sample memories into your database:
- mem_sample_001 - Dark mode UI preference (personal)
- mem_sample_002 - TypeScript best practice (professional)
- mem_sample_003 - MongoDB basics (learning)
- mem_sample_004 - Documentation update task (tasks)
- mem_sample_005 - NPM commands quick reference (code)
- mem_sample_006 - SelfHub project overview (projects)
And 2 sample contexts:
- ctx_sample_001 - SelfHub Development (project)
- ctx_sample_002 - Personal Preferences (topic)
SelfHub/
βββ src/
β βββ index.ts # Main MCP server
β βββ seed.ts # Sample data seeder
β βββ db/ # Database layer
β β βββ connection.ts
β β βββ schemas.ts
β βββ models/ # TypeScript type definitions
β β βββ memory.model.ts
β β βββ context.model.ts
β β βββ index.ts
β βββ services/ # Business logic layer
β β βββ memory.service.ts
β β βββ context.service.ts
β βββ storage/ # Storage implementation
β βββ mongodb-storage.ts # MongoDB persistent storage
βββ build/ # Compiled JavaScript output
βββ .env.example # Environment variable template
βββ package.json
βββ tsconfig.json
βββ README.md
# Development mode (auto-reload with tsx)
pnpm dev
# Type checking
pnpm typecheck
# Build for production
pnpm build
# Clean build directory
rm -rf build- MCP Server (
src/index.ts) - Implements the MCP protocol, defines 9 tools - Services Layer - Business logic for memory and context operations
- Storage Layer - MongoDB persistent storage via Mongoose (set
MONGODB_URIin.env) - Models - TypeScript interfaces for type safety
# Start the server
pnpm dev
# You should see:
# π SelfHub MCP Server running with MongoDB!
# πΎ Database: Connected and ready
# π οΈ Available tools: 9 (store, retrieve, search, list, delete, contexts, stats)The server runs on stdio (standard input/output) and waits for MCP protocol messages. You cannot interact with it directly - it needs an MCP client like Claude Desktop or VS Code.
-
Check the config path:
- Make sure you're editing the correct config file
- Use absolute path, not relative
-
Verify build exists:
ls build/index.js
-
Check for typos:
- Windows paths need double backslashes:
C:\\path\\to\\ - JSON syntax must be valid
- Windows paths need double backslashes:
-
Restart Claude completely:
- Quit from system tray
- Wait a few seconds
- Start again
-
Check Claude logs:
- Windows:
%APPDATA%\Claude\logs - macOS:
~/Library/Logs/Claude
- Windows:
-
Make sure GitHub Copilot is installed:
- Press
Ctrl+Shift+X - Search "GitHub Copilot"
- Install both "GitHub Copilot" and "GitHub Copilot Chat"
- Press
-
Reload VS Code window:
Ctrl+Shift+Pβ "Reload Window"
-
Check the build:
pnpm build
# Clean and rebuild
rm -rf build node_modules
pnpm install
pnpm buildSelfHub uses MongoDB persistent storage - your data survives server restarts. If data isn't persisting:
-
Check your
.envfile:- Make sure
MONGODB_URIpoints to your MongoDB instance - Copy from the template if missing:
cp .env.example .env
- Make sure
-
Verify the connection:
- The server logs
β Connected to MongoDBon startup - Without
MONGODB_URI, it falls back tomongodb://localhost:27017/selfhub
- The server logs
This project uses Renovate for automated dependency updates - see renovate.json.
- Model Context Protocol - Learn about MCP
- Claude Desktop - Download Claude Desktop
- GitHub Copilot - Learn about Copilot
- β MongoDB persistent storage
- β 9 MCP tools
- β Memory categorization and tagging
- β Context management
- β Text-based search
- β Sample data seeder
- Vector embeddings for semantic search
- File import/export (JSON, Markdown, CSV)
- Data encryption for sensitive information
- Web UI for management
- Multi-user support
- Cloud sync
Contributions are welcome! Please read CONTRIBUTING.md and feel free to submit a Pull Request.
MIT License - see LICENSE file for details.
If you have questions or run into issues:
- Check the Troubleshooting section
- Review the documentation above
- Open an issue on GitHub
Built with:
- Model Context Protocol SDK - MCP implementation
- TypeScript - Type safety
- pnpm - Fast package manager
Made with β€οΈ by Sagargupta16
Your personal AI memory hub - remember everything, access anywhere!