lorehub
Version:
Capture and surface the collective wisdom of your codebase
115 lines (90 loc) • 2.51 kB
Markdown
We have successfully implemented core fact management write operations in the LoreHub MCP server. Here's what's now available:
Create new facts in any project.
```json
{
"project_path": "/path/to/project",
"content": "Main fact content",
"why": "Optional context",
"type": "decision|assumption|constraint|requirement|risk|learning|todo|other",
"services": ["api", "frontend"],
"tags": ["architecture", "performance"],
"confidence": 95,
"source": {
"type": "manual",
"reference": "mcp",
"context": "optional context"
}
}
```
Update existing facts with partial updates.
```json
{
"fact_id": "fact-123",
"content": "Updated content",
"confidence": 100,
"status": "completed",
"tags": ["updated", "tags"]
}
```
Permanently delete facts with required confirmation.
```json
{
"fact_id": "fact-123",
"confirm": true
}
```
Soft delete facts by setting status to archived.
```json
{
"fact_id": "fact-123"
}
```
Restore archived facts back to active status.
```json
{
"fact_id": "fact-123"
}
```
You can now test the MCP server with:
```bash
lorehub-mcp
```
```json
{
"mcpServers": {
"lorehub": {
"command": "lorehub-mcp"
}
}
}
```
- **create_relation**: Create relationships between facts
- **delete_relation**: Remove relationships
- **list_relations**: List all relationships for a fact
- **get_project_stats**: Get project statistics and insights
- **bulk_create_facts**: Create multiple facts at once
- **search_by_tags**: Advanced tag-based search
- **export_project**: Export project data
1. **Project Validation**: All fact creation requires a valid project path
2. **Safety Checks**: Delete operations require explicit confirmation
3. **Status Management**: Facts can be active, completed, or archived
4. **Error Handling**: Clear error messages for all failure cases
5. **Comprehensive Tests**: All tools have unit tests with edge cases
The MCP server now provides full CRUD operations for facts. The next logical step would be to add relation management tools to enable creating knowledge graphs within projects.