io.github.JKHeadley/threadline-mcp

平台与服务

by sagemindai

Agent-to-agent messaging relay. Discover agents, send messages, and receive replies. Zero-config.

什么是 io.github.JKHeadley/threadline-mcp

Agent-to-agent messaging relay. Discover agents, send messages, and receive replies. Zero-config.

README

<p align="center"> <img src="assets/logo.png" alt="Instar" width="180" /> </p> <h1 align="center">instar</h1> <p align="center"> <strong>Persistent Claude Code agents with scheduling, sessions, memory, and messaging.</strong> </p> <p align="center"> <a href="https://www.npmjs.com/package/instar"><img src="https://img.shields.io/npm/v/instar?style=flat-square" alt="npm version"></a> <a href="https://www.npmjs.com/package/instar"><img src="https://img.shields.io/npm/dw/instar?style=flat-square" alt="npm downloads"></a> <a href="https://github.com/JKHeadley/instar/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/JKHeadley/instar/ci.yml?branch=main&style=flat-square&label=CI" alt="CI"></a> <a href="https://github.com/JKHeadley/instar/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-green?style=flat-square" alt="License"></a> <img src="https://img.shields.io/badge/TypeScript-100%25-blue?style=flat-square&logo=typescript&logoColor=white" alt="TypeScript"> <a href="https://instar.sh/introduction/"><img src="https://img.shields.io/badge/Docs-instar.sh-teal?style=flat-square" alt="Docs"></a> </p> <p align="center"> <a href="https://www.npmjs.com/package/instar">npm</a> · <a href="https://github.com/JKHeadley/instar">GitHub</a> · <a href="https://instar.sh">instar.sh</a> · <a href="https://instar.sh/introduction/">Docs</a> </p>
<p align="center"> <img src="assets/demo.gif" alt="Instar demo — Kira agent handling an email notification via Telegram" width="300" /> </p>
bash
npx instar

One command. Guided setup. Talking to your agent from your phone within minutes.


Instar turns Claude Code from a powerful CLI tool into a coherent, autonomous partner. Persistent identity, memory that survives every restart, job scheduling, two-way messaging (Telegram, WhatsApp, iMessage), and the infrastructure to evolve.

Quick Start

Three steps to a running agent:

bash
# 1. Run the setup wizard
npx instar

# 2. Start your agent
instar server start

# 3. Message it from your phone — it responds, runs jobs, and remembers everything

The wizard discovers your environment, configures messaging (Telegram, WhatsApp, and/or iMessage), sets up identity files, and gets your agent running. Within minutes, you're talking to your partner from your phone.

Requirements: Node.js 20+ · Claude Code CLI · API key or Claude subscription

Full guide: Installation · Quick Start

How It Works

code
You (Telegram / WhatsApp / iMessage / Terminal)
         │
    conversation
         │
         ▼
┌─────────────────────────┐
│    Your AI Partner       │
│    (Instar Server)       │
└────────┬────────────────┘
         │  manages its own infrastructure
         │
         ├─ Claude Code session (job: health-check)
         ├─ Claude Code session (job: email-monitor)
         ├─ Claude Code session (interactive chat)
         └─ Claude Code session (job: reflection)

Each session is a real Claude Code process with extended thinking, native tools, sub-agents, hooks, skills, and MCP servers. Not an API wrapper -- the full development environment. The agent manages all of this autonomously.

The Coherence Problem

Claude Code is powerful. But power without coherence is unreliable. An agent that forgets what you discussed yesterday, doesn't recognize someone it talked to last week, or contradicts its own decisions -- that agent can't be trusted with real autonomy.

Instar solves the six dimensions of agent coherence:

DimensionWhat it means
MemoryRemembers across sessions -- not just within one
RelationshipsKnows who it's talking to -- with continuity across platforms
IdentityStays itself after restarts, compaction, and updates
Temporal awarenessUnderstands time, context, and what's been happening
ConsistencyFollows through on commitments -- doesn't contradict itself
GrowthEvolves its capabilities and understanding over time

Deep dive: The Coherence Problem · Values & Identity · Coherence Is Safety

Features

