costaffective-mcp

mcp
Guvenlik Denetimi
Uyari
Health Uyari
  • No license — Repository has no license file
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 5 GitHub stars
Code Gecti
  • Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

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

README.md

CostAffective

Local Repository Intelligence for AI Coding Assistants

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

CostAffective Banner

Save tokens. Buy Coffee.

Works with Claude Code, Cursor, OpenCode, Codex CLI, Antigravity, and any MCP-compatible client.

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


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

Client Supported
Claude Code
Cursor
OpenCode
Codex CLI
Antigravity
MCP-Compatible Clients

Example Questions

CostAffective helps answer questions such as:

Where is authentication implemented?

Find all references to UserService.

Which functions call processPayment()?

How does caching work in this repository?

Summarize the architecture of the billing module.

Show me every place validateUser() is used.

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.


📦 MCP Tools — click to expand

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.

🏗️ Architecture — click to expand
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
⚙️ Commands — click to expand
Command Description
costaffective install Interactive installation
costaffective install --all Configure all detected clients
costaffective install --target Configure a specific client
costaffective install --build Build from source before installing
costaffective install --repair Repair installation
costaffective doctor Validate installation
costaffective serve Start MCP server
costaffective uninstall Remove MCP configuration
💻 Installation — click to expand

Build

go build -o costaffective ./cmd/costaffective/

On Windows:

go build -o costaffective.exe ./cmd/costaffective/

Verify:

./costaffective --version

Install for supported clients:

./costaffective install --all

Validate installation:

./costaffective doctor

From any directory

After costaffective is on your PATH:

costaffective install --all

Shell installer

bash install-mcp.sh
🗑️ Uninstall — click to expand
  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
📊 Benchmarks — click to expand

Continue OSS Repository

Metric CostAffective Alternative
Tokens 4.7M 8.7M
API Calls 89 134
Exploration Calls 43 94

Improvement

Metric Result
Token Usage 45.9% lower
Exploration Loops 54.3% lower
Tool Interactions 42.1% lower
🛠️ Development — click to expand
git clone https://github.com/okyashgajjar/costaffective-mcp.git
cd costaffective-mcp
go build ./...
go test ./...
📋 Supported Clients & Config — click to expand
Client Config Surface
Claude Code ~/.claude.json, .mcp.json, or settings files
Cursor ~/.cursor/mcp.json or workspace MCP settings
OpenCode opencode.json
Codex CLI ~/.codex/config.toml
Antigravity ~/.gemini/config/mcp_config.json
MCP-compatible stdio transport

Repository State

CostAffective tracks three states for your repository index:

State Meaning
unindexed No usable index exists yet
stale Files changed after the last index
ready Index 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

  • Windows
  • macOS
  • Linux

License

MIT


Built with ❤️ for developers who believe AI coding tools should be fast, local, and open.
**Save tokens. Buy Coffee.** ☕

Yorumlar (0)

Sonuc bulunamadi