# BGTS Context Engine

> Deterministic code graph context for AI coding agents.

- **URL**: https://followmcp.com/en/servers/bgts-context-engine
- **Category**: Dev Tools
- **Origin**: Community
- **Stars**: 180
- **FMRS Score**: 51/100 (Grade D)
- **Source**: https://github.com/bgts-ai-org/bgts-context-engine
- **Transports**: stdio (local process)
- **Runtimes**: Python, Docker
- **Auth**: No credential needed

## Overview
BGTS Context Engine indexes repositories as code graphs and provides ranked, budgeted context with coverage information to AI coding agents over MCP. It uses PostgreSQL, Apache AGE, and pgvector; no LLM is used in the retrieval path. The MCP server exposes get_context_for_task and inspect_symbol_graph by default. Additional read-only and indexing tools can be enabled through configuration.

## Best for
- Development teams that can run PostgreSQL with Apache AGE and pgvector to index repositories.
- Users who want reproducible code graph context for coding agents.
- Local or internal deployments with the capacity to manage a database and code index.

## Not for
- Users who do not want to run or connect to PostgreSQL with Apache AGE and pgvector.
- Teams that require remote MCP transport; this server provides stdio.
- Deployments requiring built-in server authentication or user-level repository scope enforcement on every interface.

## Required permissions
- Requires access to the configured PostgreSQL database; database credentials are supplied through BCE_DB_* environment variables.
- Indexing a repository requires reading the target codebase according to its workflow; indexing tools are enabled only when BCE_MCP_ALLOW_WRITE=true.
- The default toolset is read-only; the full read-only toolset can be enabled with BCE_MCP_TOOLSET=full.

## Risks
- The server has no built-in authentication; the README recommends placing it behind an authenticated proxy before exposing a port.
- Only Layer 3 endpoints apply per-user repository scope; other layers may not enforce that scope.
- Enabling the Jev context selector sends task text and code excerpts to a third-party service.
- The index may lag behind the working tree; responses report coverage information such as commit_mismatch.

## Client config (JSON)
```json
{
  "mcpServers": {
    "bgts-context-engine": {
      "command": "uvx",
      "args": ["--from", "bgts-context-engine[mcp]", "bce", "serve-mcp"],
      "env": {
        "BCE_DB_HOST": "localhost",
        "BCE_DB_PORT": "5432",
        "BCE_DB_NAME": "bce",
        "BCE_DB_USER": "bce",
        "BCE_DB_PASSWORD": "bce"
      }
    }
  }
}
```

## Tools (2)
- `get_context_for_task`: Retrieve ranked code context for a task, with coverage information.
- `inspect_symbol_graph`: Inspect symbols and their relationships in the code graph.