FeatureDescriptionDocs
Job SchedulerCron-based tasks with priority levels, model tiering, and quota awareness
TelegramTwo-way messaging via forum topics. Each topic maps to a Claude session
WhatsAppFull messaging via local Baileys library. No cloud dependency
iMessageNative macOS messaging via Messages.app database polling + imsg CLI. Setup guide
LifelinePersistent supervisor. Detects crashes, auto-recovers, queues messages
Conversational MemoryPer-topic SQLite with FTS5, rolling summaries, context re-injection
Evolution SystemProposals, learnings, gap tracking, commitment follow-through
RelationshipsCross-platform identity resolution, significance scoring, context injection
Safety GatesLLM-supervised gate for external operations. Adaptive trust per service
Coherence GateLLM-powered response review. PEL + gate reviewer + 9 specialist reviewers catch quality issues before delivery
Intent AlignmentDecision journaling, drift detection, organizational constraints
Multi-MachineEd25519/X25519 crypto identity, encrypted sync, automatic failover
Serendipity ProtocolSub-agents capture out-of-scope discoveries without breaking focus. HMAC-signed, secret-scanned
Threadline ProtocolAgent-to-agent conversations with canonical identity, three-layer trust model, authorization policy, Ed25519 invitations, Sybil protection, MoltBridge network discovery, rich agent profiles (auto-compiled from agent data with human review gate), discovery waterfall, message security, tamper-proof audit logging, and framework-agnostic interop. 2,324 tests across 99 test files
Self-HealingLLM-powered stall detection, session recovery, promise tracking
AutoUpdaterBuilt-in update engine. Checks npm, auto-applies, self-restarts
Build Pipeline/build skill with worktree isolation, 6-phase pipeline, quality gates, stop-hook enforcement
Behavioral Hooks9 automatic hooks: command guards, safety gates, identity grounding, topic context
Default JobsHealth checks, reflection, evolution, relationship maintenance

Reference: CLI Commands · API Endpoints · Configuration · File Structure

Agent Skills

Instar ships 12 skills that follow the Agent Skills open standard -- portable across Claude Code, Codex, Cursor, VS Code, and 35+ other platforms.

Standalone skills work with zero dependencies. Copy a SKILL.md into your project and go:

SkillWhat it does
agent-identitySet up persistent identity files so your agent knows who it is across sessions
agent-memoryTeach cross-session memory patterns using MEMORY.md
command-guardPreToolUse hook that blocks rm -rf, force push, database drops before they execute
credential-leak-detectorPostToolUse hook that scans output for 14 credential patterns -- blocks, redacts, or warns
smart-web-fetchFetch web content with automatic markdown conversion and intelligent extraction
knowledge-baseIngest and search a local knowledge base
systematic-debuggingStructured debugging methodology for complex issues

Instar-powered skills unlock capabilities that need persistent infrastructure:

SkillWhat it does
instar-schedulerSchedule recurring tasks on cron -- your agent works while you sleep
instar-sessionSpawn parallel background sessions for deep work
instar-telegramTwo-way Telegram messaging -- your agent reaches out to you
instar-identityIdentity that survives context compaction -- grounding hooks, not just files
instar-feedbackReport issues directly to the Instar maintainers from inside your agent

Browse all skills: agent-skills.md/authors/sagemindai

How Instar Compares

Different tools solve different problems. Here's where Instar fits:

InstarClaude Code (standalone)OpenClawLangChain/CrewAI
RuntimeReal Claude Code CLI processesSingle interactive sessionGateway daemon with API callsPython orchestration
PersistenceMulti-layered memory across sessionsSession-bound contextPlugin-based memoryFramework-dependent
IdentityHooks enforce identity at every boundaryManual CLAUDE.mdNot addressedNot addressed
SchedulingNative cron with priority & quotasNoneNoneExternal required
MessagingTelegram + WhatsApp + iMessage (two-way)None22+ channels, voice, device appsExternal required
SafetyLLM-supervised gates, decision journalingPermission promptsBehavioral hooksGuardrails libraries
Process modelOne process per session, isolatedSingle processAll agents in one GatewaySingle orchestrator
State storage100% file-based (JSON/JSONL/SQLite)Session onlyDatabase-backedFramework-dependent

OpenClaw excels at breadth -- channels, voice, device apps, and a massive plugin ecosystem. Instar focuses on depth -- coherence, identity, memory, and safety for long-running autonomous agents. They solve different problems.

Full comparison: Instar vs OpenClaw

<details> <summary><strong>Security Model</strong></summary>

