Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
db3a606
feat: implement OAuth 2.1 authentication infrastructure (Story #478)
Nov 15, 2025
76160cd
feat: add MCP protocol foundation and tool registry (Story #479 partial)
Nov 15, 2025
e7bdc77
feat: implement all 22 MCP tool handlers (Story #479 complete)
Nov 15, 2025
7639002
fix: correct MCP handler service method calls (Story #479)
Nov 15, 2025
47ad046
fix: correct MCP handler service method calls (Story #479)
Nov 15, 2025
f9e9063
fix: OAuth token endpoint accepts form data per OAuth 2.1 spec
Nov 15, 2025
5dca03c
fix: Move debug logs from /tmp to .code-indexer/.tmp to fix permissio…
Nov 16, 2025
1ffafba
Rename debug_log_helper to log_path_helper (avoid gitignore)
Nov 16, 2025
2a3916e
Fix imports to use log_path_helper
Nov 16, 2025
b33d92c
feat: add browser-based OAuth authorization flow for Claude.ai
Nov 16, 2025
673cfa4
fix: complete HTML document for OAuth login page
Nov 16, 2025
a6ae796
fix: add OAuth discovery at root path for RFC 8414 compliance
Nov 16, 2025
5e2858d
feat: add root-level OAuth discovery for RFC 8414 compliance
Nov 16, 2025
6edbc15
feat: add CORS middleware for Claude.ai OAuth compatibility
Nov 16, 2025
e9e6a60
fix: validate client_id in GET /authorize per OAuth 2.1 spec
Nov 16, 2025
b98b439
feat: add WWW-Authenticate header with resource_metadata per RFC 9728
Nov 16, 2025
f6d0115
fix: return 401 (not 403) with WWW-Authenticate header for MCP auth
Nov 16, 2025
81c2531
feat: add GET and DELETE to MCP endpoint for streamable-http transport
Nov 16, 2025
20fc5c7
feat: add MCP initialize method for Claude Code handshake
Nov 16, 2025
f9114b1
fix: rename parameters to inputSchema in MCP tool definitions
Nov 16, 2025
688908b
fix: correct add_golden_repo handler parameter mapping
Nov 17, 2025
83586f6
fix: search_code handler uses activated repos not golden repos
Nov 17, 2025
561640c
fix: get_file_content returns MCP-compliant content array
Nov 17, 2025
684fd8a
fix: ALL MCP handlers return content array format per MCP spec
Nov 17, 2025
3b5410c
fix: datetime serialization in MCP handlers using model_dump(mode='js…
Nov 17, 2025
3bae986
fix: correct list_files, get_file_content, get_repository_statistics …
Nov 17, 2025
5d89694
fix: SemanticSearchService uses BackendFactory not hardcoded Qdrant
Nov 17, 2025
00643b8
fix: search_service uses correct FilesystemVectorStore.search() param…
Nov 17, 2025
597657a
fix: browse_directory and get_job_statistics handlers
Nov 17, 2025
465dc9b
fix: discover_repositories and sync_repository MCP handlers
Nov 17, 2025
a073c3e
Add comprehensive OAuth issuer URL investigation report
Nov 17, 2025
caa0522
fix: OAuth issuer URL now configurable via CIDX_ISSUER_URL environmen…
Nov 17, 2025
fdbdd20
Add MCP endpoint authentication issue analysis and solution
Nov 17, 2025
15c6a79
feat: add systemd service support and fix MCP authentication for clau…
Nov 17, 2025
4239819
fix: address critical security issues from code review
Nov 17, 2025
fa0c1b3
fix: correct MCP authentication - must return 401 not SSE stream for …
Nov 17, 2025
cd1cdfe
fix: MCP endpoint returns 401 for unauthenticated requests per RFC 9728
Nov 17, 2025
444e0ba
fix: server mode repositories now create FilesystemVectorStore config
Nov 18, 2025
94c8c74
fix: create config.json not config.yml for ConfigManager compatibility
Nov 18, 2025
3c675d4
fix: replace git clone with CoW clone in activation flow
Nov 18, 2025
6bda63f
fix: refactor golden repo MCP endpoints to async (issue #501)
Nov 18, 2025
592a6bb
docs: add critical warnings to OAuth routes to prevent future breakage
Nov 18, 2025
21f2616
docs: add token conservation guidance to search_code limit parameter
Nov 18, 2025
b7603bb
fix: update test_remove_golden_repo for async return type
Nov 18, 2025
e5e2165
feat: add CLI-MCP query parameter parity (6 new filter parameters)
Nov 18, 2025
ad7df5c
docs: add critical query parity business insight to CLAUDE.md
Nov 18, 2025
136c687
fix: Unix socket path exceeds 108-char limit in deep directories
Nov 18, 2025
9dd701b
fix: Handle permission errors in socket directory creation
Nov 19, 2025
7c2d717
chore: bump version to 7.4.0
Nov 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/post-tool-use.sh",
"timeout": 360
"command": "tdd-guard"
}
]
}
Expand All @@ -28,10 +27,6 @@
{
"type": "command",
"command": "tdd-guard"
},
{
"type": "command",
"command": "~/.claude/hooks/user-prompt-submit.sh"
}
]
}
Expand Down
45 changes: 44 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Code-Indexer (CIDX) Project Instructions

## 0. CRITICAL BUSINESS INSIGHT - Query is Everything

**THE SINGLE MOST IMPORTANT FEATURE**: Query capability is the core value proposition of CIDX. All query features available in CLI MUST be available in MCP/REST APIs with full parity.

**Query Parity is Non-Negotiable**: Any feature gap between CLI and MCP/REST query interfaces represents a critical degradation of the product's primary function. This is not optional - this is the business.

**Current Status** (as of 2025-11-18):
- CLI query parameters: 23 total
- MCP query parameters: 11 total (48% parity)
- **P0 filters implemented**: language, exclude_language, path_filter, exclude_path, file_extensions, accuracy
- **Remaining gap**: FTS-specific options (8 params), temporal options (4 params)

**Never remove or break query functionality** without explicit approval. Query degradation = product failure.

---

## 1. Operational Modes Overview

CIDX has **three operational modes**. Understanding which mode you're working in is critical.
Expand Down Expand Up @@ -84,6 +100,31 @@ CIDX has **three operational modes**. Understanding which mode you're working in
- Real-time vs batch updates
- Performance optimizations

### MCP Protocol (Server Mode)

**Protocol Version**: `2024-11-05` (Model Context Protocol)

**Initialize Handshake** (CRITICAL for Claude Code connection):
- Method: `initialize` - MUST be first client-server interaction
- Server Response: `{ "protocolVersion": "2024-11-05", "capabilities": { "tools": {} }, "serverInfo": { "name": "CIDX", "version": "7.3.0" } }`
- Implemented in: `src/code_indexer/server/mcp/protocol.py` (process_jsonrpc_request)
- Required for OAuth flow completion - Claude Code calls `initialize` after authentication

**Key Points**:
- Without `initialize` method, Claude Code fails with "Method not found: initialize"
- Must return protocolVersion, capabilities (with tools), and serverInfo (name + version)
- Tests in: `tests/unit/server/mcp/test_protocol.py::TestInitializeMethod`

**Tool Response Format** (CRITICAL for Claude Code compatibility):
- All tool results MUST return `content` as an **array of content blocks**, NOT a string
- Each content block must have: `{ "type": "text", "text": "actual content here" }`
- Empty content should be `[]`, NOT `""` or missing
- Error responses must also include `content: []` (empty array is valid)
- Example: `{ "success": true, "content": [{"type": "text", "text": "file contents"}], "metadata": {...} }`
- Violating this format causes Claude Code to fail with "Expected array, received string"
- Implemented in: `src/code_indexer/server/mcp/handlers.py` (all tool handlers)
- Tests in: `tests/unit/server/mcp/test_handlers.py::TestFileHandlers::test_get_file_content`

---

## 3. Daily Development Workflows
Expand Down Expand Up @@ -337,13 +378,15 @@ cidx query "def.*" --fts --regex # FTS/regex search
```

**Key Flags** (ALWAYS use `--quiet`):
- `--limit N` - Results (default 10)
- `--limit N` - Results (default 10, start with 5-10 to conserve context window)
- `--language python` - Filter by language
- `--path-filter */tests/*` - Path pattern
- `--min-score 0.8` - Similarity threshold
- `--accuracy high` - Higher precision
- `--quiet` - Minimal output

**Context Conservation**: Start with low `--limit` values (5-10) on initial queries. High limits consume context window rapidly when results contain large code files.

**Search Decision**:
- ✅ "What code does", "Where is X implemented" → CIDX
- ❌ Exact strings (variable names, config) → grep/find
Expand Down
1 change: 0 additions & 1 deletion file1.py

This file was deleted.

225 changes: 0 additions & 225 deletions plans/.archived/00_Surgical_Integration_Specification.md

This file was deleted.

Loading
Loading