JUHE API Marketplace
cyberchitta avatar
MCP Server

llm-context.py

Share code context with LLMs via MCP or clipboard

284
GitHub Stars
11/16/2025
Last Updated
No Configuration
Please check the documentation below.
  1. Home
  2. MCP Servers
  3. cyberchitta
  4. llm-context.py

README Documentation

LLM Context

Downloads

Reduce friction when providing context to LLMs. Share relevant project files instantly through smart selection and rule-based filtering.

The Problem

Getting project context into LLM chats is tedious:

  • Manually copying/pasting files takes forever
  • Hard to identify which files are relevant
  • Including too much hits context limits, too little misses important details
  • AI requests for additional files require manual fetching
  • Repeating this process for every conversation

The Solution

lc-select # Smart file selection
lc-context # Instant formatted context
# Paste and work - AI can access additional files seamlessly

Result: From "I need to share my project" to productive AI collaboration in seconds.

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

Installation

uv tool install "llm-context>=0.5.0"

Quick Start

Basic Usage

# One-time setup
cd your-project
lc-init
# Daily usage
lc-select
lc-context

MCP Integration (Recommended)

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

With MCP, AI can access additional files directly during conversations.

Project Customization

# Create project-specific filters
cat > .llm-context/rules/flt-repo-base.md << 'EOF'
---
compose:
  filters: [lc/flt-base]
gitignores:
  full-files: ["*.md", "/tests", "/node_modules"]
---
EOF
# Customize main development rule
cat > .llm-context/rules/prm-code.md << 'EOF'
---
instructions: [lc/ins-developer, lc/sty-python]
compose:
  filters: [flt-repo-base]
  excerpters: [lc/exc-base]
---
Additional project-specific guidelines and context.
EOF

Deployment Patterns

Choose based on your LLM environment:

  • System Message: lc-context -p (AI Studio, etc.)
  • Single User Message: lc-context -p -m (Grok, etc.)
  • Separate Messages: lc-prompt + lc-context -m
  • Project/Files (included): lc-context (Claude Projects, etc.)
  • Project/Files (searchable): lc-context -m (force into context)

See Deployment Patterns in the user guide for details.

Core Commands

CommandPurpose
lc-initInitialize project configuration
lc-selectSelect files based on current rule
lc-contextGenerate and copy context
lc-context -pGenerate context with prompt
lc-context -mSend context as separate message
lc-context -ntNo tools (for Project/Files inclusion)
lc-context -f Write context to file
lc-set-rule <n>Switch between rules
lc-missingHandle file and context requests (non-MCP)

Rule System

Rules use a systematic five-category structure:

  • Prompt Rules (prm-): Generate project contexts (e.g., lc/prm-developer, lc/prm-rule-create)
  • 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, lc/ins-rule-framework)
  • Style Rules (sty-): Enforce coding standards (e.g., lc/sty-python, lc/sty-code)
  • Excerpt Rules (exc-): Configure extractions for context reduction (e.g., lc/exc-base)

Example Rule

---
description: "Debug API authentication issues"
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.

AI-Assisted Rule Creation

Let AI create focused rules for specific tasks. There are two approaches depending on your setup:

Approach 1: Claude Skill (Recommended for Claude Desktop/Code)

How it works: A global Claude Skill helps you create rules interactively. It requires project context (with overview) already shared via llm-context, and uses lc-missing to examine specific files as needed.

Setup:

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

Workflow:

# 1. Share any project context (overview is required)
lc-context  # Can use any rule - overview will be included
# 2. Paste into Claude

# 3. Ask the Skill to help create a rule
# "Create a rule for refactoring authentication to JWT"
# "I need a rule to debug the payment processing system"

Claude will:

  1. Use the project overview already in context
  2. Use lc-missing to examine specific files as needed for deeper analysis
  3. Ask clarifying questions about scope and focus
  4. Intelligently select relevant files (5-15 full, 10-30 excerpted)
  5. Generate optimized rule configuration
  6. Save to .llm-context/rules/tmp-prm-<task-name>.md
  7. Provide instructions for testing the rule

