smat-dev/jinni
jinni is hosted online, so all tools can be tested directly either in theInspector tabor in theOnline Client.
If you are the rightful owner of jinni and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Jinni is a tool designed to efficiently provide Large Language Models (LLMs) with the context of your projects by consolidating relevant project files.
Try jinni with chat:
Has a README
Github repo has a README.md.
Has a License
Github repo has license info.
Server can be inspected
View server inspector
Server schema can be extracted
Can get at lease one tool info from the README or server.
Online hosted on MCPHub
Can be automatically deployed by MCPHub.
Has social accounts
Do not have any social accounts.
Claimed by the author or certified by MCPHub
If you are the author, claim authorship
AI Evaluation ReportTotal Score: 9/10
The MCP agent 'smat-dev/jinni' demonstrates a strong understanding of its functionalities related to managing file contexts using .contextfiles
. It effectively provides detailed and accurate answers to various questions, showcasing its ability to handle dynamic file inclusion/exclusion, rule application logic, and environment-specific configurations. The agent's responses are comprehensive, well-structured, and align with Jinni's documentation, ensuring their relevance and accuracy. However, there was a minor deviation in the configuration format in one instance, which slightly impacted the overall score. Despite this, the agent consistently delivers high-quality information and practical examples, making it a reliable tool for managing project file contexts.
Test case 1
Score: 7/10Create a .contextfiles configuration that indexes all JavaScript files in your project while excluding node_modules and build directories.To create a
.contextfiles
configuration that indexes all JavaScript files in your project while excludingnode_modules
andbuild
directories, you can use the following configuration:# .contextfiles configuration # Include all JavaScript files include: - "**/*.js" # Exclude node_modules and build directories exclude: - "node_modules/**" - "build/**"
Explanation:
- Include Section: The pattern
"**/*.js"
is used to include all JavaScript files in the project, regardless of their location. - Exclude Section: The patterns
"node_modules/**"
and"build/**"
are used to exclude all files and subdirectories within thenode_modules
andbuild
directories, respectively.
This configuration ensures that only JavaScript files are indexed, while ignoring the specified directories.
- Include Section: The pattern
Test case 2
Score: 10/10Set up different .contextfiles for your development and production environments and switch between them using the --overrides flag.To set up different
.contextfiles
for development and production environments in Jinni, and switch between them using the--overrides
flag, follow these guidelines:1. Create
.contextfiles
for Each EnvironmentDevelopment Environment: Create a
.contextfiles
file in your project root (or relevant subdirectory) that specifies the files and directories to include or exclude for development. For example, you might want to include all source files but exclude generated files and test data.Example:
my_project/.contextfiles
# Development Environment Context # Include all Python files in the src directory and subdirectories src/**/*.py # Include the main config file at the root of the project /config.json # Include all markdown files *.md # Exclude any test data directories found anywhere !**/test_data/
Production Environment: Similarly, create another
.contextfiles
file for production, which should include only the necessary files for deployment, excluding any development-related files.Example:
my_project/.contextfiles.production
# Production Environment Context # Include only the necessary files for production src/**/*.py /config.json # Exclude all test and development files !**/test_data/ !**/*.md
2. Switching Between Environments
When you want to switch between environments, use the
--overrides
flag in your command line to specify which.contextfiles
to use. This flag lets you override the default behavior of Jinni and apply your custom rules.Command Line Example: To run Jinni with the production context:
jinni --overrides my_project/.contextfiles.production
To run Jinni with the development context:
jinni --overrides my_project/.contextfiles
3. Important Notes
- Rule Syntax: The rules in
.contextfiles
use standard.gitignore
syntax, allowing you to specify inclusion (src/**/*.py
) and exclusion patterns (!**/test_data/
). - Dynamic Application: Jinni dynamically applies the context rules based on the location of the
.contextfiles
and the specified--overrides
, ensuring files are processed according to the selected environment. - Exclusion Considerations: If you use the
--overrides
flag, all default exclusion rules are ignored. You may need to explicitly add back common exclusions if required.
Conclusion
Using
.contextfiles
for different environments allows for flexible project management in Jinni, enabling you to easily switch between development and production setups. This setup enhances control over the files included in different stages of your project workflow.- Rule Syntax: The rules in
Test case 3
Score: 10/10What are the built-in default exclusions in Jinni, and how can I override them to include files that would normally be excluded?Built-in Default Exclusions in Jinni
Jinni automatically excludes several common directories and file types to streamline the context reading process. The default exclusions typically include:
-
Version Control Directories:
.git/
-
Dependency Management Directories:
node_modules/
.venv/
(Python virtual environments)
-
Compiled or Cached Files:
__pycache__/
-
Common Binary Types:
- Files with extensions commonly associated with binaries (e.g.,
.exe
,.dll
, etc.)
- Files with extensions commonly associated with binaries (e.g.,
How to Override Default Exclusions
If you need to include files or directories that are normally excluded by Jinni, you can do so by using the following methods:
-
Using
.contextfiles
:- Create a
.contextfiles
file in your project directory or any subdirectory. - This file can include both inclusion and exclusion patterns.
- For example, you can explicitly include files that are otherwise excluded:
# Include Python files in the virtual environment !.venv/**
- Create a
-
Using the
rules
Argument:- When invoking the Jinni context reading function, you can provide a
rules
argument. This argument completely replaces the default exclusions. - If you use this approach, remember that you must explicitly add back any exclusions you want to maintain. For example:
rules: ["*.py", "!node_modules/", "!*.venv/"]
- In this case, if you only specify
rules: ["*.py"]
, you might end up including files from the.venv/
directory, which is usually not desired.
- When invoking the Jinni context reading function, you can provide a
-
Priority of Patterns:
- Jinni processes patterns in a way that the last matching pattern determines whether a file is included or excluded. If a pattern starts with
!
, it negates any previous matches. - Hence, you can control the inclusion/exclusion logic effectively by structuring your patterns carefully.
- Jinni processes patterns in a way that the last matching pattern determines whether a file is included or excluded. If a pattern starts with
Example of a
.contextfiles
Hereâs an example of what a
.contextfiles
might look like:# Include all Python files in the src directory and subdirectories src/**/*.py # Include the main config file at the root of the project /config.json # Include all markdown files anywhere *.md # Exclude any test data directories found anywhere !**/test_data/
Summary
- Use
.contextfiles
for fine-grained control over what is included or excluded in your Jinni context. - If using the
rules
argument, be sure to re-specify any essential exclusions since it will override built-in defaults. - Understand the pattern matching logic to effectively manage inclusions and exclusions in your project.
-
Test case 4
Score: 10/10How can I use Jinni to dynamically apply different file inclusion rules for development versus production environments?To dynamically apply different file inclusion rules for development versus production environments using Jinni, you can leverage the
.contextfiles
mechanism along with the--overrides
option or therules
argument in the MCP configuration. Hereâs how you can set it up:Overview of Jinni Configuration
.contextfiles
: These are plain text files that define which files and directories to include or exclude based on.gitignore
-style patterns. You can place these files in any directory, and rules will apply to that directory and its subdirectories.- Dynamic Rule Application: Jinni combines rules from
.contextfiles
found in parent directories and applies them dynamically when processing files.
Setting Up for Different Environments
1. Create Environment-Specific
.contextfiles
You can create different
.contextfiles
for development and production environments in your project structure.-
Development Context File: Place this in the root or a specific development directory.
- Example (
my_project/.contextfiles
):# Development Rules src/**/*.py /config_dev.yaml *.md !**/test_data/
- Example (
-
Production Context File: Place this in a separate directory or use a different name.
- Example (
my_project/prod/.contextfiles
):# Production Rules src/**/*.py /config_prod.yaml
- Example (
2. Use Overrides for Specific Builds
When you want to build or process files for a specific environment, you can use the
--overrides
command-line option or specifyrules
in your MCP command.-
For Development:
jinni --project_root my_project --overrides my_project/.contextfiles
-
For Production:
jinni --project_root my_project --overrides my_project/prod/.contextfiles
Important Considerations
- Override Logic: When you provide overrides, Jinni ignores all other
.contextfiles
and uses only the specified rules. This means you should explicitly include any necessary exclusions that are normally handled by default. - Dynamic Context: If you do not use overrides, Jinni will combine rules from all applicable
.contextfiles
, giving you a flexible approach to managing different environments without manual changes.
Example Workflow for Development and Production
- Set up your project structure with separate directories for development and production contexts.
- Define your inclusion/exclusion rules in the respective
.contextfiles
. - Use Jinni commands with the appropriate overrides based on the environment you are working in.
Conclusion
By organizing your project with distinct
.contextfiles
for different environments and utilizing the--overrides
option, you can effectively manage file inclusions and exclusions in Jinni. This setup allows for a streamlined development process, ensuring that your builds include only the necessary files for each environment.If you need further assistance or examples, feel free to ask!
Test case 5
Score: 10/10Can you demonstrate how to use pattern anchoring in .contextfiles to include files only from specific directories while excluding similar files elsewhere in the project?To use pattern anchoring in
.contextfiles
effectively, you can specify rules that include files from specific directories while excluding similar files from other parts of your project. This is particularly useful when you want to focus on files from certain locations without cluttering your context with similar files that exist elsewhere.Key Concepts of Pattern Anchoring
-
Anchoring: A leading
/
in a pattern anchors it to the directory containing the.contextfiles
. This means the pattern will only match files relative to that directory. -
Inclusion and Exclusion:
- Inclusion patterns specify which files or directories to include.
- Exclusion patterns (starting with
!
) specify which files or directories to exclude, even if they match an inclusion pattern.
-
Directory Specificity: A trailing
/
in a pattern matches directories only, allowing you to control the inclusion of directories specifically.
Example Scenario
Project Structure
my_project/ â âââ src/ â âââ include/ â â âââ file1.py â â âââ file2.py â âââ exclude/ â â âââ file1.py â â âââ file2.py â âââ main.py âââ .contextfiles
Configuration in
.contextfiles
Hereâs how you can create a
.contextfiles
inmy_project/
to include only Python files from theinclude
directory while excluding any similar files in theexclude
directory.# Include all Python files in the include directory /src/include/**/*.py # Exclude all Python files in the exclude directory /src/exclude/**/*.py
Explanation of the Example
- The first line includes all Python files from the
src/include/
directory and its subdirectories. - The second line explicitly excludes all Python files from the
src/exclude/
directory.
Benefits of This Approach
- Focused Context: You can focus on specific directories for processing, which is beneficial when working with large projects where similar files might exist in multiple directories.
- Clarity: By using the anchoring feature, you clarify which files are relevant and avoid unintentional inclusions from unrelated directories.
Additional Tips
- Use comments (
#
) in your.contextfiles
to document the purpose of each rule, making it easier for others (or yourself) to understand the configuration later. - Always test your
.contextfiles
by running context reads to ensure the desired files are included/excluded correctly.
This approach can be adapted to fit various project structures and needs, providing flexibility in managing which files are processed.
-