Skip to content

Commit 0064f67

Browse files
RecoDemoclaude
andcommitted
Add C# annotator, JSON annotator, bump to 0.6.0
Add first-class C# language support: classes, interfaces, structs, enums, records, methods, constructors, using directives, [Attributes], and /// XML doc comments. Add JSON annotator for structured JSON files. Update README language support table, .gitignore, and dispatch layer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 74af02f commit 0064f67

9 files changed

Lines changed: 1768 additions & 3 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ htmlcov/
5555
# ── Codebase index cache ─────────────────────
5656
.codebase-index-cache.pkl
5757

58+
# ── MCP local config ─────────────────────────
59+
.mcp.json
60+
5861
# ── Misc ───────────────────────────────────────
5962
*.log
6063
*.bak

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![MCP](https://img.shields.io/badge/MCP-compatible-purple.svg)](https://modelcontextprotocol.io)
99
[![Zero Dependencies](https://img.shields.io/badge/dependencies-zero-brightgreen.svg)]()
1010

11-
A structural codebase indexer with an [MCP](https://modelcontextprotocol.io) server for AI-assisted development. Zero runtime dependencies — uses Python's `ast` module for Python analysis and regex-based parsing for TypeScript/JS, Go, and Rust. Requires Python 3.11+.
11+
A structural codebase indexer with an [MCP](https://modelcontextprotocol.io) server for AI-assisted development. Zero runtime dependencies — uses Python's `ast` module for Python analysis and regex-based parsing for TypeScript/JS, Go, Rust, and C#. Requires Python 3.11+.
1212

1313
## What It Does
1414

@@ -26,6 +26,7 @@ Indexes codebases by parsing source files into structural metadata -- functions,
2626
| TypeScript/JS (`.ts`, `.tsx`, `.js`, `.jsx`) | Regex-based | Functions, arrow functions, classes, interfaces, type aliases, imports |
2727
| Go (`.go`) | Regex-based | Functions, methods (receiver-based), structs, interfaces, type aliases, imports, doc comments |
2828
| Rust (`.rs`) | Regex-based | Functions (`pub`/`async`/`const`/`unsafe`), structs, enums, traits, impl blocks, use statements, attributes, doc comments, macro_rules |
29+
| C# (`.cs`) | Regex-based | Classes, interfaces, structs, enums, records, methods, constructors, using directives, `[Attributes]`, `///` XML doc comments |
2930
| Markdown/Text (`.md`, `.txt`, `.rst`) | Heading detection | Sections (# headings, underlines, numbered, ALL-CAPS) |
3031
| Other | Generic | Line counts only |
3132

@@ -273,7 +274,7 @@ Run the benchmarks yourself: `python benchmarks/benchmark.py`
273274

274275
LSP answers "where is this function?" — mcp-codebase-index answers "what happens if I change it?" LSP is point queries: one symbol, one file, one position. It can tell you where `LLMClient` is defined and who references it. But ask "what breaks transitively if I refactor `LLMClient`?" and LSP has nothing. This tool returns 11 direct dependents and 31 transitive impacts in a single call — 204 characters. To get the same answer from LSP, the AI would need to chain dozens of find-reference calls recursively, reading files at every step, burning thousands of tokens to reconstruct what the dependency graph already knows.
275276

276-
LSP also requires you to install a separate language server for every language in your project — pyright for Python, vtsls for TypeScript, gopls for Go. Each one is a heavyweight binary with its own dependencies and configuration. mcp-codebase-index is zero dependencies, handles Python + TypeScript/JS + Go + Rust + Markdown out of the box, and every response has built-in token budget controls (`max_results`, `max_lines`). LSP was built for IDEs. This was built for AI.
277+
LSP also requires you to install a separate language server for every language in your project — pyright for Python, vtsls for TypeScript, gopls for Go. Each one is a heavyweight binary with its own dependencies and configuration. mcp-codebase-index is zero dependencies, handles Python + TypeScript/JS + Go + Rust + C# + Markdown out of the box, and every response has built-in token budget controls (`max_results`, `max_lines`). LSP was built for IDEs. This was built for AI.
277278

278279
## Programmatic Usage
279280

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "mcp-codebase-index"
7-
version = "0.5.0"
7+
version = "0.6.0"
88
description = "Structural codebase indexer with MCP server for AI-assisted development"
99
requires-python = ">=3.11"
1010
readme = "README.md"

src/mcp_codebase_index/annotator.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818

1919
"""Dispatch layer that selects the appropriate annotator by file type."""
2020

21+
from mcp_codebase_index.csharp_annotator import annotate_csharp
2122
from mcp_codebase_index.generic_annotator import annotate_generic
2223
from mcp_codebase_index.go_annotator import annotate_go
24+
from mcp_codebase_index.json_annotator import annotate_json
2325
from mcp_codebase_index.models import StructuralMetadata
2426
from mcp_codebase_index.python_annotator import annotate_python
2527
from mcp_codebase_index.rust_annotator import annotate_rust
@@ -38,6 +40,8 @@
3840
".jsx": "javascript",
3941
".go": "go",
4042
".rs": "rust",
43+
".cs": "csharp",
44+
".json": "json",
4145
}
4246

4347

@@ -75,5 +79,9 @@ def annotate(
7579
return annotate_go(text, source_name)
7680
elif file_type == "rust":
7781
return annotate_rust(text, source_name)
82+
elif file_type == "csharp":
83+
return annotate_csharp(text, source_name)
84+
elif file_type == "json":
85+
return annotate_json(text, source_name)
7886
else:
7987
return annotate_generic(text, source_name)

0 commit comments

Comments
 (0)