Integrations
Extracts code changes from Git commits and diffs to provide contextual information about your project's history
Gathers code from GitHub repositories to provide context about your project to LLMs
Supports specialized handling of PHP code, including the ability to extract PHP signatures without implementation details
ctx: The missing link between your codebase and your LLM. Context as Code (CaC) tool with MCP server inside.
Table of Contents
CTX is a tool made to solve a big problem when chatting with LLMs like ChatGPT or Claude: giving them enough context about your project.
There is an article about Context Generator on Medium that explains the motivation behind the project and the problem it solves.
When you're using AI in development, context isn't just helpful — it's everything. Instead of manually copying or explaining your entire codebase each time, ctx automatically builds neat, organized context files from:
- Code files,
- GitHub and Gitlab repositories,
- Git commits and diffs
- Web pages (URLs) with CSS selectors,
- MCP servers
- and plain text.
It was created to solve a common problem: efficiently providing AI language models like Claude with necessary context about your codebase.
How it works
- Gathers code from files, directories, GitHub or Gitlab repositories, web pages, or plain text.
- Targets specific files through pattern matching, content search, size, or date filters
- Applies optional modifiers (like extracting PHP signatures without implementation details)
- Organizes content into well-structured markdown documents
- Saves context files ready to be shared with LLMs
- Optionally serves context through an MCP server, allowing AI assistants like Claude to directly access project information
Quick Start
Getting started with CTX is straightforward. Follow these simple steps to create your first context file.
1. Install CTX
Download and install the tool using our installation script:
This installs the ctx
command to your system (typically in /usr/local/bin
).
Want more options? See the complete Installation Guide for alternative installation methods.
2. Initialize a Configuration File
Create a new configuration file in your project directory:
This generates a context.yaml
file with a basic structure to get you started.
Check the Command Reference for all available commands and options.
3. Describe Your Project Structure
Edit the generated context.yaml
file to specify what code or content you want to include.
For example:
This configuration will gather all PHP files from the src/Auth
directory and any PHP files containing "User" in their
name from the src/Models
directory.
Need more advanced configuration?
- Learn about Document Structure and properties
- Explore different source types like GitHub, Git Diff, or URL
- Apply Modifiers to transform your content (like extracting PHP signatures)
- Discover how to use Environment Variables in your config
- Use IDE Integration for autocompletion and validation
4. Build the Context
Generate your context file by running:
CTX will process your configuration and create the specified output file (auth-context.md
in our example).
Tip: Configure Logging with
-v
,-vv
, or-vvv
for detailed output
5. Share with an LLM
Upload or paste the generated context file to your favorite LLM (like ChatGPT or Claude). Now you can ask specific questions about your codebase, and the LLM will have the necessary context to provide accurate assistance.
Example prompt:
I've shared my authentication system code with you. Can you help me identify potential security vulnerabilities in the user registration process?
Next steps: Check out Development with Context Generator for best practices on integrating context generation into your AI-powered development workflow.
That's it! You're now ready to leverage LLMs with proper context about your codebase.
6. Connect to Claude AI (Optional)
For a more seamless experience, you can connect Context Generator directly to Claude AI using the MCP server:
There is a built-in MCP server that allows you to connect Claude AI directly to your codebase.
Point the MCP client to the Context Generator server:
Note: Read more about MCP Server for detailed setup instructions.
Now you can ask Claude questions about your codebase without manually uploading context files!
Full Documentation
For complete documentation, including all available features and configuration options, please visit:
License
This project is licensed under the MIT License.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
CTX is a tool made to solve a big problem when chatting with LLMs like ChatGPT or Claude: giving them enough context about your project.
Related MCP Servers
- AsecurityAlicenseAqualityEnables integration of Perplexity's AI API with LLMs, delivering advanced chat completion by utilizing specialized prompt templates for tasks like technical documentation, code review, and API documentation.Last updated -1948JavaScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server for Claude Desktop that provides structured memory management across chat sessions, allowing Claude to maintain context and build a knowledge base within project directories.Last updated -TypeScript
- AsecurityFlicenseAqualityA model context protocol server that allows interaction with TriliumNext Notes, providing tools to create, search, retrieve, update, and delete notes through natural language commands.Last updated -51JavaScript
- -securityAlicense-qualityAn MCP server that provides integration with Microsoft's AutoGen framework, enabling multi-agent conversations through a standardized interface.Last updated -1PythonMIT License