convez.ai
MCP ServerDevOps & InfraestruturaIntermediário
okyashgajjar

CostAffective MCP

okyashgajjar/costaffective-mcp

Indexação local de repositórios · 45% menos tokens · 100% privado

Ver no GitHub
InicialPluginScore · de 0 a 100

Servidor MCP local que indexa repositórios de código para reduzir tokens consumidos e loops de exploração desnecessários. Fornece acesso rápido a definições de símbolos, referências, relacionamentos de chamadas e análise de arquitetura, tudo sem enviar código para a nuvem.

Instalação

$npx convez-ai okyashgajjar/costaffective-mcp

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
22
Forks
4
Acompanhando
1
Saúde
28%
Último commit
há 3 dias
Versão
v2.0.3
Issues abertas
0
Contribuidores
1

Casos de uso

  • Acelerar compreensão de codebases grandes em assistentes IA
  • Reduzir consumo de tokens em análises de código
  • Busca semântica e navegação em repositórios
  • Integração com Cursor, Claude Code e outras ferramentas MCP

Veredito

CostAffective é uma solução técnica sólida para otimizar consumo de tokens em assistentes de código, com foco legítimo em redução de overhead via indexação local. Implementação em Go demonstra maturidade, mas a proposta de valor depende fortemente de integração com MCP clients específicos.

README

A tradução para o português deste README ainda está na fila.

CostAffective - MCP

45.9% fewer tokens · 54.3% fewer exploration loops · 42.1% fewer tool interactions · 100% Local

Go 1.25+ Windows macOS Linux Claude Code Cursor OpenCode Codex CLI Antigravity


INSTALLATION

curl -fsSL https://raw.githubusercontent.com/okyashgajjar/costaffective-mcp/main/install.sh | bash

[Linux (amd64)] [Windows (amd64)]

Scroll Down for MacOS installation

⭐ Star this repo — it helps others find CostAffective and keeps us motivated!

What is CostAffective?

CostAffective is a local MCP server that helps AI coding assistants understand large repositories without repeatedly exploring the same code.

Instead of sending large amounts of code into the model context, CostAffective builds a local repository index and provides fast access to:

  • Symbol definitions
  • References
  • Call relationships
  • Repository summaries
  • Architecture information
  • Semantic code search

Everything runs locally. No API keys. No cloud indexing. No code leaves your machine.


Why CostAffective?

Modern coding assistants often spend a large portion of their context window rediscovering code that already exists.

CostAffective reduces this overhead by providing repository-aware retrieval.

Benefits

  • Faster repository understanding
  • Smaller context usage
  • Fewer tool calls
  • Better navigation of large codebases
  • Local-first architecture — your code never leaves your machine
  • Automatic repository updates — no manual re-indexing

Works With

ClientSupported
Claude Code✅
Cursor✅
OpenCode✅
Codex CLI✅
Antigravity✅
MCP-Compatible Clients✅

Repository Intelligence

CostAffective combines multiple repository analysis techniques:

  • Tree-sitter AST parsing
  • Symbol indexing
  • Reference indexing
  • Call graph analysis
  • Architecture extraction
  • Repository summaries
  • Context compression
  • Incremental indexing

This provides significantly better repository understanding than simple text search.


Automatic Incremental Indexing

CostAffective continuously watches your repository and updates its index automatically.

When files change:

File Change
     ↓
Watchdog
     ↓
Hash Comparison
     ↓
Re-index Changed Files Only
     ↓
Cache Invalidation

No full repository rebuild is required. Only modified files are reprocessed. This keeps indexing fast even on large repositories.


search_code

Semantic repository search powered by Tree-sitter.

Example: Where is caching implemented?

find_symbol

Find where a symbol is defined.

Example: Find UserService

find_references

Find every usage of a symbol.

Example: Where is UserService used?

find_callers

Find which functions call another function.

Example: What calls processPayment()?

grep_code

Regex and full-text fallback search.

get_repository_summary

Generate repository-level summaries. Includes languages, modules, architecture, and key symbols.

index_repository

