Skip to main content

Portable MCP code-map server for token-efficient coding agents

Project description

ntc-code-map

Portable MCP code-map server for token-efficient coding agents.

ntc-code-map builds a lightweight index of your repository's files and symbols, then serves a compact, task-aware code map over the Model Context Protocol (MCP). Coding agents like Codex use it to understand project structure before reading files — saving thousands of tokens per session.

Why?

LLM coding agents waste tokens on broad grep, find, and full-file reads to orient themselves. ntc-code-map compresses this into a single ranked map call:

Without ntc-code-map With ntc-code-map
Agent reads 10+ files to understand structure Agent gets a ranked map in ~3500 tokens
Broad grep -R, tree, ls -R One repo_map(task) call
No symbol awareness Symbol-level navigation + references

Quick Start

1. Install

pip install mcp-ntc-road-map-codex-agent

2. Initialize in your project

cd your-project

# Create config
ntc-code-map init

# Build the index
ntc-code-map index

# Check status
ntc-code-map status

3. Use with Codex

# Auto-configure Codex MCP integration
ntc-code-map init-codex

# Auto-inject workflow into AGENTS.md
ntc-code-map init-agents

That's it! Codex will now use ntc-code-map automatically.

MCP Tools

When running as an MCP server, these tools are available:

Tool Description
index_status Check if the repo index exists and is fresh
index_repo Build/rebuild the SQLite index
repo_map Task-aware ranked map of relevant files + symbols
find_symbols Search symbols by name, kind, scope, signature
find_files Search files by path and content
module_map Compact map for a specific file or directory

Recommended agent workflow

1. index_status    → is the index fresh?
2. index_repo      → rebuild if stale
3. repo_map(task)  → get ranked context
4. find_symbols()  → focused follow-up
5. Serena tools    → exact symbol navigation

CLI Reference

ntc-code-map init             # Create .ntc-code-map.toml
ntc-code-map index            # Index source files + symbols
ntc-code-map status           # Show index status
ntc-code-map repo-map "task"  # Generate task-aware map
ntc-code-map find-symbols "query"
ntc-code-map find-files "query"
ntc-code-map module-map src/
ntc-code-map serve            # Start MCP server (stdio)
ntc-code-map init-codex       # Configure Codex MCP
ntc-code-map init-agents      # Inject workflow into AGENTS.md
ntc-code-map doctor           # Check dependencies
ntc-code-map version

Configuration

Create .ntc-code-map.toml in your project root:

[project]
name = "my-project"
root_markers = [".git", "pyproject.toml", "package.json"]

[index]
include_exts = [".py", ".ts", ".js", ".go", ".rs", ".java", ".md"]
ignore_dirs = [".git", "node_modules", "dist", "build", ".venv"]

[ranking]
default_token_budget = 3500
max_files = 80
max_symbols_per_file = 24

How it works

  1. Index: Scans source files, extracts symbols using ctags (with regex fallback), stores everything in a local SQLite database (.ntc-code-map/index.db).

  2. Score: When repo_map(task) is called, it scores every file against the task description using symbol names, file paths, and content matching.

  3. Map: Returns a compact Markdown map with ranked files, their symbols (kind, line, signature), and next-step recommendations — all within the token budget.

Dependencies

  • Python ≥ 3.11
  • mcp ≥ 1.0.0 (for MCP server)
  • Optional: ctags for better symbol extraction (falls back to regex)

Development

git clone https://github.com/ntc-ai/ntc-code-map.git
cd ntc-code-map
pip install -e ".[dev]"
pytest

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_ntc_road_map_codex_agent-0.1.0.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_ntc_road_map_codex_agent-0.1.0-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file mcp_ntc_road_map_codex_agent-0.1.0.tar.gz.

File metadata

File hashes

Hashes for mcp_ntc_road_map_codex_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e4aae316fe78a076470daefbdac903e6e6948048588b9fff3cc29436ddfa6738
MD5 4873a4bab71b9bd6a05a46d6384d1fac
BLAKE2b-256 08e96cc04be47794a5e2f528062d3f64a332c6e6a718af6c70a3ba66383b7df9

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_ntc_road_map_codex_agent-0.1.0.tar.gz:

Publisher: publish.yml on baolnq-ai/mcp-ntc-road-map-codex-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_ntc_road_map_codex_agent-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_ntc_road_map_codex_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f50cfafd98d33f512b125ca36a8e297c0df84586310e625cc074d368946ac93d
MD5 86ecc7996232b1f824f71987975a6ed7
BLAKE2b-256 b9370fbaea0bcc433e702353174f50d171cde6f70843f7310e5cc76421f0f054

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_ntc_road_map_codex_agent-0.1.0-py3-none-any.whl:

Publisher: publish.yml on baolnq-ai/mcp-ntc-road-map-codex-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page