Commit Graph

172 Commits

Author SHA1 Message Date
Rasmus Widing
28eede38b5 fix(mcp): Fix update_task signature and MCP instructions
Resolves #420 - Tasks being duplicated instead of updated

Changes:
1. Fixed update_task function signature to use individual optional parameters
   - Changed from TypedDict to explicit parameters (title, status, etc.)
   - Consistent with update_project and update_document patterns
   - Builds update_fields dict internally from provided parameters

2. Updated MCP instructions with correct function names
   - Replaced non-existent manage_task with actual functions
   - Added complete function signatures for all tools
   - Improved workflow documentation with concrete examples

This fixes the issue where AI agents were confused by:
- Wrong function names in instructions (manage_task vs update_task)
- Inconsistent parameter patterns across update functions
- TypedDict magic that wasn't clearly documented

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-21 22:11:10 +03:00
Nadjib Boubrim
45750c3d31 feat: Add Gemini CLI support to MCPPage and IDEGlobalRules 2025-08-21 21:20:26 +03:00
Tim Carter
3608842f78 Fix business document categorization bug
- Fixed missing knowledge_type and tags parameters in DocumentStorageService.upload_document()
- Added source_type='file' to document chunk metadata for proper categorization
- Enhanced source metadata creation to include source_type based on source_id pattern
- Fixed metadata spread order in knowledge_item_service to prevent source_type override
- Business documents now correctly show pink color theme and appear in Business Documents section