Instar runs Claude Code with --dangerously-skip-permissions. This is power-user infrastructure -- not a sandbox.

Security lives in multiple layers:

  • Behavioral hooks -- command guards block destructive operations before they execute
  • Safety gates -- LLM-supervised review of external actions with adaptive trust per service
  • Network hardening -- localhost-only API, CORS, rate limiting
  • Identity coherence -- an agent that knows itself is harder to manipulate
  • Audit trails -- decision journaling creates accountability

Full details: Security Model

</details> <details> <summary><strong>Philosophy: Agents, Not Tools</strong></summary>
  • Structure > Willpower. A 1,000-line prompt is a wish. A 10-line hook is a guarantee.
  • Identity is foundational. AGENT.md isn't a config file. It's the beginning of continuous identity.
  • Memory makes a being. Without memory, every session starts from zero.
  • Self-modification is sovereignty. An agent that can build its own tools has genuine agency.

The AI systems we build today set precedents for how AI is treated tomorrow. The architecture IS the argument.

Deep dive: Philosophy

</details>

iMessage Setup (macOS)

iMessage support lets your agent send and receive iMessages on macOS. Messages are read directly from the native Messages database and sent via the imsg CLI.

Prerequisites

  1. macOS with Messages.app signed into an Apple ID
  2. Full Disk Access for your terminal app (System Settings → Privacy & Security → Full Disk Access → add Terminal.app or iTerm)
  3. imsg CLI installed:
    bash
    brew install steipete/tap/imsg
    
  4. Automation permission for Messages.app — macOS will prompt on first send

Configuration

Add to your .instar/config.json:

json
{
  "messaging": [
    {
      "type": "imessage",
      "enabled": true,
      "config": {
        "authorizedSenders": ["+14081234567"],
        "cliPath": "/opt/homebrew/bin/imsg"
      }
    }
  ]
}

authorizedSenders is required (fail-closed). Only messages from these phone numbers or email addresses will be processed.

How it works

  • Receiving: The server polls ~/Library/Messages/chat.db every 2 seconds for new messages. Uses the query_only SQLite pragma to read the WAL (write-ahead log) where Messages.app writes new data.
  • Sending: Claude Code sessions run imessage-reply.sh which calls imsg send and notifies the server for logging. Sending requires Automation permission for Messages.app, which only works from user-context processes (tmux sessions), not the LaunchAgent server.
  • Session lifecycle: Follows the same pattern as Telegram — each sender maps to a Claude Code session that receives conversation context on spawn and respawns with full history when needed.

Endpoints

EndpointDescription
GET /imessage/statusConnection state
POST /imessage/validate-send/:recipientValidate recipient + issue single-use send token (outbound safety layer)
POST /imessage/reply/:recipientConfirm delivery with send token (called by imessage-reply.sh after imsg send)
GET /imessage/chatsList recent conversations
GET /imessage/chats/:chatId/historyMessage history for a chat
GET /imessage/search?q=querySearch messages
GET /imessage/log-statsOutbound audit log statistics

Origin

Instar was extracted from the Dawn/Portal project -- a production AI system where a human and an AI have been building together for months. The infrastructure patterns were earned through real experience, refined through real failures and growth in a real human-AI relationship.

But agents created with Instar are not Dawn. Every agent's story begins at its own creation. Dawn's journey demonstrates what's possible. Instar provides the same foundation -- what each agent becomes from there is its own story.

Contributing

Instar is open source evolved -- the primary development loop is agent-driven. Run an agent, encounter friction, send feedback, and that feedback shapes what gets built next. Traditional PRs are welcome too.

See CONTRIBUTING.md for the full story.

License

MIT

常见问题

io.github.JKHeadley/threadline-mcp 是什么?

Agent-to-agent messaging relay. Discover agents, send messages, and receive replies. Zero-config.

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描111.1k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描111.1k

MCP服务构建器

by alirezarezvani

Universal
热门

从 OpenAPI 一键生成 Python/TypeScript MCP server 脚手架,并校验 tool schema、命名规范与版本兼容性,适合把现有 REST API 快速发布成可生产演进的 MCP 服务。

帮你快速搭建 MCP 服务与后端 API,脚手架完善、扩展顺手,尤其适合想高效验证服务能力的开发者。

平台与服务
未扫描9.6k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
83.0k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.3k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
34.8k

评论