MemoDB MCP Server

MemoDB MCP Server

Manages AI conversation context and personal knowledge bases through the Model Context Protocol (MCP), providing tools for user data, conversation content, and knowledge management.

Category
Visit Server

README

MemoDB MCP Server

MCP 服务器,用于管理 AI 应用的对话上下文和个人知识库。该服务器通过模型上下文协议(MCP)提供用户数据、对话内容和知识管理的工具。

主要功能

1. 用户管理

  • create_user: 创建新用户
  • get_user: 获取用户信息
  • update_user: 更新用户信息
  • delete_user: 删除用户

2. 对话数据管理

  • insert_blob: 插入对话数据
  • get_blob: 获取对话数据
  • delete_blob: 删除对话数据

3. 知识库管理

  • query_knowledge: 查询知识库
    • 支持全文搜索
    • 支持按类型、标签、来源过滤
    • 支持限制返回结果数量
  • add_knowledge: 添加新知识
    • 支持设置知识来源
    • 支持设置知识类型
    • 支持添加标签
  • update_knowledge: 更新已有知识
    • 支持更新内容和元数据
    • 支持修改标签
  • relate_knowledge: 创建知识关联
    • 支持设置关联类型
    • 支持设置关联权重

技术亮点

  1. 类型安全

    • 使用 TypeScript 实现
    • 完整的类型定义和检查
    • 编译时错误检测
  2. 错误处理

    • 全面的错误处理机制
    • 详细的错误信息
    • 错误日志记录
  3. API 设计

    • 基于 JSON-RPC 2.0 协议
    • RESTful API 风格
    • 清晰的接口定义
  4. 可扩展性

    • 模块化设计
    • 插件式工具注册
    • 易于添加新功能

安装和配置

  1. 安装依赖:
npm install
  1. 配置环境变量: 创建 .env 文件并设置:
MEMOBASE_API_URL=your_api_url    # API 服务器地址
MEMOBASE_API_KEY=your_api_key    # API 访问密钥
  1. 构建项目:
npm run build
  1. 运行服务器:
# 生产环境
npm start

# 开发环境
npm run dev

API 示例

1. 添加知识

const result = await callTool('add_knowledge', {
  uid: 'user123',
  content: '人工智能是计算机科学的一个分支...',
  metadata: {
    source: 'wiki',
    type: 'article',
    tags: ['AI', '计算机科学', '技术']
  }
});

2. 查询知识

const result = await callTool('query_knowledge', {
  uid: 'user123',
  query: '人工智能',
  filters: {
    types: ['article'],
    tags: ['AI'],
    sources: ['wiki']
  },
  limit: 10
});

3. 关联知识

const result = await callTool('relate_knowledge', {
  uid: 'user123',
  source_kid: 'knowledge1',
  target_kid: 'knowledge2',
  relation_type: 'related_to',
  weight: 0.8
});

开发指南

  1. 添加新工具

    • src/tools 目录下创建工具实现
    • src/api/types.ts 添加类型定义
    • src/index.ts 注册工具
  2. 修改配置

    • 编辑 src/config.ts 更新配置项
    • .env 文件中添加新的环境变量
  3. 运行测试

npm test

常见问题

如果您在使用过程中遇到问题,请参考 常见问题与解决方案 文档。

许可证

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured