tribeRef MCP Server
Provides persistent tribal memory for Claude Code sessions, enabling querying of decisions and entities, logging artifacts, and managing tasks with Supabase.
README
tribeRef MCP Server
Tribal memory infrastructure for tribeCast AI agents. This is an MCP (Model Context Protocol) server that provides persistent memory across Claude Code sessions.
What tribeRef Does
- Tribal Memory (
ref_tribal_memory) - Query decisions, entities, schemas, and active tasks - Session Context (
ref_session_context) - Track tokens used, items retrieved, session state - Log Artifacts (
ref_log_artifact) - Write outputs back to tribal memory - Log Decisions (
log_decision) - Record architectural and strategic decisions - Manage Entities (
upsert_entity) - Create/update tracked objects (products, services, schemas) - Task Management (
create_task,log_completion) - Track work items for agents
Setup
1. Install Dependencies
cd packages/triberef-mcp
npm install
2. Configure Supabase
Copy .env.example to .env and fill in your Supabase credentials:
cp .env.example .env
Required environment variables:
SUPABASE_URL- Your Supabase project URLSUPABASE_SERVICE_KEY- Your Supabase service role key
3. Run Database Migration
Execute the migration in your Supabase SQL editor:
supabase/migrations/001_tribemcp_foundation.sql
Or use the Supabase CLI.
4. Build
npm run build
5. Run
Stdio mode (for Claude Desktop/CLI):
npm start
# or
node dist/index.cjs
HTTP mode (for browser/API access):
npm run start:http
# or
TRANSPORT=http node dist/index.cjs
Claude Desktop Configuration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"triberef": {
"command": "node",
"args": ["/path/to/tribecast/packages/triberef-mcp/dist/index.cjs"],
"env": {
"SUPABASE_URL": "your-supabase-url",
"SUPABASE_SERVICE_KEY": "your-service-key"
}
}
}
}
Development
# TypeScript watch mode
npm run dev
# Type checking
npm run check
# Build and inspect with MCP inspector
npm run build && npm run inspect
Tools
ref_tribal_memory
Query tribal memory with deduplication (items already retrieved in session are filtered).
{
"query": "payment architecture",
"include": ["decisions", "entities", "tasks"],
"max_tokens": 5000
}
ref_session_context
Get current session state.
{}
Returns: session ID, tokens used/remaining, items retrieved counts.
ref_log_artifact
Log an artifact back to tribal memory.
{
"task_id": "TRIBE-001",
"type": "code",
"name": "src/tools/tribal-memory.ts",
"content": "..."
}
log_decision
Record an architectural decision.
{
"topic": "Database architecture",
"decision": "Use Supabase PostgreSQL",
"rationale": "Existing infrastructure, real-time subscriptions",
"tags": ["database", "infrastructure"]
}
upsert_entity
Create or update an entity.
{
"name": "tribeRef",
"type": "product",
"description": "Tribal memory MCP server",
"status": "building",
"tags": ["mcp", "infrastructure"]
}
create_task
Create a work item.
{
"task_id": "TRIBE-003",
"title": "Implement expert agent consultations",
"spec": "Add ref_expert_agent tool...",
"related_entities": ["tribeRef", "tribeAgent"]
}
log_completion
Mark task complete with artifacts.
{
"task_id": "TRIBE-001",
"artifacts": [
{ "type": "code", "name": "src/index.ts" },
{ "type": "migration", "name": "001_foundation.sql" }
]
}
Architecture
src/
├── index.ts # MCP server entry point
├── db.ts # Supabase client & types
├── session.ts # Session tracking & dedup
├── tools/
│ ├── tribal-memory.ts # ref_tribal_memory, log_decision, upsert_entity
│ ├── session-context.ts # ref_session_context
│ └── log-artifact.ts # ref_log_artifact, create_task, log_completion
└── utils/
└── tokens.ts # Token estimation utilities
License
MIT (forked from ref-tools/ref-tools-mcp)
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.