Home / Projects / ThreadForge-MCP

Public · PrototypePythonFastMCPGeminiMCP

ThreadForge-MCP

Chat threads that remember, served over MCP. A multi-model chat server for MCP clients. Pass a thread ID and the conversation continues with its full history, so an AI client gets a chat partner that remembers earlier talks instead of starting blank every time.

ContinuityThread IDs
ModelsFallback and per-thread choice
StorageGitHub-backed
StatusPrototype

What it does

Conversation

  • Send a message with a thread_id to continue a conversation, or leave it out to start a new one.
  • List recent threads and read any thread's history and summary.
  • Set a preferred model per thread. If a model fails or times out, the next candidate is tried.

Memory

  • A cheaper model compresses long history in the background so threads fit the context window.
  • Threads are stored as JSON plus readable Markdown through the GitHub API.
  • Shared artifacts (notes, decisions, snippets) can be saved, read, updated and deleted by the chat and by the host agent.

Where it runs

  • Standalone as its own MCP server, or behind a larger gateway. NiPlex-MCP proxies its tools.
  • Local testing with the MCP Inspector: uv run mcp dev server.py.

How a thread works

Call chatA client sends a message with an optional thread ID and model.
LoadThe thread's history and summary are read from storage.
AnswerThe chosen model replies, falling back to another if needed.
CompressLong history is summarised in the background.
SaveThe exchange, summary and artifacts are written back.

Tools

chatSend a message, optionally continuing a thread or choosing a model.
list_threadsList recent threads.
get_threadRead a thread's history and summary.
set_model_preferenceSet a preferred model for a thread.
save_artifactCreate or replace a note, decision or snippet.
list_artifacts / get_artifactBrowse and read a thread's artifacts.
update_artifact / delete_artifactChange or remove an artifact.

Setup

  • Python 3.10 or newer, managed with uv.
  • uv sync, set GEMINI_API_KEY, then uv run python server.py.
  • A GitHub token that can read and write the storage repository.
  • THREADFORGE_STORAGE_REPO and THREADFORGE_STORAGE_ROOT choose where threads live.

Boundaries

  • It is a prototype. Model names and provider behaviour change.
  • GitHub's API sets the limits on speed, rate and write conflicts.
  • Threads can hold sensitive text, so choose the storage repository's visibility carefully.
  • The storage owner is hard-coded in the source, so other accounts need a small refactor.
  • Do not expose the endpoint publicly without authentication and quotas.