Skip to content

Merge v1 MCP 2026 alignment into main - #3

Merged
IceMask merged 24 commits into
mainfrom
codex/merge-v1-into-main
Aug 6, 2026
Merged

IceMask merged 24 commits into
mainfrom
codex/merge-v1-into-main

Conversation

@IceMask

@IceMask IceMask commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • merge the protected v1 release line into main
  • add MCP 2026-07-28 stateless discovery and Streamable HTTP support while preserving legacy initialization compatibility
  • carry forward runtime security, audit, distributed coordination, and error-handling hardening
  • preserve Tentacle public branding and documentation while keeping retired internal/legacy artifacts out of main

Validation

  • go test ./... -count=1
  • go vet ./...
  • git diff --cached --check before merge commit
  • runtime tree verified identical to merged origin/v1 for cmd/, internal/, go.mod, and go.sum

Stella Jen and others added 24 commits December 1, 2025 20:46
Bug fixes:
- High: Fix dispatcher retry storm by ACKing terminal errors and implementing retry counter
- High: Fix TakeScreenshot empty traceId causing corrupted S3 keys and orphaned DB rows
- Medium: Fix JSON-RPC schema validator CWD dependency by embedding schemas

Refactor:
- MCP tools now load from embedded JSON files (internal/gateway/mcp/tools/*.json)
- Single source of truth for tool schemas — no more duplicate definitions
- Easier maintenance — adding a new tool = adding a JSON file

Technical details:
- dispatcher.go: Added handleDispatchError with terminal error detection and Redis retry counter
- service.go: Added traceId validation guard in TakeScreenshot
- tools.go: Replaced 300+ lines of hardcoded maps with 140 lines reading from embed.FS
- validator.go: Replaced os.ReadDir with embed.FS for schema files
- redis/cache.go: Added Incr method for atomic counter with TTL

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added fine-grained interactive tools for agent exploration:
- findElement - Locate UI elements by strategy (id, xpath, accessibility id, etc.)
- clickElement - Click on located elements
- sendKeysToElement - Input text to elements
- clearElement - Clear input fields
- getElementText - Retrieve element text content
- getElementAttribute - Get element attributes (enabled, selected, etc.)
- isElementDisplayed - Check element visibility
- tap - Tap at screen coordinates
- swipe - Swipe gesture between coordinates
- longPress - Long press on elements
- pressBack - Press device back button
- hideKeyboard - Hide soft keyboard

Total tools now: 20 (8 batch + 12 interactive)

This enables two usage patterns:
1. Batch testing - Use executePlan with multi-step plans (good for CI/CD)
2. Interactive exploration - Use fine-grained tools for agent decision-making

Extended appium/client.go with W3C WebDriver Actions API for gestures.
All tools available via both MCP protocol and JSON-RPC 2.0.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updated all 20 tool descriptions to be comprehensive and LLM-friendly:
- Changed from brief Chinese to detailed English explanations
- Added context on when to use each tool
- Included failure conditions and edge cases
- Explained return values and behavior
- Provided usage patterns and best practices
- Added concrete examples in parameter descriptions

Key improvements:
- findElement: Explains all 7 locator strategies with examples
- executePlan: Clarifies batch vs interactive mode usage
- getSemanticSnapshot: Details differential update mechanism
- swipe: Documents common scroll patterns and duration effects
- All parameters now have clear, actionable descriptions

This ensures LLMs can make informed decisions about which tools to call
and how to construct correct arguments based solely on the tools/list response.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Added comprehensive test suite to verify MCP implementation:
- test_tools.go: Tool registry and schema validation test
- test_mcp_protocol.go: MCP protocol compliance test (initialize, tools/list, tools/call, resources/list)
- test_summary.go: Tool categorization and usage pattern summary
- test_show_all_tools.go: Detailed tool catalog display
- test_mcp.sh: Stdio mode integration test script

All tests pass successfully:
✓ 20 MCP tools loaded from embedded JSON files
✓ Schema validation working correctly
✓ MCP protocol 2024-11-05 compliant
✓ Error handling with proper error codes
✓ 3 resource types exposed (artifacts, traces, sessions)

Note: Full integration tests require Postgres, Redis, S3, and Appium server.
Core protocol layer verified without external dependencies.

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Align the MCP server with the 2026-07-28 protocol and include the reviewed runtime, security, distributed execution, test, and documentation fixes.
# Conflicts:
#	CHANGELOG.md
#	LICENSE
#	README.md
#	RELEASE_NOTES_v1.0.0.md
#	SECURITY.md
#	THIRD_PARTY_INTEGRATION.md
#	USAGE_EXAMPLES.md
#	cmd/gateway/main.go
#	cmd/gateway/main_test.go
#	cmd/gateway/security.go
#	cmd/orchestrator/main.go
#	cmd/worker/main.go
#	config.example.yaml
#	config.production.example.yaml
#	go.mod
#	go.sum
#	internal/auth/context.go
#	internal/auth/hmac.go
#	internal/auth/hmac_test.go
#	internal/auth/oidc.go
#	internal/auth/pat.go
#	internal/config/loader.go
#	internal/config/loader_test.go
#	internal/errors/codes.go
#	internal/errors/codes_test.go
#	internal/gateway/jsonrpc/handler.go
#	internal/gateway/jsonrpc/handler_test.go
#	internal/gateway/mcp/handler.go
#	internal/gateway/mcp/mcp_test.go
#	internal/gateway/mcp/tools.go
#	internal/gateway/middleware/auth.go
#	internal/gateway/middleware/auth_test.go
#	internal/gateway/rest/router.go
#	internal/gateway/stdio/transport.go
#	internal/gateway/stdio/transport_test.go
#	internal/gateway/websocket/handler.go
#	internal/gateway/websocket/subscription_token.go
#	internal/gateway/websocket/subscription_token_test.go
#	internal/orchestrator/devicefarm_runtime.go
#	internal/orchestrator/dispatcher.go
#	internal/orchestrator/distributed_callback_test.go
#	internal/orchestrator/distributed_callbacks.go
#	internal/orchestrator/health.go
#	internal/orchestrator/health_check_test.go
#	internal/orchestrator/persistence.go
#	internal/orchestrator/service.go
#	internal/orchestrator/trace_terminal_test.go
#	internal/orchestrator/worker_registry.go
#	internal/orchestrator/worker_registry_recovery_test.go
#	internal/storage/postgres/auth_store.go
#	internal/storage/postgres/coordination.go
#	internal/storage/postgres/dao.go
#	internal/storage/redis/cache.go
#	internal/telemetry/logging.go
#	internal/telemetry/telemetry_test.go
#	internal/worker/appium/client.go
#	internal/worker/appium/client_test.go
#	internal/worker/executor.go
#	internal/worker/executor_test.go
#	internal/worker/grpc_server.go
#	internal/worker/grpc_server_test.go
@IceMask
IceMask merged commit d847402 into main Aug 6, 2026
0 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant