MCP Catalogs
首页

llm-context.py

by cyberchitta·300·综合分 50

智能上下文管理工具,通过规则化定制,使LLM能够通过MCP或剪贴板获取项目相关文件。

developer-toolsai-llmproductivity
22
Forks
3
活跃 Issue
1 个月前
最近提交
2 天前
收录于

概述

LLM Context 是一个基于Python的工具,旨在解决将正确的上下文信息提供给LLM对话的挑战。它通过可组合的规则提供专注、任务特定的项目上下文,支持智能文件选择和过滤。该工具既适用于使用聊天界面的用户,也适用于具有CLI访问权限的AI代理,提供智能代码大纲、上下文验证和MCP集成等功能,使对话过程中能够无缝访问文件。

试试问 AI

装完之后,这里有 5 个你可以让 AI 做的事:

:日常开发工作流,帮助开发者快速与LLM共享相关项目文件
:AI代理为特定子任务创建聚焦的上下文
:使用任务特定规则进行代码审查和文档生成
:llm-context如何选择文件?
:提供了哪些MCP工具?

什么时候选它

当您需要智能的任务特定代码上下文管理,同时兼顾人类友好命令和 AI 代理的 MCP 集成时,选择此工具。

什么时候不要选它

如果您需要读写文件访问权限(这是只读的)或偏好更简单的上下文共享而不使用基于规则的配置,请避免使用。

此 server 暴露的工具

从 README 抽取出 3 个工具
  • lc_outlineslc_outlines(root_path, rule_name)

    Generate excerpted context from a specific rule in the project

  • lc_previewlc_preview(root_path, rule_name)

    Validate a rule's effectiveness by showing which files it would include

  • lc_missinglc_missing(root_path, param_type, data, timestamp)

    Fetch specific files or implementations on demand

可对比工具

npx-contextdevincigit-mcp

安装

# 作为工具安装
uv tool install "llm-context>=0.6.0"

# Claude Desktop的MCP集成
添加到Claude Desktop配置文件(~//Library/Application Support/Claude/claude_desktop_config.json):
```jsonc
{
  "mcpServers": {
    "llm-context": {
      "command": "uvx",
      "args": ["--from", "llm-context", "lc-mcp"]
    }
  }
}

初始化项目:

cd your-project
lc-init

FAQ

llm-context如何选择文件?
它使用YAML+Markdown规则来描述特定任务需要提供的上下文。规则可以根据模式包含/排除文件,定义内容提取策略,并组合多个规则组件。
提供了哪些MCP工具?
lc_outlines - 从当前规则生成摘录上下文,lc_preview - 使用前验证规则有效性,lc_missing - 按需获取特定文件/实现。

llm-context.py 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。