Skip to content

Phase 1+2: Unify capability types + HTTP MCP bridge - #126

Merged
Blankll merged 4 commits into
masterfrom
feat/unified-capability-types
Jul 30, 2026
Merged

Phase 1+2: Unify capability types + HTTP MCP bridge#126
Blankll merged 4 commits into
masterfrom
feat/unified-capability-types

Conversation

@Blankll

@Blankll Blankll commented Jul 30, 2026

Copy link
Copy Markdown
Member

Phase 1: Unified Capability Types (previous commit)

Deleted duplicate types.rs + registry.rs from sqlkit, imports from data-studio-agent. SqlKitAppLocal.

Phase 2: HTTP MCP Bridge (NEW)

Adds an embedded HTTP bridge (axum, 127.0.0.1:9121) that exposes the capability system to the external TypeScript MCP server.

Backend (Rust)

  • New src-tauri/src/mcp_bridge.rs module with:
    • POST /tools — list agent-tagged capabilities
    • POST /invoke — execute capability with connection resolution
    • GET /health — health check
  • Port auto-fallback via portpicker (default 9121, random if busy)
  • Config at {app_data_dir}/mcp-config.json (separate from .store.dat)
  • Port file at {app_data_dir}/mcp-port for data-studio-mcp discovery
  • Managed McpServerHandle with graceful shutdown/restart
  • Tauri commands: get_mcp_status, save_mcp_config

Verification

  • cargo build — clean

Blankll and others added 4 commits July 31, 2026 00:21
- Remove duplicate capabilities/types.rs and capabilities/registry.rs
- Import types and registry from data-studio-agent
- Replace SourceKind::SqlKit with SourceKind::AppLocal
- Update init_registry() call to pass registration function array
- Update agent/executor.rs and agent_adapters.rs to use data-studio-agent paths
Introduces an embedded HTTP bridge (axum, port 9121) that exposes the
capability system over HTTP for the external data-studio-mcp server.

Endpoints:
  POST /tools   — list all agent-tagged capabilities
  POST /invoke  — execute a capability by name with connection resolution
  GET  /health  — health check

Port auto-fallback via portpicker.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Integrates the MCP bridge into sqlkit's app lifecycle:
- Initialize McpServerHandle as managed Tauri state
- Read mcp-config.json and auto-start bridge in setup hook
- Register get_mcp_status and save_mcp_config Tauri commands

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Security: reject Elevated/Destructive capabilities on bridge (403)
- Lifecycle: save_mcp_config now stops server when autoStart=false
- Stale port file: liveness-test (TCP connect) before reporting running
- Write port file BEFORE spawning server to avoid orphaned task
- app_version: use real version from package_info()
- McpConfig::load: log warning on corrupt/parse error
- TOCTOU: remove port_available check, bind directly with fallback

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@Blankll
Blankll merged commit 5a78ab2 into master Jul 30, 2026
3 checks passed
@Blankll
Blankll deleted the feat/unified-capability-types branch July 30, 2026 17:22
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