CostAffective-MCP

by okyashgajjar

296 downloads
Not rated
GitHub

About

Intelligent repository context for AI coding assistants. Provides code search, symbol lookup, call graphs, and reference tracking via MCP. Uniquely designed to minimize prompt-cache costs in long sessions stash/recall/remember tools keep large content out of context until needed,

Details

Author
okyashgajjar
Downloads
296
Categories
Other, Developer Tools, Knowledge Base, AI, Search

- Semantic code search by natural language query
- Symbol definition lookup and full implementation retrieval
- Finds references and callers for any symbol
- Persist durable facts

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name CostAffective-MCP
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install via the provided curl script or build from source with Go 1.25+ and a C compiler. Configure your MCP client with the command costaffective and argument serve. The server will automatically index your repository on first access and provide 11 MCP tools for code retrieval, context control, and maintenance.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "costaffective-mcp": {
            "costaffective": {
                "command": "costaffective",
                "args": [
                    "serve"
                ]
            }
        }
    }
}

McpServers

{
    "costaffective": {
        "command": "costaffective",
        "args": [
            "serve"
        ]
    }
}

costaffective-mcp

Coding agents that explore less, remember more, and carry less context. MCP: `` github.com/okyashgajjar/costaffective-mcp ` CostAffective is a local MCP server that makes AI coding agents behave like experienced engineers. Instead of re-reading whole files every turn, dumping build logs into context, and re-discovering symbols they already found, agents get fast, token-budgeted access to your repository — so they stop carrying everything around forever.

Why

In long sessions the dominant cost is not the model's output — it's the prompt cache re-reading and re-writing everything resident in the context window every turn. A real measured example: a single API call billed at $2.95, of which $2.84 was a 5-minute cache write of ~455k tokens of resident context. The answer was under 4,000 tokens. CostAffective fixes this by keeping tokens out of the window in the first place.

Tools (11 MCP tools)

Retrieval

- search_code — semantic repository search by natural language question - find_symbol — locate where a symbol is defined - read_symbol — return a symbol's full implementation body by name - find_references — every usage of a symbol, precomputed - find_callers — which functions call a given function

Context control

- remember — persist a durable fact once instead of repeating it inline - stash_context — park a large blob (file, log, output) out of context behind a tiny handle - recall — pull back only the slice matching a query, within a token budget

Maintenance

- get_repository_summary — token-budgeted repo overview, drillable by module - index_repository — manual re-index trigger

Session awareness

- costaffective-session skill — 275-token guidance auto-delivered via MCP instructions field, teaching agents to stash, remember, and retrieve instead of pasting inline

Architecture

` AI Client (MCP Host) → stdio transport → costaffective serve ├── Tree-sitter parser → Symbol / Reference / Call Graph indexes ├── Per-repo stash (large blobs out of context) ├── Per-repo durable facts (remember/recall) └── Token-budgeted compression on every tool output ` All per-repo state lives under .mycli-fts/ in the repo root. Index is local SQLite. No cloud, no API keys.

Benchmarks

Small repo: tokens consumed dropped 81.7% (299K → 55K), 2.2x faster, 70% fewer tool calls. Large repo (Continue OSS): tokens down 45.9% (8.7M → 4.7M), API calls down 33.6%.

Install

` curl -fsSL https://raw.githubusercontent.com/okyashgajjar/costaffective-mcp/main/install.sh | bash ` Or manual: CGO_ENABLED=1 go build -o costaffective ./cmd/costaffective/ Server config for any MCP client: ` { "mcpServers": { "costaffective": { "command": "costaffective", "args": ["serve"] } } } `` Supports Claude Code, Cursor, OpenCode, Cline, Codex CLI, Antigravity, and any stdio MCP client.

Requirements

Go 1.25+, C compiler (CGO required for go-sqlite3 and tree-sitter). Linux amd64/arm64, macOS amd64/arm64, Windows amd64.
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.