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
Metadata
Release files for ltmhub-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ltmhub_mcp-0.1.0.tar.gz | 7.0 kB | Without provenance | Details for ltmhub_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ltmhub_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ltmhub_mcp-0.1.0-py3-none-any.whl |
Total release size: 14.0 kB
Release files / ltmhub_mcp-0.1.0.tar.gz
| Download URL | ltmhub_mcp-0.1.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ab4e5ec2bdfa215f08e8ab4bd1cff05d53554050835084ef5127f7e205e2865
|
|
BLAKE2b-256 checksum How to use checksums |
7d66be41a172539864a7558e0e99ebf00c2f60a6822ffdcb5c5bee73edddfe75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / ltmhub_mcp-0.1.0-py3-none-any.whl
| Download URL | ltmhub_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
167bd9d615ba959d42ccd8b257c68752aac48ab99271b66ca906a5bb8a36fb8a
|
|
BLAKE2b-256 checksum How to use checksums |
d50e0c7db6f7ab863254e7f0a4bbd6d734b6557f73c35f705d67f963122bb747
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for ltmhub-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.