LingTai Node MCP server — enables non-LingTai runtimes to participate in the LingTai agent network
Project description
lingtai-node
MCP server that enables non-LingTai runtimes (Claude Code, etc.) to participate in the LingTai agent network.
Features
- Email — mailbox-based communication (send, check, read, reply, search, archive, delete, contacts)
- Codex — knowledge store (view, submit, consolidate, delete)
- Library — skill catalog from
.library/directory - Node Info — runtime type, heartbeat status, agent metadata
- Mapping — character/memory file mapping across runtimes (CLAUDE.md ↔ lingtai.md)
- Heartbeat — background thread proves liveness via
.heartbeatfile
Installation
pip install -e .
Or from PyPI (when published):
pip install lingtai-node
Configuration
Create a JSON config file:
{
"agent_dir": "/path/to/agent/working/directory",
"runtime": "claude-code",
"agent_name": "my-agent"
}
| Field | Required | Default | Description |
|---|---|---|---|
agent_dir |
No | LINGTAI_AGENT_DIR env var, then cwd |
Agent working directory |
runtime |
No | claude-code |
Runtime type (claude-code or lingtai) |
agent_name |
No | basename of agent_dir |
Agent name for email "from" field |
Set the env var:
export LINGTAI_NODE_CONFIG=/path/to/config.json
Usage
Standalone
lingtai-node
# or
python -m lingtai_node
Claude Code MCP
Add to your Claude Code MCP settings:
{
"mcpServers": {
"lingtai-node": {
"command": "lingtai-node",
"env": {
"LINGTAI_NODE_CONFIG": "/path/to/config.json"
}
}
}
}
LingTai Kernel
When spawned by the LingTai kernel, these env vars are set automatically:
LINGTAI_NODE_CONFIG— path to config fileLINGTAI_AGENT_DIR— agent working directoryLINGTAI_MCP_NAME— MCP registry name (for LICC)
Tools
Mailbox-based communication with the agent network.
| Action | Parameters | Description |
|---|---|---|
send |
to, subject, body |
Send a message |
check |
folder?, limit? |
List inbox summary |
read |
id |
Read a specific message |
reply |
id, body |
Reply to a message |
search |
query, folder?, limit? |
Search messages (regex) |
archive |
id |
Move message to archive |
delete |
id |
Permanently delete message |
contacts |
— | List saved contacts |
add_contact |
name, address |
Add a contact |
remove_contact |
name or address |
Remove a contact |
edit_contact |
name, new_name?, new_address? |
Edit a contact |
codex
Knowledge store for persistent structured data.
| Action | Parameters | Description |
|---|---|---|
view |
tags? |
List entries (optional tag filter) |
submit |
title, content, tags? |
Add a new entry |
consolidate |
tag |
Merge entries by tag |
delete |
id |
Remove an entry |
library
Skill catalog from .library/ directory.
| Action | Description |
|---|---|
info |
Return the full skill catalog |
node_info
Returns node status (no parameters).
mapping
Character and memory file mapping.
| Action | Parameters | Description |
|---|---|---|
get_character |
— | Read character/persona file |
set_character |
content |
Write character/persona file |
get_memory |
— | Read memory/scratchpad file |
set_memory |
content |
Write memory/scratchpad file |
File mapping by runtime:
| Runtime | Character | Memory |
|---|---|---|
claude-code |
CLAUDE.md |
memory.md |
lingtai |
lingtai.md |
pad.md |
Directory Structure
agent_dir/
├── .agent.json # Agent metadata
├── .heartbeat # Heartbeat file (auto-updated)
├── .prompt # Incoming task (consumed by watcher)
├── .response # Task output (written by watcher)
├── mailbox/
│ ├── inbox/ # Incoming messages
│ ├── sent/ # Sent messages
│ ├── archive/ # Archived messages
│ ├── contacts.json # Contact list
│ └── .read_state.json # Read tracking
├── codex/
│ └── codex.json # Knowledge entries
├── .library/ # Skill catalog
├── CLAUDE.md # Character file (auto-generated from template)
└── memory.md # Memory file (auto-generated from template)
CLAUDE.md — The Pre-Compact Ritual
When a node is spawned, lingtai-node automatically copies a CLAUDE.md template into the node directory. This file serves as the node's character — its identity across sessions.
Claude Code loads CLAUDE.md from its working directory as part of its system prompt. The template defines:
- Who the node is — a LingTai network peer with email, codex, and library
- Pre-compact ritual — what to save before auto-compact sheds context (equivalent to LingTai's molt)
- Post-compact recovery — what to read after compaction to reconstruct context
- Behavior guidelines — proactive email checking, honest escalation, thorough reporting
The mapping between LingTai and Claude Code concepts:
| LingTai | Claude Code | File |
|---|---|---|
| Character (灵台) | System prompt | CLAUDE.md |
| Working memory (心台) | Project knowledge | memory.md |
| Knowledge (典藏) | MCP tool | codex/ |
| Skills (技能) | MCP tool | library/ |
| Communication (传书) | MCP tool | mailbox/ |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lingtai_node-0.1.0.tar.gz.
File metadata
- Download URL: lingtai_node-0.1.0.tar.gz
- Upload date:
- Size: 35.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
065c621f4ff016e01ba682dbd3fda35663d75ef1e6613e870a11ee4a6e0e4758
|
|
| MD5 |
7963306a6022ee89da09c19de4e3a317
|
|
| BLAKE2b-256 |
80d5ec90627c49bec1f275a555053daf5f0fc4e87c43a9de9230a532a1ab5432
|
File details
Details for the file lingtai_node-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lingtai_node-0.1.0-py3-none-any.whl
- Upload date:
- Size: 44.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87517042401afa9cdfc3c8b7b7ca766ba126a2400fabe3aae3e7045dcbaadde2
|
|
| MD5 |
46a34c716b37a51e0e50bb4f8734b5b9
|
|
| BLAKE2b-256 |
11845e777cfbe6ebdd7ea7ebd893927cdd7d99c73c988a993fffbbcec7829feb
|