Skip to content

Repository files navigation

LTP (Lazy Tool Protocol)

Token-free AI tool calling - Access unlimited tools without context overhead

License npm

What is LTP?

LTP allows AI agents to access unlimited MCP tools and Crafts without consuming tokens for tool definitions. Instead of loading tool schemas into context, AI uses simple CLI commands to discover and call tools on-demand.

MCP Tools

Connect to any MCP server and call its tools directly:

Traditional MCP: 300 tools x 200 tokens = 60,000 tokens consumed
LTP: 0 tokens consumed - tools discovered on-demand

Crafts

Crafts are reusable AI workflows - like Anthropic's Skills, but executable:

.ltp/crafts/
  code-review/
    CRAFT.md        # Instructions for AI
    execute.js      # Automation script
    execute.ts      # Automation script
Anthropic Skills LTP Crafts
Static instructions Instructions + Executable scripts
AI reads only AI reads and executes
Single IDE Works in any AI IDE

Token Efficiency

LTP's Lazy Loading Pattern reduces token consumption by 75-90% compared to direct MCP calls.

Method Tokens (12 calls) Cost Reduction
Direct MCP ~45,000 ~$0.25 -
LTP ~7,500 ~$0.07 83%

Efficiency increases with more calls (converges at ~85-90%). See docs/effect.md for detailed analysis.

Installation

npm install -g ltp@latest

Quick Start

# Add an MCP server
ltp add filesystem npx -y @modelcontextprotocol/server-filesystem

# List available tools
ltp list

# Search for tools
ltp search "read file"

# Call a tool
ltp call filesystem read_file --path /src/main.ts

# Get tool details
ltp info filesystem read_file

Commands

Command Description
ltp add <name> <cmd> Add an MCP server
ltp remove <name> Remove an MCP server
ltp servers List configured servers
ltp list List servers with tool counts
ltp list -v List tools with descriptions
ltp list --schema List tools with parameter types
ltp tools <server> List tool names for a server
ltp search <query> Search for tools
ltp info <server> <tool> Get tool details
ltp call <server> <tool> Call a tool
ltp call --file <path> Call with JSON file arguments
ltp shell Interactive shell (persistent sessions)
ltp crafts List available crafts
ltp crafts-open Open crafts folder in explorer
ltp craft <name> [--opts] Execute a craft with options
ltp craft-install <url> Install/update craft from GitHub
ltp craft-remove <name> Remove an installed craft
ltp config open Open config file in editor
ltp config path Show config file path
ltp start Start daemon (fast mode)
ltp stop Stop daemon
ltp restart Restart daemon
ltp status Check daemon status
ltp sponsor Support the project

AI Setup

Copy the contents of rule/AI_GLOBAL_RULES.md to your AI IDE's system prompt:

IDE Location
Antigravity MEMORY[user_global]
Claude Code ~/.claude/CLAUDE.md
Cursor .cursorrules file
Other System prompt settings

This enables your AI agent to automatically discover and use LTP tools.

Configuration

Config file location: ~/.ltp/config.json (Edit with ltp config open)

Transport Types

LTP supports two transport types for connecting to MCP servers:

Transport Description Use Case
stdio Spawns local process (default) Local MCP servers, npx packages
sse Connects via HTTP/SSE Remote MCP servers, cloud APIs

Adding Servers

# stdio transport (default)
ltp add filesystem npx -y @modelcontextprotocol/server-filesystem

# SSE transport
ltp add remote-api --transport sse --url http://localhost:3000/sse

Config Examples

{
  "port": 7878,
  "craftsDir": ".ltp/crafts",
  "servers": {
    "filesystem": {
      "transport": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"],
      "env": {}
    },
    "github": {
      "transport": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
      }
    },
    "remote-api": {
      "transport": "sse",
      "url": "https://api.example.com/mcp/sse"
    }
  }
}

Crafts

Crafts are reusable workflows with instructions and scripts.

Crafts are installed globally to ~/.ltp/crafts/ and shared across all projects.

Installing Crafts

# Install from GitHub repository root
ltp craft-install JuN-B-official/ltp

# Install from a subfolder (using --path option)
ltp craft-install JuN-B-official/ltp --path crafts/code-review

# Short option
ltp craft-install JuN-B-official/ltp -p crafts/code-review

# Remove a craft
ltp craft-remove code-review

Craft Registry

Browse and discover community crafts at ltp.jun-b.com/crafts

You can also register your own crafts through the web interface.

Craft Structure

Open crafts folder with ltp crafts-open

~/.ltp/crafts/
  code-review/
    CRAFT.md        # Instructions
    execute.js      # Script
    execute.ts      # Script

JSON Mode

For AI-friendly output:

ltp --json list
ltp --json call filesystem read_file --path /test.txt

Advanced Options

Recommended AI Workflow

For optimal token efficiency, AI agents should follow this workflow:

# 1. List available servers
ltp list
# Output: appwrite (143 tools), shopify (257 tools), ...

# 2. Get tool names for the needed server
ltp tools appwrite
# Output: list_databases, create_database, get_database, ...

# 3. Get details for the specific tool
ltp info appwrite create_database
# Output: description, input schema, usage example

# 4. Call the tool
ltp call appwrite create_database --databaseId mydb --name "My Database"

Schema Output (For AI)

Alternatively, get all tools with parameter types in one call:

ltp list --schema
# Output:
# filesystem (5 tools)
#   read_file(path: string)
#   write_file(path: string, content: string)
#   ...

File-based Arguments (PowerShell)

For complex JSON arguments that are hard to escape:

# Create a JSON file with arguments
echo '{"path": "/src", "recursive": true}' > args.json

# Call with --file
ltp call filesystem list_directory --file args.json

Security

# Require confirmation for sensitive operations
ltp call --confirm filesystem delete_file --path /important.txt

Support

Love LTP? Consider supporting the project!

Sponsor on GitHub

Authors

The Lazy Tool Protocol was created by JunHyeong Song @Song-JunHyeong.

Contributing

See CONTRIBUTING.md.

License

Copyright 2025 JuN-B (JunHyeong Song)

Licensed under the Apache License, Version 2.0

About

Token-free AI tool calling - Access unlimited tools without context overhead

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages