The Tribal Knowledge Service is an MCP server for error knowledge tracking and retrieval that offers both REST API and native MCP interfaces. With this server, you can:
Store Error Records: Track errors with detailed context (error type, message, language, framework, code snippet, task description, and solution).
Retrieve Error Records: Fetch records by ID or search based on specific criteria.
Search for Similar Errors: Perform semantic similarity searches using vector search.
Update and Delete Records: Modify or remove error records from the knowledge base.
API Status Check: Verify the server's operational status.
Authentication: Secure access with JWT tokens and API keys.
Integration: Works with Claude Code for error tracking and connects with AWS services like S3 and DynamoDB.
Integration with Amazon S3 for storing error records, providing cloud-based storage for the knowledge database through the S3Storage implementation
Supports Docker-based deployment using docker-compose for containerized production environments
Provides a REST API interface using FastAPI with endpoints for creating, retrieving, updating, and deleting error records
Uses GitHub Actions for continuous integration and deployment, automatically running tests, linting, and type checking on push to main and pull requests
Supports publishing the package to PyPI, enabling easy installation through package managers
Tribal - Knowledge Service
Tribal is an MCP (Model Context Protocol) server implementation for error knowledge tracking and retrieval. It provides both REST API and native MCP interfaces for integration with tools like Claude Code and Cline.
Features
Store and retrieve error records with full context
Vector similarity search using ChromaDB
REST API (FastAPI) and native MCP interfaces
JWT authentication with API keys
Local storage (ChromaDB) and AWS integration
Docker-compose deployment
CLI client integration
Overview
Tribal helps Claude remember and learn from programming errors. When you start a Claude Code session, Tribal is automatically available through MCP without additional imports.
Claude will:
Store programming errors and solutions
Search for similar errors when you encounter problems
Build a knowledge base specific to your coding patterns
Packaging and Installing Tribal with uv
Prerequisites
Python 3.12+
uv package manager (recommended)
Build and Install Steps
Option 1: Direct installation with uv
The simplest approach is to install directly from the current directory:
Option 2: Development Installation
For development work where you want changes to be immediately reflected:
Option 3: Build the package first
If you want to build a distributable package:
Option 4: Using the uv tool install
command
You can also use the tool installation approach:
Verification
After installation, verify that the tool is properly installed:
Integration with Claude
After installation, you can integrate with Claude:
Usage
Available MCP Tools
Tribal provides these MCP tools:
add_error
- Create new error record (POST /errors)get_error
- Retrieve error by UUID (GET /errors/{id})update_error
- Modify existing error (PUT /errors/{id})delete_error
- Remove error record (DELETE /errors/{id})search_errors
- Find errors by criteria (GET /errors)find_similar
- Semantic similarity search (GET /errors/similar)get_token
- Obtain JWT token (POST /token)
Example Usage with Claude
When Claude encounters an error:
When Claude finds a solution:
Commands for Claude
You can ask Claude to:
"Look for similar errors in our Tribal knowledge base"
"Store this solution to our error database"
"Check if we've seen this error before"
Running the Server
Using the tribal command
Using Python modules
Using legacy entry points
Command-line Options
The FastAPI server will be available at http://localhost:8000 with API documentation at /docs. The MCP server will be available at http://localhost:5000 for Claude and other MCP-compatible LLMs.
Environment Variables
FastAPI Server
PERSIST_DIRECTORY
: ChromaDB storage path (default: "./chroma_db")API_KEY
: Authentication key (default: "dev-api-key")SECRET_KEY
: JWT signing key (default: "insecure-dev-key-change-in-production")REQUIRE_AUTH
: Authentication requirement (default: "false")PORT
: Server port (default: 8000)
MCP Server
MCP_API_URL
: FastAPI server URL (default: "http://localhost:8000")MCP_PORT
: MCP server port (default: 5000)MCP_HOST
: Host to bind to (default: "0.0.0.0")API_KEY
: FastAPI access key (default: "dev-api-key")AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
,AWS_S3_BUCKET
: For AWS integration
API Endpoints
POST /errors
: Create new error recordGET /errors/{error_id}
: Get error by IDPUT /errors/{error_id}
: Update error recordDELETE /errors/{error_id}
: Delete errorGET /errors
: Search errors by criteriaGET /errors/similar
: Find similar errorsPOST /token
: Get authentication token
Using the Client
How It Works
Tribal uses ChromaDB to store error records and solutions
When Claude encounters an error, it sends the error details to Tribal
Tribal vectorizes the error and searches for similar ones
Claude gets back relevant solutions to suggest
New solutions are stored for future reference
Development
Running Tests
Linting and Type Checking
GitHub Workflow
This project uses GitHub Actions for continuous integration and deployment. The workflow automatically runs tests, linting, and type checking on push to main and pull requests.
Workflow Steps
Test: Runs linting, type checking, and unit tests
Uses Python 3.12
Installs dependencies with uv
Runs ruff, black, mypy, and pytest
Build and Publish: Builds and publishes the package to PyPI
Triggered only on push to main branch
Uses Python's build system
Publishes to PyPI using twine
Testing Locally
You can test the GitHub workflow locally using the provided script:
This script simulates the GitHub workflow steps on your local machine:
Checks Python version (3.12 recommended)
Installs dependencies using uv
Runs linting with ruff
Checks formatting with black
Runs type checking with mypy
Runs tests with pytest
Builds the package
Note: The script skips the publishing step for local testing.
Project Structure
Versioning
Tribal follows Semantic Versioning. See VERSIONING.md for complete details about:
Version numbering (MAJOR.MINOR.PATCH)
Schema versioning for database compatibility
Branch naming conventions
Release and hotfix procedures
Check the version with:
Managing Dependencies
Deployment
Docker Deployment
Claude for Desktop Integration
Option 1: Let Claude for Desktop Launch the Server
Open
~/Library/Application Support/Claude/claude_desktop_config.json
Add the MCP server configuration (assumes Tribal tool is already installed):
{ "mcpServers": [ { "name": "tribal", "launchCommand": "tribal" } ] }Restart Claude for Desktop
Option 2: Connect to Running Docker Container
Start the container:
cd /path/to/tribal docker-startConfigure Claude for Desktop:
{ "mcpServers": [ { "name": "tribal", "url": "http://localhost:5000" } ] }
Claude Code CLI Integration
Troubleshooting
Verify Tribal installation:
which tribal
Check configuration:
claude mcp list
Test server status:
tribal status
Look for error messages in the Claude output
Check the database directory exists and has proper permissions
Cloud Deployment
The project includes placeholder implementations for AWS services:
S3Storage
: For storing error records in Amazon S3DynamoDBStorage
: For using DynamoDB as the database
License
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
An MCP server implementation that helps Claude remember and learn from programming errors by storing, retrieving, and finding similar errors with full context.
- Features
- Overview
- Packaging and Installing Tribal with uv
- Usage
- Development
- Versioning
- Deployment
- Troubleshooting
- Cloud Deployment
- License
Related Resources
Related MCP Servers
- -securityFlicense-qualityAn MCP server that allows Claude and other LLMs to manage persistent memories across conversations through text file storage, enabling commands to add, search, delete and list memory entries.Last updated -207
- AsecurityAlicenseAqualityAn MCP server that implements Claude Code-like functionality, allowing the AI to analyze codebases, modify files, execute commands, and manage projects through direct file system interactions.Last updated -15267MIT License
- -securityAlicense-qualityAn MCP server that provides persistent memory capabilities for Claude, offering tiered memory architecture with semantic search, memory consolidation, and integration with the Claude desktop application.Last updated -33MIT License
- AsecurityFlicenseAqualityAn MCP server that enables Claude to break down complex problems into manageable steps with support for revision and branching, facilitating dynamic and reflective problem-solving through a structured thinking process.Last updated -17