Fixes issue where business documents were incorrectly stored as technical knowledge
and appeared with blue color theme instead of pink.
2025-08-21 21:10:36 +03:00
John C Fitzpatrick
eb526af689
fix: Allow HTTP for all private network ranges in Supabase URLs (#417)
* fix: Allow HTTP for all private network ranges in Supabase URLs

- Extend HTTP support to all RFC 1918 private IP ranges
- Class A: 10.0.0.0 to 10.255.255.255 (10.0.0.0/8)
- Class B: 172.16.0.0 to 172.31.255.255 (172.16.0.0/12)
- Class C: 192.168.0.0 to 192.168.255.255 (192.168.0.0/16)
- Also includes link-local (169.254.0.0/16) addresses
- Uses Python's ipaddress module for robust IP validation
- Maintains HTTPS requirement for public/production URLs
- Backwards compatible with existing localhost exceptions

* security: Fix URL validation vulnerabilities

- Replace substring matching with exact hostname matching to prevent bypass attacks
- Exclude unspecified address (0.0.0.0) from allowed HTTP hosts
- Add support for .localhost domains per RFC 6761
- Improve error messages with hostname context for better debugging

Addresses security concerns raised in PR review regarding:
- Malicious domains like 'localhost.attacker.com' bypassing HTTPS requirements
- Unspecified address being incorrectly allowed as valid connection target

---------

Co-authored-by: tazmon95 <tazmon95@users.noreply.github.com>
Co-authored-by: root <root@supatest2.jtpa.net>
2025-08-21 11:06:25 -07:00
Cole Medin
6f7c08eeb7 Important updates to CONTRIBUTING.md and README 2025-08-21 11:44:32 -05:00
Arman Rafiee
16bde51403
Update README.md (#410)
added star history at end of readme
2025-08-21 06:21:33 -05:00
Cole Medin
8b29d207d8
Update docker-compose.yml
Adding host.docker.internal:host-gateway to Docker Compose for the server and agents.
2025-08-20 07:01:16 -05:00
Wirasm
b5e18b9569
Merge pull request #306 from coleam00/feature/mcp-server-consolidation-simplification
Refactor MCP server: Modularize tools and add comprehensive tests
2025-08-20 12:20:13 +03:00
Rasmus Widing
5bdf9d924d style: Apply linting fixes and formatting
Applied automated linting and formatting:
- Fixed missing newlines at end of files
- Adjusted line wrapping for better readability
- Fixed multi-line string formatting in tests
- No functional changes, only style improvements

All 43 tests still passing after formatting changes.
2025-08-19 17:01:50 +03:00
Rasmus Widing
d7e102582d fix(mcp): Address all priority actions from PR review
Based on latest PR #306 review feedback:

Fixed Issues:
- Replaced last remaining basic error handling with MCPErrorFormatter
  in version_tools.py get_version function
- Added proper error handling for invalid env vars in get_max_polling_attempts
- Improved type hints with TaskUpdateFields TypedDict for better validation
- All tools now consistently use get_default_timeout() (verified with grep)

Test Improvements:
- Added comprehensive tests for MCPErrorFormatter utility (10 tests)
- Added tests for timeout_config utility (13 tests)
- All 43 MCP tests passing with new utilities
- Tests verify structured error format and timeout configuration

Type Safety:
- Created TaskUpdateFields TypedDict to specify exact allowed fields
- Documents valid statuses and assignees in type comments
- Improves IDE support and catches type errors at development time

This completes all priority actions from the review:
 Fixed inconsistent timeout usage (was already done)
 Fixed error handling inconsistency
 Improved type hints for update_fields
 Added tests for utility modules
2025-08-19 16:54:49 +03:00
Rasmus Widing
ed6479b4c3 refactor(mcp): Apply consistent error handling to all MCP tools
Comprehensive update to MCP server error handling:

Error Handling Improvements:
- Applied MCPErrorFormatter to all remaining MCP tool files
- Replaced all hardcoded timeout values with configurable timeout system
- Converted all simple string errors to structured error format
- Added proper httpx exception handling with detailed context

Tools Updated:
- document_tools.py: All 5 document management tools
- version_tools.py: All 4 version management tools
- feature_tools.py: Project features tool
- project_tools.py: Remaining 3 project tools (get, list, delete)
- task_tools.py: Remaining 4 task tools (get, list, update, delete)

Test Improvements:
- Removed backward compatibility checks from all tests
- Tests now enforce structured error format (dict not string)
- Any string error response is now considered a bug
- All 20 tests passing with new strict validation

This completes the error handling refactor for all MCP tools,
ensuring consistent client experience and better debugging.
2025-08-19 16:07:07 +03:00
Rasmus Widing
cf3d7b17fe feat(mcp): Add robust error handling and timeout configuration
Critical improvements to MCP server reliability and client experience:

Error Handling:
- Created MCPErrorFormatter for consistent error responses across all tools
- Provides structured errors with type, message, details, and actionable suggestions
- Helps clients (like Claude Code) understand and handle failures gracefully
- Categorizes errors (connection_timeout, validation_error, etc.) for better debugging

Timeout Configuration:
- Centralized timeout config with environment variable support
- Different timeouts for regular operations vs polling operations
- Configurable via MCP_REQUEST_TIMEOUT, MCP_CONNECT_TIMEOUT, etc.
- Prevents indefinite hangs when services are unavailable

Module Registration:
- Distinguishes between ImportError (acceptable) and code errors (must fix)
- SyntaxError/NameError/AttributeError now halt execution immediately
- Prevents broken code from silently failing in production

Polling Safety:
- Fixed project creation polling with exponential backoff
- Handles API unavailability with proper error messages
- Maximum attempts configurable via MCP_MAX_POLLING_ATTEMPTS

Response Normalization:
- Fixed inconsistent response handling in list_tasks
- Validates and normalizes different API response formats
- Clear error messages when response format is unexpected

These changes address critical issues from PR review while maintaining
backward compatibility. All 20 existing tests pass.
2025-08-19 15:38:13 +03:00
Sanath Kumar U
cd22089b87
Update README.md (#332)
Makes it easier to copy paste & run the command in on single shot
2025-08-19 07:22:04 -05:00
Thilanga Pitigala
913cdcd349
Fix: Allow HTTP for local Supabase connections (#323)
- Modified validate_supabase_url() to allow HTTP for local development
- HTTP is now allowed for localhost, 127.0.0.1, host.docker.internal, and 0.0.0.0
- HTTPS is still required for production/non-local environments
- Fixes server startup failure when using local Supabase with Docker
2025-08-19 07:07:25 -05:00
Rasmus Widing
b5e5cddc68 Remove claude-review-fork.yml workflow
The Claude Code Action is not compatible with reviewing PRs from forks.
It always attempts to checkout the PR branch which fails for security reasons.
2025-08-19 11:16:37 +03:00
Rasmus Widing
db142280e2 fix: Restructure fork review workflow to avoid PR branch checkout
- Create isolated review context directory to prevent PR detection
- Move diff to changes.patch file in review-context directory
- Add explicit REVIEW_INSTRUCTIONS.md file for guidance
- Use standard 'prompt' parameter instead of 'override_prompt'
- This approach should prevent Claude Action from auto-detecting PR context
2025-08-19 11:05:06 +03:00
Rasmus Widing
6a23a57b26 Override event context to prevent PR checkout
- Set GITHUB_EVENT_NAME to workflow_dispatch to avoid PR detection
- Use override_prompt instead of direct_prompt for better control
- Create wrapper script for debugging
- Explicitly tell Claude not to checkout code
2025-08-19 11:02:47 +03:00
Rasmus Widing
a00883ac5e Fix Claude checkout issue for forked PRs
- Add environment overrides to prevent PR branch checkout
- Add explicit github_token for authentication
- Add direct_prompt to guide Claude to use diff file
- Override GITHUB_REF and GITHUB_SHA to stay on base branch
2025-08-19 11:00:33 +03:00
Rasmus Widing
506cbc18c4 Simplify fork PR review to single workflow with pull_request_target
- Remove complex two-stage workflow approach
- Use pull_request_target with security safeguards
- Add first-time contributor check and approval requirement
- Never checkout PR code - only analyze diff
- Mirror full review format from main claude-review workflow
- Manual trigger via @claude-review-fork for maintainers
2025-08-19 10:57:25 +03:00
Rasmus Widing
ea42f7a2ac Remove invalid mode parameter and improve event context
- Remove invalid mode: review parameter
- Update event context to simulate issue_comment
- Add direct_prompt to guide Claude to review the diff
- Update instructions to use Read tool for pr-diff.patch
2025-08-19 10:47:57 +03:00
Rasmus Widing
933d2deb3b Fix Claude Code Action authentication and context issues
- Remove invalid pr_number parameter
- Add explicit github_token to fix OIDC failure in workflow_run
- Add mode: review for proper review mode
- Create fake event.json to provide PR context
- Set environment variables to simulate PR event
2025-08-19 10:43:47 +03:00
Rasmus Widing
e554f7b1ae Fix exec declaration error in Stage 2 workflow
- Replace async exec with execSync to avoid declaration issues
- Add proper error handling for artifact extraction
- Use childProcess module directly instead of destructuring
2025-08-19 10:39:50 +03:00
Rasmus Widing
e46c5f7b07 Simplify authorization for external PR workflows
- Move authorization check to Stage 1 job condition
- Remove complex authorization job from Stage 2
- Fix duplicate exec declaration error
- Add unauthorized user message handling in Stage 1
- Trust Stage 1's authorization in Stage 2
2025-08-19 10:34:50 +03:00
Rasmus Widing
8f96ea9044 Fix external PR workflow permissions and error handling
- Grant pull-requests write permission for comment posting
- Add try-catch error handling with continue-on-error
- Ensure workflow continues even if comment posting fails
2025-08-19 10:29:58 +03:00
Wirasm
00a8157cac
Merge pull request #325 from coleam00/feature/external-pr-claude-review
Add two-stage workflow for secure Claude reviews on forked PRs
2025-08-19 10:23:41 +03:00
Rasmus Widing
c79040ad4a Fix base branch checkout in Stage 2 workflow
- Extract PR base branch from artifact instead of using workflow branch
- Add step to switch to correct base branch after downloading PR info
- Use PR base branch for diff generation instead of workflow branch
2025-08-19 10:19:36 +03:00
Rasmus Widing
0bb97d8e26 Add documentation for external PR review workflows
- Explains the two-stage security model
- Provides usage instructions for contributors and maintainers
- Includes troubleshooting and security considerations
2025-08-19 10:09:59 +03:00
Rasmus Widing
fc97b4f5bd Add Stage 2 secure review workflow for external PRs
- Runs after Stage 1 via workflow_run trigger
- Has access to repository secrets
- Downloads PR artifact and performs review
- Maintains security by never checking out fork code
2025-08-19 10:09:45 +03:00
Rasmus Widing
d64745991b Add Stage 1 workflow for external PR info collection
- Collects PR information without requiring secrets
- Triggers on pull_request events and @claude-review-ext comments
- Uploads PR details as artifact for secure processing
2025-08-19 10:09:30 +03:00
Wirasm
92b3c047e1
Merge pull request #301 from ericfisherdev/fix/feature-field-not-updating
Issue 282: Fix missing feature field in project tasks API response
2025-08-19 09:46:01 +03:00
Cole Medin
46e8358422 Updating the Logo for Archon 2025-08-18 13:59:49 -05:00
Wirasm
a29b541a77
Merge pull request #289 from coleam00/fix/document-deletion-persistence
Fix document deletion persistence issue (#278)
2025-08-18 21:19:57 +03:00
Wirasm
667cae2846
Merge pull request #232 from coleam00/fix/supabase-key-validation-and-state-consolidation
Fix Supabase key validation and consolidate frontend state management
2025-08-18 21:19:27 +03:00
Rasmus Widing
307e0e3b71 Add comprehensive unit tests for MCP server features
- Create test structure mirroring features folder organization
- Add tests for document tools (create, list, update, delete)
- Add tests for version tools (create, list, restore, invalid field handling)
- Add tests for task tools (create with sources, list with filters, update, delete)
- Add tests for project tools (create with polling, list, get)
- Add tests for feature tools (get features with various structures)
- Mock HTTP client for all external API calls
- Test both success and error scenarios
- 100% test coverage for critical tool functions
2025-08-18 21:04:35 +03:00
Rasmus Widing
e8cffde80e Fix type errors and remove trailing whitespace
- Add explicit type annotations for params dictionaries to resolve mypy errors
- Remove trailing whitespace from blank lines (W293 ruff warnings)
- Ensure type safety in task_tools.py and document_tools.py
2025-08-18 20:53:20 +03:00
Rasmus Widing
d5bfaba3af Clean up unused imports in RAG module
Remove import of deleted project_module.
2025-08-18 20:42:49 +03:00
Rasmus Widing
d01e27adc3 Update MCP Dockerfile to support new module structure
Create documents directory and ensure all new modules are properly
included in the container build.
2025-08-18 20:42:42 +03:00
Rasmus Widing
52f54699e9 Register all separated tools in MCP server
Update MCP server to use the new modular tool structure:
- Projects and tasks from existing modules
- Documents and versions from new modules
- Feature management from standalone module

Remove all feature flag logic as separated tools are now default.
2025-08-18 20:42:36 +03:00
Rasmus Widing
89f53d37c8 Update project tools to use simplified approach
Remove complex PRP validation logic and focus on core functionality.
Maintains backward compatibility with existing API endpoints.
2025-08-18 20:42:28 +03:00
Rasmus Widing
47d2200383 Add feature management tool for project capabilities
Extract get_project_features as a standalone tool with enhanced
documentation explaining feature structures and usage patterns.
Features track functional components like auth, api, and database.
2025-08-18 20:42:22 +03:00
Rasmus Widing
f786a8026b Add task management tools with smart routing
Extract task functionality into focused tools:
- create_task: Create tasks with sources and code examples
- list_tasks: List tasks with project/status filtering
- get_task: Retrieve task details
- update_task: Modify task properties
- delete_task: Archive tasks (soft delete)

Preserves intelligent endpoint routing:
- Project-specific: /api/projects/{id}/tasks
- Status filtering: /api/tasks?status=X
- Assignee filtering: /api/tasks?assignee=X
2025-08-18 20:42:04 +03:00
Rasmus Widing
4f317d9ff5 Add document and version management tools
Extract document management functionality into focused tools:
- create_document: Create new documents with metadata
- list_documents: List all documents in a project
- get_document: Retrieve specific document details
- update_document: Modify existing documents
- delete_document: Remove documents from projects

Extract version control functionality:
- create_version: Create immutable snapshots
- list_versions: View version history
- get_version: Retrieve specific version content
- restore_version: Rollback to previous versions

Includes improved documentation and error messages based on testing.
2025-08-18 20:41:55 +03:00
Rasmus Widing
b2cab81346 Remove feature flags from Docker configuration
Removed USE_SEPARATE_PROJECT_AND_TASK_TOOLS and PROJECTS_ENABLED
environment variables as the separated tools are now the default.
2025-08-18 20:41:46 +03:00
Rasmus Widing
961cde29ad Remove consolidated project module in favor of separated tools
The consolidated project module contained all project, task, document,
version, and feature management in a single 922-line file. This has been
replaced with focused, single-purpose tools in separate modules.
2025-08-18 20:41:40 +03:00
Eric Fisher
5293687f71 Fix missing feature field in project tasks API response
Resolves issue #282 by adding feature field to task dictionary in
TaskService.list_tasks() method. The project tasks API endpoint was
excluding the feature field while individual task API included it,
causing frontend to default to 'General' instead of showing custom
feature values.

Changes:
- Add feature field to task response in list_tasks method
- Maintains compatibility with existing API consumers
- All 212 tests pass with this change
2025-08-18 11:20:07 -05:00
Eric Fisher
868ebe1f78
Fix project cards horizontal scrollbar visibility (#295)
Addresses issue #293 by replacing hide-scrollbar with scrollbar-thin
class to ensure users can see and interact with the horizontal scrollbar
when project cards overflow.
2025-08-18 10:14:25 -05:00
Cole Medin
3d368c9194
Update README.md
Added note in the README
2025-08-18 09:17:38 -05:00
Cole Medin
dab5c6b7d3
Update bug_report.yml
Changing Archon Alpha to Beta in the issue template
2025-08-18 09:13:15 -05:00
Rasmus Widing
1f03b40af1 Refactor MCP server structure and add separate project tools
- Rename src/mcp to src/mcp_server for clarity
- Update all internal imports to use new path
- Create features/projects directory for modular tool organization
- Add separate, simple project tools (create, list, get, delete, update)
- Keep consolidated tools for backward compatibility (via env var)
- Add USE_SEPARATE_PROJECT_TOOLS env var to toggle between approaches

The new separate tools:
- Solve the async project creation context loss issue
- Provide clearer, single-purpose interfaces
- Remove complex PRP examples for simplicity
- Handle project creation polling automatically
2025-08-18 15:55:00 +03:00
Rasmus Widing
6273615dd6 Improve MCP tool usability and documentation
- Fix parameter naming confusion in RAG tools (source → source_domain)
- Add clarification that source_domain expects domain names not IDs
- Improve manage_versions documentation with clear examples
- Add better error messages for validation failures
- Enhance manage_document with non-PRP examples
- Add comprehensive documentation to get_project_features
- Fix content parameter type in manage_versions to accept Any type

These changes address usability issues discovered during testing without
breaking existing functionality.
2025-08-18 15:47:20 +03:00