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.
# From the project root directory
cd /path/to/tribal
# Install using uv
uv pip install .
# From the project root directory
cd /path/to/tribal
# Install in development mode
uv pip install -e .
# 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
# Install as a global tool
cd /path/to/tribal
uv tool install .
# Or install in development mode
uv tool install -e .
# Check the installation
which tribal
# Check the version
tribal version
# 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
# Run the server
tribal
# Get help
tribal help
# Show version
tribal version
# Run with options
tribal server --port 5000 --auto-port
# Run the Tribal server
python -m mcp_server_tribal.mcp_app
# Run the FastAPI backend server
python -m mcp_server_tribal.app
# Legacy MCP server
mcp-server
# Legacy FastAPI server
mcp-api
# 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.
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_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 integrationTribal 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)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.
You can ask Claude to:
# 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'"
# 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
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
Start the container:
cd /path/to/tribal
docker-start
Configure Claude for Desktop:
{
"mcpServers": [
{
"name": "tribal",
"url": "http://localhost:5000"
}
]
}
which tribal
claude mcp list
tribal status
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.
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.
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": []
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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