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
-
Index: Scans source files, extracts symbols using ctags (with regex fallback), stores everything in a local SQLite database (
.ntc-code-map/index.db). -
Score: When
repo_map(task)is called, it scores every file against the task description using symbol names, file paths, and content matching. -
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:
ctagsfor 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_ntc_road_map_codex_agent-0.1.0.tar.gz.
File metadata
- Download URL: mcp_ntc_road_map_codex_agent-0.1.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4aae316fe78a076470daefbdac903e6e6948048588b9fff3cc29436ddfa6738
|
|
| MD5 |
4873a4bab71b9bd6a05a46d6384d1fac
|
|
| BLAKE2b-256 |
08e96cc04be47794a5e2f528062d3f64a332c6e6a718af6c70a3ba66383b7df9
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_ntc_road_map_codex_agent-0.1.0.tar.gz -
Subject digest:
e4aae316fe78a076470daefbdac903e6e6948048588b9fff3cc29436ddfa6738 - Sigstore transparency entry: 2043728380
- Sigstore integration time:
-
Permalink:
baolnq-ai/mcp-ntc-road-map-codex-agent@2db4dca76b88461bf020912b620d9f960ad3aa76 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/baolnq-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2db4dca76b88461bf020912b620d9f960ad3aa76 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_ntc_road_map_codex_agent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_ntc_road_map_codex_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f50cfafd98d33f512b125ca36a8e297c0df84586310e625cc074d368946ac93d
|
|
| MD5 |
86ecc7996232b1f824f71987975a6ed7
|
|
| BLAKE2b-256 |
b9370fbaea0bcc433e702353174f50d171cde6f70843f7310e5cc76421f0f054
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_ntc_road_map_codex_agent-0.1.0-py3-none-any.whl -
Subject digest:
f50cfafd98d33f512b125ca36a8e297c0df84586310e625cc074d368946ac93d - Sigstore transparency entry: 2043728402
- Sigstore integration time:
-
Permalink:
baolnq-ai/mcp-ntc-road-map-codex-agent@2db4dca76b88461bf020912b620d9f960ad3aa76 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/baolnq-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2db4dca76b88461bf020912b620d9f960ad3aa76 -
Trigger Event:
release
-
Statement type: