@cogniteration/code-context
v0.1.3
Published
An MCP server for analyzing codebases with accurate token counting
Maintainers
Readme
Code Context MCP Server
An MCP (Model Context Protocol) server for analyzing codebases with accurate token counting. When connected to an LLM through MCP, this tool provides accurate token counts and file analysis features.
Installation
# From npm (global)
npx @cogniteration/code-context /path/to/directory
# Using bunx (no installation needed)
bunx @cogniteration/code-context /path/to/directoryUsage
Start the MCP server, specifying which directories it's allowed to access:
bunx @cogniteration/code-context /path/to/directory [/additional/directories...]Tokenizer Selection
By default, the Claude tokenizer is used. You can specify a different tokenizer model:
bunx @cogniteration/code-context --tokenizer=Xenova/gpt-4 /path/to/directoryAvailable tokenizers:
Xenova/claude-tokenizer(default)Xenova/gpt-4- GPT-4 / GPT-3.5-turboXenova/mistral-tokenizer-v3- Mistral v3- And more (use
--tokenizer=invalidto see full list)
Development
# Clone the repository
git clone https://github.com/AdjectiveAllison/cogniteration.git
cd cogniteration/code-context
# Install dependencies
bun install
# Run locally
bun start
# Development with auto-reload
bun run devLicense
MIT
Contributing
Issues and pull requests welcome at github.com/AdjectiveAllison/cogniteration.
