Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
CLI tool & MCP server that turns a codebase into text for an LLM to see its context — feed code to ChatGPT, Claude, or any AI coding assistant
Jump to setup instructionsNo tool list is on record. This does not mean the server has no tools. Tools were not run.
No setup evidence yet No matching config or report on record. This does not mean the server is incompatible.
Same catalog task: AI & machine learning.
.prompts, the home to all your AI prompts, everywhere you need them.
Same catalog task: AI & machine learning.
Real MCP server (stdio + @modelcontextprotocol/sdk) that exposes x402-paywalled HTTP endpoints as MCP tools. Drop into Claude Desktop, Cursor, or any MCP client.
Same catalog task: AI & machine learning.
Standalone MCP (Model Context Protocol) server - stdio/http/websocket transports, connection pooling, tool registry
Fetched from the repository for this visit.
CodeContext is a cross-platform C# CLI tool and MCP (Model Context Protocol) server for Mac, Windows, and Linux that turns a codebase into text for an LLM to see its context. It's a code context tool built for prompt engineering: feed a project straight into ChatGPT, Claude, or any other LLM-based coding assistant without manually copy-pasting files.
It scans project directories, generates a structured representation of the project, and extracts relevant file contents while intelligently filtering out unnecessary files and directories. Now with token budget optimization and relevance-based file selection for agentic coding workflows!

Update: A more comprehensive tool is code2prompt. I found that CodeContext is more user-friendly, faster, and automatically includes only user code (based on both extension and file contents), but you may have better luck with alternatives.
The project follows SOLID principles with a modular architecture:
Configuration/: Filter configuration settings and app configurationInterfaces/: Abstraction interfaces (IFileChecker, IConsoleWriter)Services/: Core business logic
Mcp/: Model Context Protocol server tools
Utils/: Utility functions (FileUtilities, Guard)This design makes the codebase maintainable, testable, and extensible while supporting both CLI and MCP server modes.
Install .NET SDK if you haven't already:
brew install --cask dotnet-sdk
Download and install the .NET 9 SDK
Follow the official .NET installation guide for your distribution.
git clone https://github.com/DavidVeksler/CodeContext.git
cd CodeContext
dotnet build
# Self-contained executable
dotnet publish -c Release -r win-x64 --self-contained # Windows
dotnet publish -c Release -r osx-x64 --self-contained # macOS
dotnet publish -c Release -r linux-x64 --self-contained # Linux
Run the application with:
dotnet run [path_to_index] [output_file]
Arguments:
path_to_index: The directory to analyze (optional, will prompt if not provided)output_file: The file to write the output (optional, defaults to {foldername}_context.txt in the indexed directory)If no arguments are provided, the application will prompt for input interactively.
# Interactive mode
dotnet run
# With arguments
dotnet run ./MyProject ./output/context.txt
# Using published executable
./CodeContext ./MyProject ./output/context.txt
CodeContext now supports Model Context Protocol (MCP), enabling native integration with agentic coding tools like Claude Code, Cline, and other MCP-compatible clients.
MCP server mode provides:
dotnet build
~/.config/claude/mcp.json or project .claude/mcp.json):{
"mcpServers": {
"codecontext": {
"command": "dotnet",
"args": [
"run",
"--project",
"/absolute/path/to/CodeContext/CodeContext.csproj",
"--",
"--mcp"
]
}
}
}
Get optimized code context for a specific task within a token budget.
Parameters:
projectPath (required): Path to project directorytaskDescription (required): Description of task (e.g., "fix authentication bug", "add payment feature")tokenBudget (optional, default: 50000): Maximum tokens to useincludeStructure (optional, default: true): Include project structurestrategy (optional, default: "ValueOptimized"): Selection strategy
GreedyByScore: Pick highest-scoring files firstValueOptimized: Maximize relevance per token (best bang for buck)Balanced: Mix of high-value and comprehensive coverageExample:
Agent: Use GetCodeContext with projectPath="/path/to/project",
taskDescription="implement user authentication",
tokenBudget=30000,
strategy="ValueOptimized"
Get hierarchical directory tree of the project.
Parameters:
projectPath (required): Path to project directoryList all files with token counts and optional relevance filtering.
Parameters:
projectPath (required): Path to project directoryquery (optional): Query to filter/rank files by relevanceGet content of specific files.
Parameters:
projectPath (required): Path to project directoryfilePaths (required): Comma-separated list of relative file pathsRelevance Scoring: Files are scored based on:
Selection Strategies:
Result: You get the most relevant files for your task within your token budget!
# Agent asks: "Help me fix the login authentication bug"
# CodeContext MCP server:
# 1. Scans project files
# 2. Scores files for relevance to "login authentication bug"
# 3. Selects optimal files within token budget (e.g., 50K tokens)
# 4. Returns context with:
# - auth/login.ts (score: 0.95, 2K tokens)
# - auth/session.ts (score: 0.87, 1.5K tokens)
# - middleware/auth.ts (score: 0.79, 1K tokens)
# - tests/auth.test.ts (score: 0.72, 3K tokens)
# - ... (up to budget)
Create a config.json file in the application directory to customize settings:
{
"DefaultInputPath": ".",
"DefaultOutputFileName": "context.txt",
"OutputFormat": "text",
"IncludeStructure": true,
"IncludeContents": true
}
Customize filtering behavior by modifying the FilterConfiguration class:
IgnoredExtensions: File extensions to ignore (e.g., .exe, .dll, .png)IgnoredDirectories: Directories to ignore (e.g., node_modules, bin, obj)IgnoredFiles: Specific files to ignore (e.g., .gitignore, package-lock.json)MaxFileSizeBytes: Maximum file size to process (default: 100KB)BinaryThreshold: Threshold for binary file detection (default: 0.3)Plain text output with file paths, separators, and content.
Structured JSON with content and timestamp:
{
"content": "...",
"timestamp": "2025-11-21T10:30:00"
}
The application provides clear error messages with appropriate exit codes:
1: Directory not found2: I/O error3: Access denied4: Unexpected errorContributions are welcome! Please feel free to submit a Pull Request.
The codebase uses:
This project is licensed under the MIT License - see the LICENSE.txt file for details.
Built with ❤️ for the developer community to make working with LLMs more efficient.
Loading reviews...
GitHub checked 135h ago - refresh overdue. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.