Skip to content

Official mcp server#1720

Open
AbdelrahmanELBORGY wants to merge 2 commits into
foss42:mainfrom
AbdelrahmanELBORGY:official-mcp-server
Open

Official mcp server#1720
AbdelrahmanELBORGY wants to merge 2 commits into
foss42:mainfrom
AbdelrahmanELBORGY:official-mcp-server

Conversation

@AbdelrahmanELBORGY

Copy link
Copy Markdown
Contributor

Feature: Official Model Context Protocol (MCP) Server via mcp_dart and NPM Bridge

Description

This PR introduces the official Model Context Protocol (MCP) server for API Dash, enabling AI assistants (specifically VS Code extensions like Roo Code and Cline) to natively interact with API Dash's core engine.

To achieve a production-ready, spec-compliant architecture, this implementation transitions to using the mcp_dart package for internal protocol handling and introduces a lightweight NPM wrapper to allow seamless execution via npx.

The official bridge package is now live on NPM: apidash-mcp.

Architectural Approach

1. The Dart Engine (mcp_dart)

Instead of manually parsing and serializing JSON-RPC messages, the API Dash headless engine now utilizes the mcp_dart package.

  • Spec Compliance: Guarantees strict adherence to the official MCP specification.
  • Tool Registration: Provides a clean, strongly-typed API for registering API Dash capabilities as MCP tools.
  • Headless Execution: When launched with the --mcp-engine flag, the Flutter app bypasses the UI and boots purely as a standard I/O server.

2. The Node.js Bridge (apidash-mcp)

The apidash-mcp Node wrapper:

  1. Is invoked effortlessly via npx -y apidash-mcp@latest.
  2. Locates the native API Dash installation via the APIDASH_PATH environment variable.
  3. Spawns the Flutter engine and establishes a pristine, bidirectional Standard I/O pipe between the AI client and the Dart engine.
  4. Manages aggressive process lifecycle cleanup to ensure no orphan Flutter processes remain when VS Code is closed.

How to Use the Server

To test and use the MCP server, you do not need to compile the Node wrapper locally. You can use the globally available NPM package.

Prerequisites

  1. Node.js must be installed.
  2. API Dash must be compiled and available on your system.

Integration with VS Code (Roo Code / Cline)

Add the following configuration to your mcp.json file. Ensure the APIDASH_PATH points exactly to your compiled executable.

  • Note: I am currently actively working on an updated "Package" release that will bundle the native binaries directly. Soon, you will not need to manually configure this environment variable at all
{
  "servers": {
    "apidash": {
      "command": "npx",
      "args": [
        "-y",
        "apidash-mcp@latest"
      ],
      "env": {
        "APIDASH_PATH": "C:\\Path\\To\\Your\\apidash\\build\\windows\\x64\\runner\\Release\\apidash.exe"
      }
    }
  }
}

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