Binelek MCP服务器
Binelek平台的模型上下文协议(MCP)服务器。该服务器提供MCP工具,用于通过API网关与Binelek知识图、搜索、人工智能和数据管道服务进行交互。
特性
- 知识图谱工具:查询、创建、更新和删除实体和关系
- 搜索工具:语义、关键字和混合搜索功能
- AI工具:与人工智能聊天、预测、分析实体
- 管道工具:触发和监控数据管道
- 管理工具:域配置、YAML验证、代码生成
安装
npm install
npm run build配置
创建一个 .env 文件(复制自 .env.example):
BINELEK_GATEWAY_URL=http://localhost:8092
BINELEK_TENANT_ID=core
BINELEK_JWT_TOKEN=your-jwt-token-here
LOG_LEVEL=info用法
作为独立服务器
npm start使用克劳德桌面
添加到您的Claude Desktop配置(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):
{
"mcpServers": {
"binelek": {
"command": "node",
"args": ["/path/to/binelek-mcp-server/build/index.js"],
"env": {
"BINELEK_GATEWAY_URL": "http://localhost:8092",
"BINELEK_TENANT_ID": "core",
"BINELEK_JWT_TOKEN": "your-jwt-token"
}
}
}
}使用VS代码扩展
这 binelek-vscode-extension 使用此MCP服务器。有关设置说明,请参阅该项目的README。
可用工具
本体工具
binelek_get_entity-按ID获取实体binelek_query_entities-执行Cypher查询binelek_create_entity-创建新实体binelek_update_entity-更新现有实体binelek_delete_entity-删除实体binelek_get_relationships-获取实体关系binelek_create_relationship-建立关系
搜索工具
binelek_semantic_search-基于嵌入的语义搜索binelek_keyword_search-使用Elasticsearch进行关键字搜索binelek_hybrid_search-语义+关键字组合搜索
AI工具
binelek_ai_chat-与Binelek AI助手聊天binelek_ai_predict-使用ML模型进行预测binelek_ai_analyze_entity-人工智能实体分析
管道工具
binelek_list_pipelines-列出所有管道binelek_get_pipeline-获取管道详细信息binelek_trigger_pipeline-触发管道执行binelek_get_pipeline_runs-获取管道运行历史记录
管理工具
binelek_list_domains-列出可用域binelek_get_domain-获取域配置binelek_get_ontology_schema-获取本体YAML模式binelek_validate_yaml-验证本体YAMLbinelek_generate_code-从YAML生成代码
认证
MCP服务器使用JWT令牌向Binelek API网关进行身份验证。你可以:
- 设置在环境中:
BINELEK_JWT_TOKEN=your-token - 在.env文件中设置:参见
.env.example - 通过MCP配置传递:在Claude Desktop或VS Code中配置时
要获得JWT令牌,请通过Binelek平台进行身份验证或使用auth API:
curl -X POST http://localhost:8092/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"your-password"}'建筑
MCP Client (Claude/VS Code)
↓ stdio
MCP Server (this project)
↓ HTTP/REST
API Gateway (localhost:8092)
↓ routes to
Backend Services (Ontology, Search, AI, Pipeline, etc.)重要:MCP服务器仅与API网关通信,从不直接与后端服务通信。这确保了正确的身份验证、租户隔离和速率限制。
发展
# Install dependencies
npm install
# Build
npm run build
# Development mode (auto-reload)
npm run dev
# Type check
npm run type-check错误处理
服务器优雅地处理错误,并以MCP格式返回错误:
{
"content": [{
"type": "text",
"text": "Error: Entity not found: prop_123"
}],
"isError": true
}许可证
麻省理工学院
