Tribal (Error Knowledge Base) MCP server

Stores and retrieves programming error knowledge through vector similarity search, enabling development teams to build a shared database of errors and solutions.
Back to servers
Setup instructions
Provider
Agentience
Release date
Mar 21, 2025
Language
Python
Package
Stats
7.4K downloads
4 stars

Tribal is an MCP (Model Context Protocol) server implementation that tracks and retrieves programming error knowledge. It integrates with tools like Claude Code and Cline, allowing Claude to remember and learn from programming errors through both REST API and native MCP interfaces.

Installation

Prerequisites

  • Python 3.12+
  • uv package manager (recommended)

Installation Options

Basic Installation

# From the project root directory
cd /path/to/tribal

# Install using uv
uv pip install .

Development Installation

# From the project root directory
cd /path/to/tribal

# Install in development mode
uv pip install -e .

Build and Install Package

# Make sure you're in the project root directory
cd /path/to/tribal

# Install the build package if needed
uv pip install build

# Build the package
python -m build

# Install the wheel file
uv pip install dist/tribal-0.1.0-py3-none-any.whl

Tool Installation

# Install as a global tool
cd /path/to/tribal
uv tool install .

# Or install in development mode
uv tool install -e .

Verification

# Check the installation
which tribal

# Check the version
tribal version

Integration with Claude

# Add Tribal to Claude Code
claude mcp add tribal --launch "tribal"

# Verify the configuration
claude mcp list

# For Docker container
claude mcp add tribal http://localhost:5000

Usage

Running the Server

Using the tribal command

# Run the server
tribal

# Get help
tribal help

# Show version
tribal version

# Run with options
tribal server --port 5000 --auto-port

Using Python modules

# Run the Tribal server
python -m mcp_server_tribal.mcp_app

# Run the FastAPI backend server
python -m mcp_server_tribal.app

Using legacy entry points

# Legacy MCP server
mcp-server

# Legacy FastAPI server
mcp-api

Command-line Options

# Development mode with auto-reload
mcp-api --reload
mcp-server --reload

# Custom port
mcp-api --port 8080
mcp-server --port 5000

# Auto port selection
mcp-api --auto-port
mcp-server --auto-port

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

Available MCP Tools

Tribal provides these MCP tools:

  1. add_error - Create new error record (POST /errors)
  2. get_error - Retrieve error by UUID (GET /errors/{id})
  3. update_error - Modify existing error (PUT /errors/{id})
  4. delete_error - Remove error record (DELETE /errors/{id})
  5. search_errors - Find errors by criteria (GET /errors)
  6. find_similar - Semantic similarity search (GET /errors/similar)
  7. get_token - Obtain JWT token (POST /token)

Example Usage with Claude

When Claude encounters an error:

I'll track this error and look for similar problems in our knowledge base.

When Claude finds a solution:

I've found a solution! I'll store this in our knowledge base for next time.

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"

Using the Client

# Add a new error record
mcp-client --action add --error-type ImportError --language python --error-message "No module named 'requests'" --solution-description "Install requests" --solution-explanation "You need to install the requests package"

# Get an error by ID
mcp-client --action get --id <error-id>

# Search for errors
mcp-client --action search --error-type ImportError --language python

# Find similar errors
mcp-client --action similar --query "ModuleNotFoundError: No module named 'pandas'"

Docker Deployment

# Build and start containers
docker-compose up -d --build

# View logs
docker-compose logs -f

# Stop containers
docker-compose down

# With custom environment variables
API_PORT=8080 MCP_PORT=5000 REQUIRE_AUTH=true API_KEY=your-secret-key docker-start

Claude for Desktop Integration

Option 1: Let Claude for Desktop Launch the Server

  1. Open ~/Library/Application Support/Claude/claude_desktop_config.json

  2. Add the MCP server configuration (assumes Tribal tool is already installed):

    {
      "mcpServers": [
        {
          "name": "tribal",
          "launchCommand": "tribal"
        }
      ]
    }
    
  3. Restart Claude for Desktop

Option 2: Connect to Running Docker Container

  1. Start the container:

    cd /path/to/tribal
    docker-start
    
  2. Configure Claude for Desktop:

    {
      "mcpServers": [
        {
          "name": "tribal",
          "url": "http://localhost:5000"
        }
      ]
    }
    

Troubleshooting

  1. Verify Tribal installation: which tribal
  2. Check configuration: claude mcp list
  3. Test server status: tribal status
  4. Look for error messages in the Claude output
  5. Check the database directory exists and has proper permissions

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "tribal" '{"command":"tribal","args":[]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "tribal": {
            "command": "tribal",
            "args": []
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "tribal": {
            "command": "tribal",
            "args": []
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later