Archon/python/tests
Cole Medin 34a51ec362
feat: MCP server optimization with tool consolidation and vertical sl… (#647)
* feat: MCP server optimization with tool consolidation and vertical slice architecture

- Consolidated MCP tools from ~20 to 8 tools for improved UX
- Restructured to vertical slice architecture (features/domain pattern)
- Optimized payload sizes with truncation and array count replacements
- Changed default include_closed to true for better task visibility
- Moved RAG module to features directory structure
- Removed legacy modules directory in favor of feature-based organization

Key improvements:
- list_tasks, manage_task (create/update/delete consolidated)
- list_projects, manage_project (create/update/delete consolidated)
- list_documents, manage_document (create/update/delete consolidated)
- list_versions, manage_version (create/restore consolidated)
- Reduced default page size from 50 to 10 items
- Added search query support to list operations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: Consolidate MCP tools and rename list_* to find_*

Major refactoring of MCP tools to reduce complexity and improve naming:

## Tool Consolidation (22 → ~10 tools)
- Consolidated CRUD operations into two tools per domain:
  - find_[resource]: Handles list, search, and get single item
  - manage_[resource]: Handles create, update, delete with "action" parameter
- Removed backward compatibility/legacy function mappings
- Optimized response payloads with truncation (1000 char limit for projects/tasks)

## Renamed Functions
- list_projects → find_projects
- list_tasks → find_tasks
- list_documents → find_documents
- list_versions → find_versions

## Bug Fixes
- Fixed supabase query chaining bug where .or_() calls overwrote previous conditions
- Fixed search implementation to handle single vs multiple terms correctly

## Test Updates
- Updated all tests to use new consolidated tools
- Removed problematic test_consolidated_tools.py
- Fixed error type assertions to match actual responses
- All 44 tests passing

## Documentation Updates
- Updated CLAUDE.md with new tool names and patterns
- Updated MCP instructions with consolidated tool examples
- Added guidance to avoid backward compatibility code

## API Changes
- Updated API route defaults: include_closed=True, per_page=10
- Aligned defaults with consolidated tool implementations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-13 10:52:14 -05:00
..
mcp_server feat: MCP server optimization with tool consolidation and vertical sl… (#647) 2025-09-13 10:52:14 -05:00
progress_tracking feat: TanStack Query Migration Phase 3 - Knowledge Base Feature (#605) 2025-09-12 16:45:18 +03:00
server refactor: Remove Socket.IO and implement HTTP polling architecture (#514) 2025-09-02 14:41:35 -05:00
__init__.py The New Archon (Beta) - The Operating System for AI Coding Assistants! 2025-08-13 07:58:24 -05:00
conftest.py feat: TanStack Query Migration Phase 3 - Knowledge Base Feature (#605) 2025-09-12 16:45:18 +03:00
test_api_essentials.py refactor: Remove Socket.IO and implement HTTP polling architecture (#514) 2025-09-02 14:41:35 -05:00
test_async_credential_service.py feat: TanStack Query Migration Phase 3 - Knowledge Base Feature (#605) 2025-09-12 16:45:18 +03:00
test_async_embedding_service.py refactor: Remove Socket.IO and implement HTTP polling architecture (#514) 2025-09-02 14:41:35 -05:00
test_async_llm_provider_service.py The New Archon (Beta) - The Operating System for AI Coding Assistants! 2025-08-13 07:58:24 -05:00
test_async_source_summary.py Fix race condition in concurrent crawling with unique source IDs (#472) 2025-08-29 14:54:16 +03:00
test_business_logic.py refactor: Remove Socket.IO and implement HTTP polling architecture (#514) 2025-09-02 14:41:35 -05:00
test_code_extraction_source_id.py feat: TanStack Query Migration Phase 3 - Knowledge Base Feature (#605) 2025-09-12 16:45:18 +03:00
test_crawl_orchestration_isolated.py The New Archon (Beta) - The Operating System for AI Coding Assistants! 2025-08-13 07:58:24 -05:00
test_document_storage_metrics.py refactor: Remove Socket.IO and implement HTTP polling architecture (#514) 2025-09-02 14:41:35 -05:00
test_embedding_service_no_zeros.py The New Archon (Beta) - The Operating System for AI Coding Assistants! 2025-08-13 07:58:24 -05:00
test_keyword_extraction.py The New Archon (Beta) - The Operating System for AI Coding Assistants! 2025-08-13 07:58:24 -05:00
test_knowledge_api_integration.py feat: TanStack Query Migration Phase 3 - Knowledge Base Feature (#605) 2025-09-12 16:45:18 +03:00
test_knowledge_api_pagination.py feat: TanStack Query Migration Phase 3 - Knowledge Base Feature (#605) 2025-09-12 16:45:18 +03:00
test_port_configuration.py The New Archon (Beta) - The Operating System for AI Coding Assistants! 2025-08-13 07:58:24 -05:00
test_progress_api.py feat: TanStack Query Migration Phase 3 - Knowledge Base Feature (#605) 2025-09-12 16:45:18 +03:00
test_rag_simple.py Enhanced the hybrid search strategy with tsvector keyword matching (#539) 2025-09-10 14:23:49 +03:00
test_rag_strategies.py Enhanced the hybrid search strategy with tsvector keyword matching (#539) 2025-09-10 14:23:49 +03:00
test_service_integration.py refactor: Remove Socket.IO and implement HTTP polling architecture (#514) 2025-09-02 14:41:35 -05:00
test_settings_api.py Add Supabase key validation and simplify frontend state management 2025-08-16 00:10:23 +03:00
test_source_id_refactor.py CI fails now when unit tests for backend fail (#536) 2025-08-30 12:52:34 -05:00
test_source_race_condition.py refactor: Remove Socket.IO and implement HTTP polling architecture (#514) 2025-09-02 14:41:35 -05:00
test_source_url_shadowing.py refactor: Remove Socket.IO and implement HTTP polling architecture (#514) 2025-09-02 14:41:35 -05:00
test_supabase_validation.py Removing references to Archon "Alpha" 2025-09-06 14:51:02 -05:00
test_task_counts.py refactor: Remove Socket.IO and implement HTTP polling architecture (#514) 2025-09-02 14:41:35 -05:00
test_token_optimization_integration.py fix: include_archived flag now works correctly in task listing 2025-08-27 11:05:33 +03:00
test_token_optimization.py Fix critical token consumption issue in list endpoints (#488) 2025-08-26 23:55:58 +03:00
test_url_canonicalization.py Fix race condition in concurrent crawling with unique source IDs (#472) 2025-08-29 14:54:16 +03:00
test_url_handler.py Fix crawler attempting to navigate to binary files 2025-08-15 17:24:46 +03:00