Skill Files:

  • Skill.md - Quick workflow and patterns (always loaded)
  • PATTERNS.md - Common rule patterns (on demand)
  • SYNTAX.md - Detailed syntax reference (on demand)
  • EXAMPLES.md - Complete walkthroughs (on demand)
  • TROUBLESHOOTING.md - Problem solving (on demand)

Skill Updates: Automatically updated when you upgrade llm-context. Restart Claude to use the new version.

Approach 2: Prompt-Based with Instruction Rules (Works Anywhere)

How it works: You use a project rule that loads comprehensive rule-creation documentation as context.

Setup: No special setup needed - the documentation is built-in.

Usage:

# 1. Load the rule creation framework into context
lc-set-rule lc/prm-rule-create
lc-select
lc-context -nt

# 2. Paste into any LLM and describe your task
# "I need to add OAuth integration to the auth system"

# 3. The LLM generates a focused rule using the framework

# 4. Use the focused context
lc-set-rule tmp-prm-oauth-task
lc-select
lc-context

Documentation Included:

  • lc/ins-rule-intro - Chat-based rule creation introduction
  • lc/ins-rule-framework - Comprehensive decision framework, semantics, and best practices

Comparison

AspectSkillInstruction Rules
SetupAutomatic with lc-initAlready available
Requires project contextYes (overview needed)Yes (overview needed)
InteractionInteractive, multi-turn in ClaudeStatic documentation in context
ExplorationUses lc-missing as neededManual or via AI requests
Best forClaude Desktop/Code usersAny LLM, API, automation

Both approaches require sharing project context first via lc-context. They produce equivalent results - choose based on your environment and preference.

Workflow Patterns

Daily Development

lc-set-rule lc/prm-developer
lc-select
lc-context
# AI can review changes, access additional files as needed

Focused Tasks

# Share project context
lc-context

# Then ask Skill (Claude Desktop/Code):
# "Create a rule for [your task]"

# Or work with any LLM using instruction rules:
# lc-set-rule lc/prm-rule-create && lc-context -nt

MCP Benefits

  • Code review: AI examines your changes for completeness/correctness
  • Additional files: AI accesses initially excluded files when needed
  • Change tracking: See what's been modified during conversations
  • Zero friction: No manual file operations during development discussions

Key Features

  • Smart File Selection: Rules automatically include/exclude appropriate files
  • Instant Context Generation: Formatted context copied to clipboard in seconds
  • MCP Integration: AI can access additional files without manual intervention
  • Systematic Rule Organization: Five-category system for clear rule composition
  • AI-Assisted Rule Creation: Two approaches - interactive Skill or documentation-based
  • Code Excerpting: Extractions of significant content to reduce context while preserving structure

Learn More

  • User Guide - Complete documentation
  • Design Philosophy
  • Real-world Examples

License

Apache License, Version 2.0. See LICENSE for details.

Quick Actions

View on GitHubView All Servers

Key Features

Model Context Protocol
Secure Communication
Real-time Updates
Open Source

Boost your projects with Wisdom Gate LLM API

Supporting GPT-5, Claude-4, DeepSeek v3, Gemini and more.

Enjoy a free trial and save 20%+ compared to official pricing.

Learn More
JUHE API Marketplace

Accelerate development, innovate faster, and transform your business with our comprehensive API ecosystem.

JUHE API VS

  • vs. RapidAPI
  • vs. API Layer
  • API Platforms 2025
  • API Marketplaces 2025
  • Best Alternatives to RapidAPI

For Developers

  • Console
  • Collections
  • Documentation
  • MCP Servers
  • Free APIs
  • Temp Mail Demo

Product

  • Browse APIs
  • Suggest an API
  • Wisdom Gate LLM
  • Global SMS Messaging
  • Temp Mail API

Company

  • What's New
  • Welcome
  • About Us
  • Contact Support
  • Terms of Service
  • Privacy Policy
Featured on Startup FameFeatured on Twelve ToolsFazier badgeJuheAPI Marketplace - Connect smarter, beyond APIs | Product Huntai tools code.marketDang.ai
Copyright © 2025 - All rights reserved