mcp-code-indexer 4.0.0__py3-none-any.whl → 4.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1039,7 +1039,19 @@ class MCPCodeIndexServer:
1039
1039
 
1040
1040
  total_tokens = descriptions_tokens + overview_tokens
1041
1041
  is_large = total_tokens > token_limit
1042
- recommendation = "use_search" if is_large else "use_overview"
1042
+
1043
+ # Smart recommendation logic:
1044
+ # - If total is small, use overview
1045
+ # - If total is large but overview is reasonable (< 8k tokens), recommend viewing overview + search
1046
+ # - If both are large, use search only
1047
+ overview_size_limit = 32000
1048
+
1049
+ if not is_large:
1050
+ recommendation = "use_overview"
1051
+ elif overview_tokens > 0 and overview_tokens <= overview_size_limit:
1052
+ recommendation = "view_overview_then_search"
1053
+ else:
1054
+ recommendation = "use_search"
1043
1055
 
1044
1056
  logger.info(
1045
1057
  f"Codebase analysis complete: {total_tokens} tokens total "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: mcp-code-indexer
3
- Version: 4.0.0
3
+ Version: 4.0.1
4
4
  Summary: MCP server that tracks file descriptions across codebases, enabling AI agents to efficiently navigate and understand code through searchable summaries and token-aware overviews.
5
5
  License: MIT
6
6
  Keywords: mcp,model-context-protocol,code-indexer,ai-tools,codebase-navigation,file-descriptions,llm-tools
@@ -43,8 +43,8 @@ Description-Content-Type: text/markdown
43
43
 
44
44
  # MCP Code Indexer 🚀
45
45
 
46
- [![PyPI version](https://badge.fury.io/py/mcp-code-indexer.svg?43)](https://badge.fury.io/py/mcp-code-indexer)
47
- [![Python](https://img.shields.io/pypi/pyversions/mcp-code-indexer.svg?43)](https://pypi.org/project/mcp-code-indexer/)
46
+ [![PyPI version](https://badge.fury.io/py/mcp-code-indexer.svg?44)](https://badge.fury.io/py/mcp-code-indexer)
47
+ [![Python](https://img.shields.io/pypi/pyversions/mcp-code-indexer.svg?44)](https://pypi.org/project/mcp-code-indexer/)
48
48
  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
49
49
 
50
50
  A production-ready **Model Context Protocol (MCP) server** that revolutionizes how AI agents navigate and understand codebases. Built for high-concurrency environments with advanced database resilience, the server provides instant access to intelligent descriptions, semantic search, and context-aware recommendations while maintaining 800+ writes/sec throughput.
@@ -80,6 +80,43 @@ mcp-code-indexer
80
80
  # See API Reference for complete tool documentation
81
81
  ```
82
82
 
83
+ ### 🌐 For Web Applications
84
+
85
+ Enable HTTP/REST API access for browser-based applications:
86
+
87
+ ```bash
88
+ # Start HTTP server with authentication
89
+ mcp-code-indexer --http --auth-token "your-secret-token"
90
+
91
+ # Custom host and port
92
+ mcp-code-indexer --http --host 0.0.0.0 --port 8080
93
+
94
+ # CORS configuration for web apps
95
+ mcp-code-indexer --http --cors-origins "https://localhost:3000" "https://myapp.com"
96
+ ```
97
+
98
+ **🔗 [Complete HTTP API Reference →](docs/http-api.md)**
99
+
100
+ ### 🤖 For AI-Powered Q&A
101
+
102
+ Ask questions about your codebase using natural language:
103
+
104
+ ```bash
105
+ # Set OpenRouter API key for Claude access
106
+ export OPENROUTER_API_KEY="your-openrouter-api-key"
107
+
108
+ # Simple questions about project architecture
109
+ mcp-code-indexer --ask "What does this project do?" my-project
110
+
111
+ # Enhanced analysis with file search
112
+ mcp-code-indexer --deepask "How is authentication implemented?" web-app
113
+
114
+ # JSON output for programmatic use
115
+ mcp-code-indexer --ask "List the main components" my-project --json
116
+ ```
117
+
118
+ **🤖 [Complete Q&A Interface Guide →](docs/qa-interface.md)**
119
+
83
120
  ### 🔧 For System Administrators
84
121
 
85
122
  Deploy and configure the server for your team:
@@ -309,12 +346,16 @@ Comprehensive documentation organized by user journey and expertise level.
309
346
  | Guide | Purpose | Time Investment |
310
347
  |-------|---------|-----------------|
311
348
  | **[Quick Start](#-quick-start)** | Install and run your first server | 2 minutes |
312
- | **[Git Hook Setup](docs/git-hook-setup.md)** | Automate your workflow | 5 minutes |
313
349
  | **[API Reference](docs/api-reference.md)** | Master all 11 MCP tools | 15 minutes |
350
+ | **[HTTP API Reference](docs/http-api.md)** | REST API for web applications | 10 minutes |
351
+ | **[Q&A Interface](docs/qa-interface.md)** | AI-powered codebase analysis | 8 minutes |
352
+ | **[Git Hook Setup](docs/git-hook-setup.md)** | Automate your workflow | 5 minutes |
314
353
 
315
354
  ### 🏗️ Production Deployment (Teams & Admins)
316
355
  | Guide | Focus | Best For |
317
356
  |-------|-------|----------|
357
+ | **[CLI Reference](docs/cli-reference.md)** | Complete command documentation | All users |
358
+ | **[Administrative Commands](docs/admin-commands.md)** | Project & database management | System administrators |
318
359
  | **[Configuration Guide](docs/configuration.md)** | Production setup & tuning | System administrators |
319
360
  | **[Performance Tuning](docs/performance-tuning.md)** | High-concurrency optimization | DevOps teams |
320
361
  | **[Monitoring & Diagnostics](docs/monitoring.md)** | Production monitoring | Operations teams |
@@ -332,8 +373,10 @@ Comprehensive documentation organized by user journey and expertise level.
332
373
  - **[API Tools Summary](#🛠️-mcp-tools-available)** - All 11 tools at a glance
333
374
 
334
375
  **📚 Reading Paths:**
335
- - **New to MCP Code Indexer?** Quick Start → Git Hooks → API Reference
336
- - **Setting up for a team?** ConfigurationPerformanceMonitoring
376
+ - **New to MCP Code Indexer?** Quick Start → API ReferenceHTTP API → Q&A Interface
377
+ - **Web developers?** Quick Start HTTP API Reference Q&A Interface Git Hooks
378
+ - **AI/ML engineers?** Quick Start → Q&A Interface → API Reference → Git Hooks
379
+ - **Setting up for a team?** CLI Reference → Configuration → Administrative Commands → Monitoring
337
380
  - **Contributing to the project?** Architecture → Contributing → API Reference
338
381
 
339
382
  ## 🚦 System Requirements
@@ -518,7 +561,31 @@ mcp-code-indexer --githook [OPTIONS]
518
561
  # Requires: OPENROUTER_API_KEY environment variable
519
562
  ```
520
563
 
521
- ### Utility Commands
564
+ ### HTTP Server Mode
565
+ ```bash
566
+ # Start HTTP/REST API server
567
+ mcp-code-indexer --http [OPTIONS]
568
+
569
+ # HTTP server with authentication
570
+ mcp-code-indexer --http --auth-token "your-secret-token"
571
+
572
+ # Custom host and port configuration
573
+ mcp-code-indexer --http --host 0.0.0.0 --port 8080
574
+ ```
575
+
576
+ ### Q&A Commands
577
+ ```bash
578
+ # Simple AI-powered questions (requires OPENROUTER_API_KEY)
579
+ mcp-code-indexer --ask "What does this project do?" PROJECT_NAME
580
+
581
+ # Enhanced analysis with file search
582
+ mcp-code-indexer --deepask "How is authentication implemented?" PROJECT_NAME
583
+
584
+ # JSON output for programmatic use
585
+ mcp-code-indexer --ask "Question" PROJECT_NAME --json
586
+ ```
587
+
588
+ ### Administrative Commands
522
589
  ```bash
523
590
  # List all projects
524
591
  mcp-code-indexer --getprojects
@@ -528,6 +595,12 @@ mcp-code-indexer --runcommand '{"method": "tools/call", "params": {...}}'
528
595
 
529
596
  # Export descriptions for a project
530
597
  mcp-code-indexer --dumpdescriptions PROJECT_ID
598
+
599
+ # Create local database for a project
600
+ mcp-code-indexer --makelocal /path/to/project
601
+
602
+ # Generate project documentation map
603
+ mcp-code-indexer --map PROJECT_NAME
531
604
  ```
532
605
 
533
606
  ## 🛡️ Security Features
@@ -546,8 +619,10 @@ mcp-code-indexer --dumpdescriptions PROJECT_ID
546
619
  |-------|-----------|------------|
547
620
  | **"No module named 'mcp_code_indexer'"** | `pip install -e .` (for development) | [Contributing Guide](docs/contributing.md#development-setup) |
548
621
  | **"OPENROUTER_API_KEY not found"** | `export OPENROUTER_API_KEY="your-key"` | [Git Hook Setup](docs/git-hook-setup.md#prerequisites) |
549
- | **"Database is locked"** | Enable WAL mode: `--enable-wal-mode` | [Performance Tuning](docs/performance-tuning.md#database-configuration) |
622
+ | **"Database is locked"** | Enable WAL mode: `--enable-wal-mode` | [CLI Reference](docs/cli-reference.md#database-configuration) |
550
623
  | **"Large codebase - use search"** | Normal for 200+ files. Use `search_descriptions` | [API Reference](docs/api-reference.md#search_descriptions) |
624
+ | **HTTP authentication failed** | Check `--auth-token` configuration | [HTTP API Reference](docs/http-api.md#authentication) |
625
+ | **Q&A commands not working** | Set `OPENROUTER_API_KEY` environment variable | [Q&A Interface](docs/qa-interface.md#getting-started) |
551
626
  | **High memory usage** | Reduce token limit: `--token-limit 10000` | [Configuration Guide](docs/configuration.md#performance-tuning) |
552
627
 
553
628
  **💡 Not finding your issue?** Check the [complete troubleshooting guides](docs/monitoring.md#troubleshooting-runbook) in our documentation.
@@ -560,13 +635,17 @@ Ready to supercharge your AI agents with intelligent codebase navigation?
560
635
 
561
636
  **🆕 New to MCP Code Indexer?**
562
637
  1. **[Install and run your first server](#-quick-start)** - Get up and running in 2 minutes
563
- 2. **[Set up git hooks](docs/git-hook-setup.md)** - Automate your workflow
564
- 3. **[Master the API tools](docs/api-reference.md)** - Learn all 11 tools with examples
638
+ 2. **[Master the API tools](docs/api-reference.md)** - Learn all 11 tools with examples
639
+ 3. **[Try HTTP API access](docs/http-api.md)** - REST API for web applications
640
+ 4. **[Explore AI-powered Q&A](docs/qa-interface.md)** - Ask questions about your code
641
+ 5. **[Set up git hooks](docs/git-hook-setup.md)** - Automate your workflow
565
642
 
566
643
  **👥 Setting up for a team?**
567
- 1. **[Configure for production](docs/configuration.md)** - Production deployment guide
568
- 2. **[Performance optimization](docs/performance-tuning.md)** - High-concurrency setup
569
- 3. **[Monitoring & alerts](docs/monitoring.md)** - Production monitoring
644
+ 1. **[Learn all CLI commands](docs/cli-reference.md)** - Complete command reference
645
+ 2. **[Configure for production](docs/configuration.md)** - Production deployment guide
646
+ 3. **[Set up administrative workflows](docs/admin-commands.md)** - Project & database management
647
+ 4. **[Performance optimization](docs/performance-tuning.md)** - High-concurrency setup
648
+ 5. **[Monitoring & alerts](docs/monitoring.md)** - Production monitoring
570
649
 
571
650
  **🔧 Want to contribute?**
572
651
  1. **[Understand the architecture](docs/architecture.md)** - Technical deep dive
@@ -32,7 +32,7 @@ mcp_code_indexer/migrations/004_remove_branch_dependency.sql,sha256=whZvj2qfba1-
32
32
  mcp_code_indexer/migrations/005_remove_git_remotes.sql,sha256=vT84AaV1hyN4zq5W67hR14TgAwhW7_RNtBHrCoksxA4,1299
33
33
  mcp_code_indexer/query_preprocessor.py,sha256=PLFR1T9mSn2Mkxw6-GB4GkxyfzjJ2ia3dgLPcziHfVA,5483
34
34
  mcp_code_indexer/server/__init__.py,sha256=16xMcuriUOBlawRqWNBk6niwrvtv_JD5xvI36X1Vsmk,41
35
- mcp_code_indexer/server/mcp_server.py,sha256=IxZ3I2Nzb3rOKBkrwICPFRTfpbu-gIz-fOoeMtF5v5A,73286
35
+ mcp_code_indexer/server/mcp_server.py,sha256=ha92MQgn0Uut-fa3YE7zmqoG30vln-y2LK3Fl4L2MFI,73766
36
36
  mcp_code_indexer/tiktoken_cache/9b5ad71b2ce5302211f9c61530b329a4922fc6a4,sha256=Ijkht27pm96ZW3_3OFE-7xAPtR0YyTWXoRO8_-hlsqc,1681126
37
37
  mcp_code_indexer/token_counter.py,sha256=e6WsyCEWMMSkMwLbcVtr5e8vEqh-kFqNmiJErCNdqHE,8220
38
38
  mcp_code_indexer/tools/__init__.py,sha256=m01mxML2UdD7y5rih_XNhNSCMzQTz7WQ_T1TeOcYlnE,49
@@ -40,8 +40,8 @@ mcp_code_indexer/transport/__init__.py,sha256=eEemczZYdcUdTdzX2Lr0tDrtZzn7LJh_-T
40
40
  mcp_code_indexer/transport/base.py,sha256=UlsXRCWayT5zxalHmTTj6l3tcqM7wgbNC02PyQ-i_bM,3378
41
41
  mcp_code_indexer/transport/http_transport.py,sha256=uct-LzUi87qsmFL8qaJ3sMkz683evwbVziii-0xlCpE,13287
42
42
  mcp_code_indexer/transport/stdio_transport.py,sha256=BCz9NKsiO9k0zCsuxBxt880plFL6Ri34wCiRgz0dRqE,4738
43
- mcp_code_indexer-4.0.0.dist-info/LICENSE,sha256=JN9dyPPgYwH9C-UjYM7FLNZjQ6BF7kAzpF3_4PwY4rY,1086
44
- mcp_code_indexer-4.0.0.dist-info/METADATA,sha256=cczMML6JeXTTH6EHkNRuOV-rPndOjVlPKF5PiXVSgiI,22196
45
- mcp_code_indexer-4.0.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
46
- mcp_code_indexer-4.0.0.dist-info/entry_points.txt,sha256=UABj7HZ0mC6rvF22gxaz2LLNLGQShTrFmp5u00iUtvo,67
47
- mcp_code_indexer-4.0.0.dist-info/RECORD,,
43
+ mcp_code_indexer-4.0.1.dist-info/LICENSE,sha256=JN9dyPPgYwH9C-UjYM7FLNZjQ6BF7kAzpF3_4PwY4rY,1086
44
+ mcp_code_indexer-4.0.1.dist-info/METADATA,sha256=l5MD9myovdAkbvu5NOeXixJ0iAzOfb7fZZbvkrT6RoM,25254
45
+ mcp_code_indexer-4.0.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
46
+ mcp_code_indexer-4.0.1.dist-info/entry_points.txt,sha256=UABj7HZ0mC6rvF22gxaz2LLNLGQShTrFmp5u00iUtvo,67
47
+ mcp_code_indexer-4.0.1.dist-info/RECORD,,