trinitas-mcp

trinitas-mcp

Enables context-aware memory and multi-model orchestration through tools for storing/retrieving dialog turns, searching memory, and routing to AI providers based on task types.

Category
Visit Server

README

trinitas-mcp

MCP server for context, memory, and multi-model orchestration. Designed as a reusable component — not tied to a single dashboard — and extensible for review workflows and dialog-state management.

Built with the official Model Context Protocol Python SDK (mcp[cli] / FastMCP).

Features

Area Capability
Memory Store and retrieve dialog turns per session (SQLite)
Resources conversation://{session_id} — full session context as JSON
Routing Provider recommendations via AI Provider Registry

Tools

  • store_dialog_turn — persist a message turn with optional metadata
  • retrieve_recent_context — fetch recent turns for LLM context
  • search_memory — substring search within a session
  • route_best_model — score providers for a task type
  • list_available_providers — list registry providers and capabilities

Requirements

  • Python >= 3.10
  • Network access for registry tools (cached locally)

Quickstart

cd /opt/AI_trinitas-mcp

# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate

# Install (editable)
pip install -e .

# Run server (stdio — for MCP clients)
trinitas-mcp

Environment variables

Variable Default Description
TRINITAS_DATA_DIR data Base directory for local data
TRINITAS_MEMORY_DB {TRINITAS_DATA_DIR}/trinitas_memory.db SQLite memory path
PROVIDER_REGISTRY_URL GitHub Pages registry.json Registry document URL
PROVIDER_REGISTRY_BASE GitHub Pages base URL Registry base for future detail fetches
REGISTRY_CACHE_TTL_SECONDS 60 In-memory registry cache TTL

No API keys are required for the MCP server itself. Provider credentials belong in the calling client or orchestrator.

Host orchestrator (review execution)

The MCP server prepares multi-provider reviews via execute_review but does not call external LLM APIs. Use the included host orchestrator example to run the prepared execution_request entries and persist findings.

Workflow:

propose_review_strategy → execute_review → execute_host_review → store_review_findings
       (MCP tool)           (MCP tool)        (host script)         (optional persist)

Mock run (no API key):

source .venv/bin/activate
python examples/host_orchestrator.py --session demo-review

Live run (OpenAI-compatible API):

export TRINITAS_ORCHESTRATOR_API_KEY=sk-...
export TRINITAS_ORCHESTRATOR_MODEL=gpt-4o-mini
# OpenRouter example:
# export TRINITAS_ORCHESTRATOR_BASE_URL=https://openrouter.ai/api/v1
python examples/host_orchestrator.py --session demo-review --live --persist
Variable Description
TRINITAS_ORCHESTRATOR_API_KEY API key (falls back to OPENAI_API_KEY)
TRINITAS_ORCHESTRATOR_BASE_URL OpenAI-compatible base URL
TRINITAS_ORCHESTRATOR_MODEL Default model for all reviewers
TRINITAS_MODEL_<PROVIDER> Per-provider model override (uppercase id)

Core module: trinitas_mcp.orchestrator (execute_host_review, OpenAICompatibleClient, MockLLMClient).

Claude Desktop / Cursor

After pip install -e ., add to your MCP config:

{
  "mcpServers": {
    "trinitas-mcp": {
      "command": "trinitas-mcp",
      "env": {
        "TRINITAS_DATA_DIR": "/absolute/path/to/trinitas-mcp/data"
      }
    }
  }
}

See examples/claude_desktop_config.json for a full example.

Cursor: Settings → MCP → add the same server block, or edit .cursor/mcp.json.

Development (without install):

{
  "mcpServers": {
    "trinitas-mcp": {
      "command": "python",
      "args": ["-m", "trinitas_mcp.server"],
      "cwd": "/absolute/path/to/trinitas-mcp",
      "env": {
        "PYTHONPATH": "/absolute/path/to/trinitas-mcp/src"
      }
    }
  }
}

Project layout

src/trinitas_mcp/
├── server.py           # Entry point & tool/resource registration
├── config.py           # Environment-based settings
├── memory/             # SQLite dialog store
├── registry/           # AI Provider Registry client & routing
├── orchestrator/       # Host-side review execution (LLM calls)
├── tools/              # MCP tools (memory, registry, review)
├── resources/          # MCP resources (conversation, review)
└── prompts/            # Review workflow prompt templates

examples/
├── claude_desktop_config.json
└── host_orchestrator.py   # Runnable review orchestrator demo

Extending

Add new tools by creating a module under tools/ and calling register(mcp) from server.py. Review orchestration and dialog-state prompts can live under prompts/ using @mcp.prompt().

Links

License

MIT

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured