SD

smat-dev/jinni

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

272 stars 19 forks 质量 80 趋势 18Apache-2.0

smat-dev/jinni 是一个从 https://github.com/smat-dev/jinni. 导入的 MCP 服务器候选人。

概览

smat-dev/jinni 是一个从 https://github.com/smat-dev/jinni. 导入的 MCP 服务器候选人。

概述(AI 翻译)

Jinni 是一款高效为大型语言模型提供项目上下文的工具。它为相关项目文件提供了整合视图,克服了逐个读取文件的限制和低效。每个文件内容前都有一个简单的头部,指示其路径:

路径=src/app.py print(“你好”)

JSON { “mcpServers”: { “精灵”:{ “命令”: “UVX”, “ARGS”: [“精灵服务器”] } } }

path=src/app.py)。可以用list_only禁用。

  • 编码处理: 尝试多种常见文本编码(UTF-8、Latin-1 等)。
  • 仅列表模式: 仅列出将包含文件的相对路径,不包含其内容的选项。

用途

MCP 服务器([read_context 工具)

  1. 设置: 配置你的MCP客户端(例如,Claude Desktop的claude_desktop_config.json)通过uvx运行jinni服务器。
  2. 调用: 通过MCP客户端与你的LLM交互时,模型可以调用read_context工具。
  • project_root(字符串,必需): 项目根目录的绝对路径。规则发现和输出路径相对于该根节点。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Jinni: Bring Your Project Into Context

Jinni is a tool to efficiently provide Large Language Models the context of your projects. It gives a consolidated view of relevant project files, overcoming the limitations and inefficiencies of reading files one by one. Each file’s content is preceded by a simple header indicating its path:

```path=src/app.py
print("hello")

The philosophy behind this tool is that LLM context windows are large, models are smart, and directly seeing your project best equips the model to help with anything you throw at it.

There is an MCP (Model Context Protocol) server for integration with AI tools and a command-line utility (CLI) for manual use that copies project context to the clipboard ready to paste wherever you need it.

These tools are opinionated about what counts as relevant project context to best work out of the box in most use cases, automatically excluding:

* Binary files
* Dotfiles and hidden directories
* Common naming conventions for logs, build directories, tempfiles, etc

Inclusions/exclusions are customizable with complete granularity if required using .contextfiles – this works like .gitignore except defining inclusions. .gitignore files themselves are also respected automatically, but any rules in .contextfiles take priority.

The MCP server can provide as much or as little of the project as desired. By default the scope is the whole project, but the model can ask for specific modules / matching patterns / etc.

MCP Quickstart

MCP server config file for Cursor / Roo / Claude Desktop / client of choice:

{
    "mcpServers": {
        "jinni": {
            "command": "uvx",
            "args": ["jinni-server"]
        }
    }
}

You can optionally constrain the server to only read within a tree for security in case your LLM goes rogue: add "--root", "/absolute/path/" to the args list.

Install uv if it is not on your system: https://docs.astral.sh/uv/getting-started/installation/

Reload your IDE and you can now ask the agent to read in context.

If you want to restrict this to particular modules / paths just ask - e.g. “Read context for tests”.

In action with Cursor:

Note For Cursor Users

Cursor can silently drop context that is larger than the allowed maximum, so if you have a sizable project and the agent acts like the tool call never happened, try reducing what you are bringing in (“read context for xyz”)

Components

  1. jinni MCP Server:
    • Integrates with MCP clients like Cursor, Cline, Roo, Claude Desktop, etc.
在 GitHub 查看完整 README

安装

uvx jinni-server
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "jinni": { "command": "uvx", "args": ["jinni-server"] } } }