Track MCP LogoTrack MCP
Track MCP LogoTrack MCP

The world's largest repository of Model Context Protocol servers. Discover, explore, and submit MCP tools.

Product

  • Categories
  • Top MCP
  • New & Updated
  • Submit MCP

Company

  • About

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2026 TrackMCP. All rights reserved.

Built with ❤️ by Krishna Goyal

    Llm Context.py

    Share code with LLMs via Model Context Protocol or clipboard. Rule-based customization enables easy switching between different tasks (like code review and d...

    281 stars
    Python
    Updated Oct 31, 2025
    claude-desktop
    cli
    coding
    model-context-protocol
    tools

    Table of Contents

    • The Problem
    • The Solution
    • Installation
    • Quick Start
    • Human Workflow (Clipboard)
    • MCP Integration (Recommended)
    • Agent Workflow (CLI)
    • Agent Workflow (MCP)
    • Core Concepts
    • Rules: Task-Specific Context Descriptors
    • Five Rule Categories
    • Rule Composition
    • Essential Commands
    • AI-Assisted Rule Creation
    • Claude Skill (Interactive, Claude Desktop/Code)
    • Instruction Rules (Works Anywhere)
    • Comparison
    • Project Customization
    • Create Base Filters
    • Create Development Rule
    • Deployment Patterns
    • Key Features
    • Common Workflows
    • Daily Development (Human)
    • Focused Task (Human or Agent)
    • Agent Context Provisioning (CLI)
    • Agent Context Provisioning (MCP)
    • Path Format
    • Learn More
    • License

    Table of Contents

    • The Problem
    • The Solution
    • Installation
    • Quick Start
    • Human Workflow (Clipboard)
    • MCP Integration (Recommended)
    • Agent Workflow (CLI)
    • Agent Workflow (MCP)
    • Core Concepts
    • Rules: Task-Specific Context Descriptors
    • Five Rule Categories
    • Rule Composition
    • Essential Commands
    • AI-Assisted Rule Creation
    • Claude Skill (Interactive, Claude Desktop/Code)
    • Instruction Rules (Works Anywhere)
    • Comparison
    • Project Customization
    • Create Base Filters
    • Create Development Rule
    • Deployment Patterns
    • Key Features
    • Common Workflows
    • Daily Development (Human)
    • Focused Task (Human or Agent)
    • Agent Context Provisioning (CLI)
    • Agent Context Provisioning (MCP)
    • Path Format
    • Learn More
    • License

    Documentation

    LLM Context

    License

    PyPI version

    Downloads

    Smart context management for LLM development workflows. Share relevant project files instantly through intelligent selection and rule-based filtering.

    The Problem

    Getting the right context into LLM conversations is friction-heavy:

    • Manually finding and copying relevant files wastes time
    • Too much context hits token limits, too little misses important details
    • AI requests for additional files require manual fetching
    • Hard to track what changed during development sessions

    The Solution

    llm-context provides focused, task-specific project context through composable rules.

    For humans using chat interfaces:

    bash
    lc-select   # Smart file selection
    lc-context  # Copy formatted context to clipboard
    # Paste and work - AI can access additional files via MCP

    For AI agents with CLI access:

    bash
    lc-preview tmp-prm-auth    # Validate rule selects right files
    lc-context tmp-prm-auth    # Get focused context for sub-agent

    For AI agents in chat (MCP tools):

    • lc_outlines - Generate excerpted context from current rule
    • lc_preview - Validate rule effectiveness before use
    • lc_missing - Fetch specific files/implementations on demand

    Note: This project was developed in collaboration with several Claude Sonnets (3.5, 3.6, 3.7, 4.0) and Groks (3, 4), using LLM Context itself to share code during development. All code is heavily human-curated by @restlessronin.

    Installation

    bash
    uv tool install "llm-context>=0.6.0"

    Quick Start

    Human Workflow (Clipboard)

    bash
    # One-time setup
    cd your-project
    lc-init
    
    # Daily usage
    lc-select
    lc-context
    # Paste into your LLM chat

    MCP Integration (Recommended)

    Add to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

    jsonc
    {
      "mcpServers": {
        "llm-context": {
          "command": "uvx",
          "args": ["--from", "llm-context", "lc-mcp"]
        }
      }
    }

    Restart Claude Desktop. Now AI can access additional files during conversations without manual copying.

    Agent Workflow (CLI)

    AI agents with shell access use llm-context to create focused contexts:

    bash
    # Agent explores codebase
    lc-outlines
    
    # Agent creates focused rule for specific task
    # (via Skill or lc-rule-instructions)
    
    # Agent validates rule
    lc-preview tmp-prm-oauth-task
    
    # Agent uses context for sub-task
    lc-context tmp-prm-oauth-task

    Agent Workflow (MCP)

    AI agents in chat environments use MCP tools:

    bash
    # Explore codebase structure
    lc_outlines(root_path, rule_name)
    
    # Validate rule effectiveness  
    lc_preview(root_path, rule_name)
    
    # Fetch specific files/implementations
    lc_missing(root_path, param_type, data, timestamp)

    Core Concepts

    Rules: Task-Specific Context Descriptors

    Rules are YAML+Markdown files that describe what context to provide for a task:

    yaml
    ---
    description: "Debug API authentication"
    compose:
      filters: [lc/flt-no-files]
      excerpters: [lc/exc-base]
    also-include:
      full-files: ["/src/auth/**", "/tests/auth/**"]
    ---
    Focus on authentication system and related tests.

    Five Rule Categories

    • **Prompt Rules (prm-)**: Generate project contexts (e.g., lc/prm-developer)
    • **Filter Rules (flt-)**: Control file inclusion (e.g., lc/flt-base, lc/flt-no-files)
    • **Instruction Rules (ins-)**: Provide guidelines (e.g., lc/ins-developer)
    • **Style Rules (sty-)**: Enforce coding standards (e.g., lc/sty-python)
    • **Excerpt Rules (exc-)**: Configure content extraction (e.g., lc/exc-base)

    Rule Composition

    Build complex rules from simpler ones:

    yaml
    ---
    instructions: [lc/ins-developer, lc/sty-python]
    compose:
      filters: [lc/flt-base, project-filters]
      excerpters: [lc/exc-base]
    ---

    Essential Commands

    CommandPurpose
    lc-initInitialize project configuration
    lc-selectSelect files based on current rule
    lc-contextGenerate and copy context
    lc-context -pInclude prompt instructions
    lc-context -mFormat as separate message
    lc-context -ntNo tools (manual workflow)
    lc-set-rule Switch active rule
    lc-preview Validate rule selection and size
    lc-outlinesGet code structure excerpts
    lc-missingFetch files/implementations (manual MCP)

    AI-Assisted Rule Creation

    Let AI help create focused, task-specific rules. Two approaches depending on your environment:

    Claude Skill (Interactive, Claude Desktop/Code)

    How it works: Global skill guides you through creating rules interactively. Examines your codebase as needed using MCP tools.

    Setup:

    bash
    lc-init  # Installs skill to ~/.claude/skills/
    # Restart Claude Desktop or Claude Code

    Usage:

    bash
    # 1. Share project context
    lc-context  # Any rule - overview included
    
    # 2. Paste into Claude, then ask:
    # "Create a rule for refactoring authentication to JWT"
    # "I need a rule to debug the payment processing"

    Claude will:

    1. Use project overview already in context

    2. Examine specific files via lc-missing as needed

    3. Ask clarifying questions about scope

    4. Generate optimized rule (tmp-prm-.md)

    5. Provide validation instructions

    Skill documentation (progressively disclosed):

    • Skill.md - Quick workflow, decision patterns
    • PATTERNS.md - Common rule patterns
    • SYNTAX.md - Detailed reference
    • EXAMPLES.md - Complete walkthroughs
    • TROUBLESHOOTING.md - Problem solving

    Instruction Rules (Works Anywhere)

    How it works: Load comprehensive rule-creation documentation into context, work with any LLM.

    Usage:

    bash
    # 1. Load framework
    lc-set-rule lc/prm-rule-create
    lc-select
    lc-context -nt
    
    # 2. Paste into any LLM
    # "I need a rule for adding OAuth integration"
    
    # 3. LLM generates focused rule using framework
    
    # 4. Use the new rule
    lc-set-rule tmp-prm-oauth
    lc-select
    lc-context

    Included documentation:

    • lc/ins-rule-intro - Introduction and overview
    • lc/ins-rule-framework - Complete decision framework

    Comparison

    AspectSkillInstruction Rules
    SetupAutomatic with lc-initAlready available
    InteractionInteractive, uses lc-missingStatic documentation
    File examinationAutomatic via MCPManual or via AI
    Best forClaude Desktop/CodeAny LLM, any environment
    UpdatesAutomatic with version upgradesBuilt-in to rules

    Both require sharing project context first. Both produce equivalent results.

    Project Customization

    Create Base Filters

    bash
    cat > .llm-context/rules/flt-repo-base.md  .llm-context/rules/prm-code.md  /tmp/context.md
    # Sub-agent reads context and executes task

    Agent Context Provisioning (MCP)

    python
    # Agent validates rule
    preview = lc_preview(root_path="/path/to/project", rule_name="tmp-prm-task")
    
    # Agent generates context
    context = lc_outlines(root_path="/path/to/project")
    
    # Agent fetches additional files as needed
    files = lc_missing(root_path, "f", "['/proj/src/auth.py']", timestamp)

    Path Format

    All paths use project-relative format with project name prefix:

    code
    /{project-name}/src/module/file.py
    /{project-name}/tests/test_module.py

    This enables multi-project context composition without path conflicts.

    In rules, patterns are project-relative without the prefix:

    yaml
    also-include:
      full-files:
        - "/src/auth/**"      # ✓ Correct
        - "/myproject/src/**" # ✗ Wrong - don't include project name

    Learn More

    • **User Guide** - Complete documentation with examples
    • **Design Philosophy** - Why llm-context exists
    • **Real-world Examples** - Using full context effectively

    License

    Apache License, Version 2.0. See LICENSE for details.

    Similar MCP

    Based on tags & features

    • BI

      Biomcp

      Python·
      327
    • FA

      Fal Mcp Server

      Python·
      8
    • MC

      Mcp Aoai Web Browsing

      Python·
      30
    • MA

      Manim Mcp Server

      Python·
      490

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k
    View All MCP Servers

    Similar MCP

    Based on tags & features

    • BI

      Biomcp

      Python·
      327
    • FA

      Fal Mcp Server

      Python·
      8
    • MC

      Mcp Aoai Web Browsing

      Python·
      30
    • MA

      Manim Mcp Server

      Python·
      490

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k