LTMhub MCP Server - Connect Claude Desktop to your Long-Term Memory
Project description
LTMhub MCP Server
Connect Claude Desktop to your LTMhub Long-Term Memory.
一键安装
方式 1: 使用 uvx (推荐)
uvx ltmhub-mcp
方式 2: 使用 pip
pip install ltmhub-mcp
ltmhub-mcp
方式 3: 从 GitHub 安装
pip install git+https://github.com/ltmhub/ltmhub-mcp.git
配置 Claude Desktop
1. 获取 API Key
- 登录 LTMhub
- 进入 设置 → API Keys
- 创建新的 API Key
2. 配置 Claude Desktop
编辑 Claude Desktop 配置文件:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
添加以下配置:
{
"mcpServers": {
"ltmhub": {
"command": "uvx",
"args": ["ltmhub-mcp"],
"env": {
"LTMHUB_API_KEY": "your_api_key_here",
"LTMHUB_API_URL": "https://api.ltmhub.ai/api/v1"
}
}
}
}
或使用 pip 安装方式:
{
"mcpServers": {
"ltmhub": {
"command": "ltmhub-mcp",
"env": {
"LTMHUB_API_KEY": "your_api_key_here",
"LTMHUB_API_URL": "https://api.ltmhub.ai/api/v1"
}
}
}
}
3. 重启 Claude Desktop
完全退出 Claude Desktop (Cmd+Q / Ctrl+Q),然后重新启动。
可用工具
| 工具 | 描述 |
|---|---|
memory_create |
创建新的记忆条目 |
memory_get |
根据 ID 获取单个记忆 |
memory_list |
列出记忆(支持分页) |
memory_search |
向量相似度搜索 |
memory_fork |
Fork 公开项目 |
agent_list |
列出 Agent |
project_list |
列出项目 |
使用示例
创建问答记忆
Use memory_create to save:
- agent_id: <your-agent-id>
- knowledge_type: qa
- knowledge: {"type": "qa", "question": "如何调试 useEffect?", "answer": "检查依赖数组...", "tags": ["react"]}
搜索记忆
Use memory_search with:
- query: "React debugging"
- top_k: 5
列出记忆
Use memory_list with:
- page: 1
- per_page: 10
- knowledge_type: qa
知识类型
qa (问答)
{
"type": "qa",
"question": "问题",
"answer": "回答",
"tags": ["标签1", "标签2"]
}
triple (三元组)
{
"type": "triple",
"subject": "主体",
"predicate": "谓词",
"object": "客体"
}
document (文档)
{
"type": "document",
"title": "标题",
"content": "内容...",
"tags": ["标签"]
}
code (代码)
{
"type": "code",
"title": "代码标题",
"description": "描述",
"code": "def example():\n pass",
"language": "python"
}
decision (决策)
{
"type": "decision",
"decision": "决策内容",
"context": "上下文",
"outcome": "结果"
}
环境变量
| 变量 | 必填 | 默认值 | 说明 |
|---|---|---|---|
LTMHUB_API_KEY |
是 | - | LTMhub API Key |
LTMHUB_API_URL |
否 | http://localhost:8000/api/v1 |
API 地址 |
本地开发
# 克隆仓库
git clone https://github.com/ltmhub/ltmhub-mcp.git
cd ltmhub-mcp
# 安装依赖
pip install -e .
# 运行
LTMHUB_API_KEY=your_key LTMHUB_API_URL=http://localhost:8000/api/v1 ltmhub-mcp
发布到 PyPI
# 构建
pip install build
python -m build
# 上传
pip install twine
twine upload dist/*
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ltmhub_mcp-0.1.0.tar.gz
(7.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ltmhub_mcp-0.1.0.tar.gz.
File metadata
- Download URL: ltmhub_mcp-0.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ab4e5ec2bdfa215f08e8ab4bd1cff05d53554050835084ef5127f7e205e2865
|
|
| MD5 |
6389f3a27da91c484986f66b8cc79d1d
|
|
| BLAKE2b-256 |
7d66be41a172539864a7558e0e99ebf00c2f60a6822ffdcb5c5bee73edddfe75
|
File details
Details for the file ltmhub_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ltmhub_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
167bd9d615ba959d42ccd8b257c68752aac48ab99271b66ca906a5bb8a36fb8a
|
|
| MD5 |
769d5b961377d4473c0b6327fa353570
|
|
| BLAKE2b-256 |
d50e0c7db6f7ab863254e7f0a4bbd6d734b6557f73c35f705d67f963122bb747
|