Model Context Protocol (MCP) is an open protocol that standardizes how LLMs interact with external tools and data sources. It's like a USB port for AI - a universal way for LLMs to connect to your tools.
Text Loom + MCP enables:
✅ LLMs as workflow designers - Claude/GPT can create workflows for you ✅ Natural language to graphs - "Summarize these files" → complete workflow ✅ Automated template creation - LLM builds reusable workflow templates ✅ Interactive debugging - LLM helps fix workflow issues ✅ Batch automation - LLM creates workflows you can run repeatedly
pip install -r requirements.txtThis installs the mcp>=0.9.0 package.
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"text-loom": {
"command": "/absolute/path/to/Text_Loom/mcp_server"
}
}
}Important: Use absolute path, not ~ or relative paths.
The MCP server will auto-start when Claude needs it.
In Claude Desktop, ask:
"Using Text Loom, create a workflow that reads article.txt, summarizes it with Claude, and saves to summary.txt"
Claude will:
- Create isolated session
- Add nodes (file_in, query, file_out)
- Connect them
- Execute the workflow
- Give you the exported JSON to save
┌─────────────┐
│ Claude │ ← User: "Create a summarization workflow"
│ Desktop │
└──────┬──────┘
│ MCP Protocol
↓
┌─────────────┐
│ Text Loom │ ← Tools: create_session, add_node, connect_nodes, etc.
│ MCP Server │
└──────┬──────┘
│ Python API
↓
┌─────────────┐
│ Text Loom │ ← Nodes, connections, execution
│ Core │
└─────────────┘
The MCP server exposes 9 tools to LLMs:
| Tool | Purpose |
|---|---|
create_session |
Start isolated workspace |
list_node_types |
See available node types |
add_node |
Create nodes in workflow |
connect_nodes |
Wire nodes together |
execute_workflow |
Run the workflow |
get_node_output |
Read results |
export_workflow |
Get JSON for saving |
set_global |
Set global variables |
delete_session |
Clean up |
See mcp_server.md for complete reference.
Before MCP:
- Open GUI
- Manually drag nodes
- Configure each one
- Wire connections
- Test and debug
With MCP:
- Ask Claude: "Create a workflow that processes these 10 files"
- Get working workflow in seconds
- Open in GUI to refine
Ask Claude to create templates:
- "Email extraction and categorization"
- "Multi-step research pipeline"
- "Batch image description generation"
Save exports, reuse forever.
New users: Ask Claude to build workflows while explaining each step.
Example:
"Show me how to use the looper node to process a list"
Claude creates working example + explanation.
When stuck, ask Claude to analyze your workflow:
"Here's my workflow JSON. Why isn't the query node working?"
Claude can inspect, diagnose, suggest fixes.
Use MCP server in Python scripts:
from mcp.client import Client
async with Client("text-loom") as client:
# Programmatic workflow creation
session = await client.create_session()
# ... build workflow
result = await client.execute_workflow(session["session_id"])- LLM builds initial workflow - Fast, automated
- Human reviews/modifies - Visual editing in GUI/TUI
- Batch execution - Reliable, repeatable
This combines:
- Speed of LLM generation
- Precision of visual editing
- Power of batch automation
Each LLM operation uses isolated session:
- No interference between workflows
- Safe concurrent operations
- Clean state management
Every LLM-created workflow is exportable:
- User owns the JSON
- Can version control it
- Can share with others
- Can modify offline
src/tloom_mcp/
├── __init__.py # Package init
├── server.py # MCP server (9 tools)
├── session_manager.py # Workspace isolation
└── workflow_builder.py # High-level workflow API
# Each session has:
{
"session_id": "uuid",
"created_at": "timestamp",
"workspace_file": "/tmp/text_loom_sessions/uuid.json",
"metadata": {"user": "alice", "purpose": "..."}
}Sessions are:
- Automatically persisted
- Isolated from each other
- Exportable as flowstate JSON
- Cleanable with
delete_session
High-level API wrapping Text Loom core:
builder = WorkflowBuilder()
# Add nodes
builder.add_node("text", "my_text", parameters={"text_string": "Hello"})
builder.add_node("query", "llm", parameters={"prompt": "Summarize:"})
# Connect
builder.connect("my_text", "llm")
# Execute
results = builder.execute_all()
# Get output
output = builder.get_output("llm")Simpler than direct core API, perfect for LLM agents.
~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"text-loom": {
"command": "/Users/alice/Text_Loom/mcp_server"
}
}
}%APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"text-loom": {
"command": "C:\\Users\\Alice\\Text_Loom\\mcp_server"
}
}
}~/.config/Claude/claude_desktop_config.json:
{
"mcpServers": {
"text-loom": {
"command": "/home/alice/Text_Loom/mcp_server"
}
}
}If using venv:
{
"mcpServers": {
"text-loom": {
"command": "/path/to/Text_Loom/.venv/bin/python",
"args": ["/path/to/Text_Loom/mcp_server"]
}
}
}Check:
- Is
mcp_serverexecutable?chmod +x mcp_server - Is path absolute in config?
- Can Python find modules? Check PYTHONPATH in script
Test manually:
cd Text_Loom
./mcp_server
# Should wait for input (MCP protocol)Check:
- Restarted Claude Desktop after config change?
- JSON syntax valid? Use
jsonlintor similar - Check Claude logs (Help > View Logs)
Check:
- Dependencies installed?
pip install -r requirements.txt - In correct directory?
pwdshould show Text_Loom - Python path correct?
echo $PYTHONPATH
Check:
- LLM API keys configured? (for query nodes)
- File paths accessible?
- Node parameters correct?
Debug: Ask Claude to export workflow, inspect JSON manually.
MCP server runs with your user permissions. LLMs can:
- ✅ Read/write files you can access
- ❌ No privilege escalation
- ❌ No network access (unless via LLM API calls in query nodes)
- Review workflows before executing
- Check file paths in exported JSON
- Use specific paths rather than wildcards
- Limit LLM scope via session metadata
- Clean up sessions when done
Each session is isolated:
- Separate workspace
- No cross-session access
- Temporary files cleaned up
Typical operations:
- Create session: <10ms
- Add node: <5ms
- Connect nodes: <1ms
- Execute simple workflow: <100ms
- Export workflow: <50ms
- Sessions are lightweight (just JSON state)
- Concurrent sessions supported
- No database required
- Memory scales with node count per session
See example_usage.md for detailed examples.
- Install:
pip install -r requirements.txt - Configure: Add to Claude Desktop config
- Try: Ask Claude to create a simple workflow
- Learn: Review exported JSON in GUI
- Iterate: Build templates, automate workflows
- MCP Server Docs: mcp_server.md
- API Reference: api/
- Examples: examples/mcp_workflows/
- MCP Specification: https://modelcontextprotocol.io
Found a bug? Want a new tool? Open an issue: https://github.com/kleer001/Text_Loom/issues
Ready to supercharge Text Loom with LLM automation? Install the MCP server and let Claude build workflows for you!