Refresh or rebuild repository indexes.

AI Client (MCP Host)
    │
    ├── stdio transport ──► costaffective serve (MCP Server)
    │                           │
    │                           ├── Session Manager
    │                           ├── Repository State Manager
    │                           ├── Watchdog
    │                           ├── Shared Indexer
    │                           │
    │                           ├── Tree-sitter Parser
    │                           ├── Symbol Index
    │                           ├── Reference Index
    │                           ├── Call Graph Index
    │                           │
    │                           ├── search_code ───────────► tree-sitter AST match
    │                           ├── find_symbol ───────────► SymbolDB lookup
    │                           ├── find_references ───────► SymbolDB reference search
    │                           ├── find_callers ──────────► SymbolDB call graph
    │                           ├── grep_code ─────────────► full-text search fallback
    │                           ├── get_repository_summary ► KnowledgeStore
    │                           └── index_repository ──────► SharedIndexer
CommandDescription
costaffective installInteractive installation
costaffective install --allConfigure all detected clients
costaffective install --targetConfigure a specific client
costaffective install --buildBuild from source before installing
costaffective install --repairRepair installation
costaffective doctorValidate installation
costaffective serveStart MCP server
costaffective uninstallRemove MCP configuration

Windows Installation

Current recommended installation:

  1. Download costaffective_windows_amd64.zip from GitHub Releases.
  2. Extract costaffective.exe.
  3. Add this directory to PATH:
C:\Users\<user>\AppData\Local\Programs\CostAffective\

Verify:

costaffective --version

macOS

brew install go sqlite
git clone https://github.com/okyashgajjar/costaffective-mcp.git
cd costaffective-mcp
go install ./cmd/costaffective
costaffective --version

Linux

Download costaffective_linux_amd64.zip from GitHub Releases.

Ubuntu/Debian

unzip costaffective_linux_amd64.zip
chmod +x costaffective
sudo mv costaffective /usr/local/bin/
costaffective --version

Arch

unzip costaffective_linux_amd64.zip
chmod +x costaffective
sudo install -m755 costaffective /usr/local/bin/
costaffective doctor

Fedora

unzip costaffective_linux_amd64.zip
chmod +x costaffective
sudo mv costaffective /usr/local/bin/
costaffective --version

openSUSE

unzip costaffective_linux_amd64.zip
chmod +x costaffective
sudo mv costaffective /usr/local/bin/
costaffective --version
  1. Remove MCP client configs:
costaffective uninstall --all
  1. Delete the binary:

Linux / macOS:

rm -f "$(command -v costaffective)"

Windows:

Remove-Item (Get-Command costaffective).Source -Force

Continue OSS Repository

MetricCostAffectiveAlternative
Tokens4.7M8.7M
API Calls89134
Exploration Calls4394

Improvement

MetricResult
Token Usage45.9% lower
Exploration Loops54.3% lower
Tool Interactions42.1% lower
git clone https://github.com/okyashgajjar/costaffective-mcp.git
cd costaffective-mcp
go build ./...
go test ./...
ClientConfig Surface
Claude Code~/.claude.json, .mcp.json, or settings files
Cursor~/.cursor/mcp.json or workspace MCP settings
OpenCodeopencode.json
Codex CLI~/.codex/config.toml
Antigravity~/.gemini/config/mcp_config.json
MCP-compatiblestdio transport

Repository State

CostAffective tracks three states for your repository index:

StateMeaning
unindexedNo usable index exists yet
staleFiles changed after the last index
readyIndex is in sync with the working tree

Agent mode can auto-index when needed; interactive modes prompt first.


Doctor

costaffective doctor checks:

  • Binary existence and permissions
  • PATH visibility
  • MCP configuration for each client
  • Server startup
  • Repository state

Supported Platforms

  • Linux amd64
  • Windows amd64

Linux arm64 and macOS release binaries are temporarily unavailable for v1.0.1 and will return in a future release. Users on those platforms can still build from source with a local Go and C toolchain.


License

MIT


Ver o original no GitHub

Bom para

Relacionados