Skip to content

feat(mcp): MCP server in the app and the querya-mcp stdio shim #1135

Description

@ZhuchkaTriplesix

Server (in the app)

  • MCP over JSON-RPC with the dart_mcp package (0.5.x). If it turns out too immature, a thin own implementation on the JSON-RPC code of extension_driver_session.
  • Tools: list_connections, list_tables, describe_table, sample_rows, run_query, explain_query on top of McpQueryService. Resource schema://<connection>.
  • Listens on 127.0.0.1 only, random port. Writes {port, token, pid, version} to <app data>/mcp/endpoint.json, mode 0600; deleted on shutdown (AppShutdown).
  • Every connection must send the token first; wrong token closes the socket. Concurrent clients allowed, each with its own session.

Shim bin/querya_mcp.dart

  • Reads endpoint.json, connects, sends the token, then pipes stdin/stdout both ways. No MCP parsing.
  • App not running / stale file: replies to initialize with an error whose message is "Querya Desktop is not running. Start it and enable the MCP server in Settings." and exits.
  • Built with dart compile exe for linux-x64, macos-arm64/x64, windows-x64 in release.yml, next to querya-ext-tester; shipped inside the app bundles and as release assets.

Tests

  • Integration: start the server in a test, run the shim as a process, call initialize, tools/list, tools/call run_query on SQLite.
  • Wrong token, missing endpoint file, app exits mid-session.

Part of #1133.

Activity

  1. added
    integrationTheme parser epic label: integration
    coreCore library logic and services
    P2Medium priority / Parity & Refactoring
    on Oct 8, 2026
  2. ZhuchkaTriplesix commented on Oct 8, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Сделано в #1140 (смержен в dev).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority / Parity & RefactoringcoreCore library logic and servicesintegrationTheme parser epic label: integration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions