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
Metadata
Release files for lingtai-node 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lingtai_node-0.1.0.tar.gz | 35.0 kB | Without provenance | Details for lingtai_node-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lingtai_node-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for lingtai_node-0.1.0-py3-none-any.whl |
Total release size: 79.6 kB
Release files / lingtai_node-0.1.0.tar.gz
| Download URL | lingtai_node-0.1.0.tar.gz |
|---|---|
| Size | 35.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
065c621f4ff016e01ba682dbd3fda35663d75ef1e6613e870a11ee4a6e0e4758
|
|
BLAKE2b-256 checksum How to use checksums |
80d5ec90627c49bec1f275a555053daf5f0fc4e87c43a9de9230a532a1ab5432
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Release files / lingtai_node-0.1.0-py3-none-any.whl
| Download URL | lingtai_node-0.1.0-py3-none-any.whl |
|---|---|
| Size | 44.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87517042401afa9cdfc3c8b7b7ca766ba126a2400fabe3aae3e7045dcbaadde2
|
|
BLAKE2b-256 checksum How to use checksums |
11845e777cfbe6ebdd7ea7ebd893927cdd7d99c73c988a993fffbbcec7829feb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.7
|
Security for lingtai-node 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.