# llm-context.py

> MCP Server

LLM Context helps developers inject relevant code/text content into LLM chats. It uses `.gitignore` patterns for file selection and offers clipboard workflow and direct LLM integration via the Model Context Protocol.

## Overview

- **Category:** Developer Tools
- **Language:** Python
- **Stars:** 306
- **Forks:** 12
- **Owner:** cyberchitta
- **GitHub:** https://github.com/cyberchitta/llm-context.py
- **Homepage:** https://www.cyberchitta.cc/articles/llm-ctx-why.html
- **Created:** 2024-04-20T15:51:14+00:00
- **Updated:** 2025-03-28T19:43:46+00:00
- **Source:** https://model-context-protocol.com/servers/llm-code-sharing-model-context-protocol

## Setup

## Setup

1.  Install LLM Context using [uv](https://github.com/astral-sh/uv): `uv tool install llm-context`
2.  To upgrade to the latest version: `uv tool upgrade llm-context`
3.  For MCP with Claude Desktop, add the provided configuration to 'claude_desktop_config.json'.
4.  For CLI Quick Start, navigate to your project's root directory.
5.  Initialize repository: `lc-init` (only needed once).
6.  (Optional) Edit `.llm-context/config.yaml` to customize ignore patterns.
7.  Select files: `lc-sel-files`.
8.  (Optional) Review selected files in `.llm-context/curr_ctx.yaml`.
9.  Generate context: `lc-context` (with optional flags: `-p` for prompt, `-u` for user notes).
10. Use with your preferred interface.
11. When the LLM requests additional files, copy the file list, run `lc-clip-files`, and paste the contents back to the LLM.
12. Existing users **must manually convert** any customizations in `.llm-context/config.toml` files to the new `.llm-context/config.yaml`.

## Tools

## Available Tools

1.  Direct LLM Integration (Native integration with Claude Desktop via MCP protocol).
2.  Chat Interface Support (Works with any LLM chat interface via CLI/clipboard).
3.  Smart file selection (using `.gitignore` patterns).
4.  Multiple profiles (for different use cases).
5.  Smart Code Outlines (Allows LLMs to view the high-level structure of your codebase).
6.  Definition Implementation Extraction (Paste full implementations of specific definitions that are requested by LLMs).
7.  `lc-init` (Initialize project configuration).
8.  `lc-set-profile <n>` (Switch profiles).
9.  `lc-sel-files` (Select files for inclusion).
10. `lc-sel-outlines` (Select files for outline generation).
11. `lc-context [-p] [-u] [-f FILE]` (Generate and copy context).
12. `lc-prompt` (Generate project instructions for LLMs).
13. `lc-clip-files` (Process LLM file requests).
14. `lc-changed` (List files modified since last context generation).
15. `lc-outlines` (Generate outlines for code files).
16. `lc-clip-implementations` (Extract code implementations requested by LLMs).
