mcp基因座
MCP服务器 轨迹 --由Ollama提供支持的本地语义数据空间管理器。
将所有Locus HTTP端点作为MCP工具公开,以便任何兼容MCP的客户端(Claude Desktop、Cursor等)都可以管理数据空间、摄取文档和运行语义搜索。
需求
- 轨迹 本地或远程运行
- Node.js 18+
安装
npm install -g @miguelaperez/locus-mcp --registry=https://npm.pkg.github.com或者直接使用npx运行(包在GitHub上,而不是npm注册表中):
npx github:MiguelAPerez/locus-mcp注:@miguelaperez/locus-mcp是一个GitHub Packages包,未发布到公共npm注册表。使用npx @miguelaperez/locus-mcp(无github:)除非您配置了npm注册表,否则将失败。使用github:MiguelAPerez/locus-mcp相反。
配置
| 环境变量 | 默认值 | 描述 |
|---|---|---|
LOCUS_URL | http://localhost:8000 | API库的基本URL |
MCP客户端设置
克劳德桌面
添加 ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"locus": {
"command": "npx",
"args": ["-y", "github:MiguelAPerez/locus-mcp"],
"env": {
"LOCUS_URL": "http://localhost:8000"
}
}
}
}游标/其他客户端
{
"locus": {
"command": "npx",
"args": ["-y", "github:MiguelAPerez/locus-mcp"],
"env": {
"LOCUS_URL": "http://localhost:8000"
}
}
}mcpo(HTTP代理)
{
"mcpServers": {
"locus": {
"command": "npx",
"args": ["-y", "github:MiguelAPerez/locus-mcp"],
"env": {
"LOCUS_URL": "http://locus:8000"
}
}
}
}工具
空间
| 工具 | 说明 |
|---|---|
list_spaces | 列出所有数据空间 |
create_space | 创建新的数据空间 |
delete_space | 删除数据空间及其所有文档 |
文件
| 工具 | 说明 |
|---|---|
list_documents | 列出数据空间中的所有文档 |
ingest_document | 将文本引入数据空间 |
get_document | 按ID检索文档的全文 |
delete_document | 按ID删除文档 |
搜索
| 工具 | 说明 |
|---|---|
search | 数据空间上的语义搜索(query, k, full) |
设置和健康状况
| 工具 | 说明 |
|---|---|
health_check | 检查轨迹是否可达 |
get_settings | 获取当前Ollama URL和嵌入模型 |
update_settings | 更新Ollama URL和/或嵌入模型 |
发展
npm install
npm run dev # watch mode
npm test # run tests
npm run build # compile to dist/许可证
麻省理工学院
