SelfHub MCP Server

SelfHub MCP Server

A personal AI memory hub that stores and retrieves personal data from any MCP-enabled AI assistant, enabling persistent memory across conversations.

Category
访问服务器

README

SelfHub MCP Server

Your Personal AI Memory Hub - Store and retrieve your personal data from any MCP-enabled AI assistant.

🎯 What is SelfHub?

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.

Step 2: Configure Claude Desktop

Open 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!

Step 3: Restart Claude Desktop

Completely quit and restart Claude Desktop.

Step 4: Test It!

In Claude, try:

  • "List all my memories"
  • "Search my memories for typescript"
  • "Store that I prefer dark mode in all applications"

💻 Setup with VS Code

Step 1: Build the Server

pnpm build

Step 2: Configure VS Code

The workspace is already configured! Just reload VS Code:

Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) → Type "Reload Window" → Press Enter

Step 3: Test in Copilot Chat

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.

🛠️ Available Tools

Memory Management (5 tools)

1. store_memory

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 store
  • type - Memory type: short-term, long-term, contextual
  • category - Category: personal, professional, learning, projects, code, tasks, etc.
  • title - Optional title
  • tags - Array of tags
  • importance - 1-5 importance level

2. retrieve_memory

Get a specific memory by its ID.

Example:

Retrieve memory mem_001

3. list_memories

List memories with optional filters.

Example:

List all my professional memories
Show me memories tagged with 'typescript'
List memories sorted by importance

Parameters:

  • type - Filter by type
  • category - Filter by category
  • tags - Filter by tags
  • contextId - Filter by context
  • limit - Max results (default: 50)
  • offset - Pagination offset
  • sortBy - Sort field: createdAt, updatedAt, importance, accessCount
  • sortOrder - asc or desc

4. search_memories

Search through your memories using text queries.

Example:

Search my memories for "typescript"
Find memories about "API design"

Parameters:

  • query (required) - Search query
  • category - Filter by category
  • type - Filter by type
  • tags - Filter by tags
  • limit - Max results (default: 10)

5. delete_memory

Delete a memory by ID.

Example:

Delete memory mem_005

Context Management (3 tools)

6. create_context

Create a new organizational context.

Example:

Create a new context called "Machine Learning Project" for project type

Parameters:

  • name (required) - Context name
  • type (required) - conversation, project, topic, temporal
  • description - Optional description
  • tags - Array of tags
  • memoryIds - Initial memory IDs to include

7. activate_context

Activate a context and load its memories.

Example:

Activate the "SelfHub Development" context

8. list_contexts

List all contexts with optional filters.

Example:

List all my project contexts
Show active contexts

Analytics (1 tool)

9. get_stats

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

📚 Example Usage Scenarios

Personal Knowledge Management

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"

Project Development

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

Learning & Notes

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 sorted by date

Code Snippets

Store this code snippet: const sum = (a, b) => a + b
Category: code, Tags: javascript, utility
Search my code for "utility functions"

🗂️ Sample Data

SelfHub comes with 6 pre-loaded sample memories:

  1. mem_001 - Dark mode UI preference (personal)
  2. mem_002 - TypeScript coding standard (professional)
  3. mem_003 - Vector embeddings concept (learning)
  4. mem_004 - SelfHub project overview (projects)
  5. mem_005 - Database development task (tasks)
  6. mem_006 - ID generation utility code (code)

And 2 sample contexts:

  1. ctx_001 - SelfHub Development (project)
  2. ctx_002 - AI & Machine Learning (topic)

🏗️ Project Structure

SelfHub/
├── src/
│   ├── index.ts              # Main MCP server
│   ├── 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
│       └── mock-storage.ts   # In-memory mock data
├── build/                    # Compiled JavaScript output
├── .github/                  # GitHub Actions CI/CD
│   └── workflows/
│       ├── ci.yml           # Continuous Integration
│       └── release.yml      # Automated releases
├── .vscode/                 # VS Code configuration
│   └── settings.json        # MCP server settings
├── package.json
├── tsconfig.json
└── README.md

🔧 Development

Available Scripts

# Development mode (auto-reload with tsx)
pnpm dev

# Type checking
pnpm typecheck

# Build for production
pnpm build

# Clean build directory
rm -rf build

How It Works

  1. MCP Server (src/index.ts) - Implements the MCP protocol, defines 9 tools
  2. Services Layer - Business logic for memory and context operations
  3. Storage Layer - In-memory Map-based storage with sample data
  4. Models - TypeScript interfaces for type safety

Testing Locally

# Start the server
pnpm dev

# You should see:
# 🚀 SelfHub MCP Server running with mock data!
# 📊 Loaded 6 sample memories and 2 sample contexts
# 🛠️  Available tools: 9

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.

🐛 Troubleshooting

Server Not Showing in Claude Desktop

  1. Check the config path:

    • Make sure you're editing the correct config file
    • Use absolute path, not relative
  2. Verify build exists:

    ls build/index.js
    
  3. Check for typos:

    • Windows paths need double backslashes: C:\\path\\to\\
    • JSON syntax must be valid
  4. Restart Claude completely:

    • Quit from system tray
    • Wait a few seconds
    • Start again
  5. Check Claude logs:

    • Windows: %APPDATA%\Claude\logs
    • macOS: ~/Library/Logs/Claude

VS Code Not Showing Tools

  1. Make sure GitHub Copilot is installed:

    • Press Ctrl+Shift+X
    • Search "GitHub Copilot"
    • Install both "GitHub Copilot" and "GitHub Copilot Chat"
  2. Reload VS Code window:

    • Ctrl+Shift+P → "Reload Window"
  3. Check the build:

    pnpm build
    

Build Errors

# Clean and rebuild
rm -rf build node_modules
pnpm install
pnpm build

Data Not Persisting

This is expected! The current version uses in-memory storage. All data resets when you restart the server. This is intentional for the initial version - persistent storage will be added in a future update.

🚀 CI/CD

This project includes GitHub Actions workflows:

  • CI Pipeline - Runs on every push, tests on Node 18.x and 20.x
  • Release Workflow - Creates releases when you push version tags
  • Dependabot - Automatically updates dependencies

See .github/workflows/ for details.

📖 Documentation

🗺️ Roadmap

Current Version (v0.1.0)

  • ✅ In-memory storage
  • ✅ 9 MCP tools
  • ✅ Memory categorization and tagging
  • ✅ Context management
  • ✅ Text-based search
  • ✅ Sample data

Future Enhancements

  • [ ] Persistent SQLite storage
  • [ ] 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

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

MIT License - see LICENSE file for details.

💬 Support

If you have questions or run into issues:

  1. Check the Troubleshooting section
  2. Review the documentation above
  3. Open an issue on GitHub

🌟 Acknowledgments

Built with:


Made with ❤️ by Sagargupta16

Your personal AI memory hub - remember everything, access anywhere!

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选