OpenMCP Client

repository·main·Indexed 20 days ago

https://github.com/lstm-kirigaya/openmcp-client

An all-in-one development suite for Model Context Protocol (MCP) server debugging and agent deployment. It includes a CLI for managing the Gateway and Web UI, an integrated inspector for testing tools, prompts, and resources, and the openmcp-sdk for deploying verified MCP configurations as agent applications using the OmAgent class.

Tokens
48K
Snippets
155
Records
228
Agent score
73%

What's inside openmcp

  1. Overview of `openmcp-client/service` capabilities

    main

    The openmcp-client/service package provides a comprehensive suite of services for managing Model Context Protocol (MCP) connections, authentication, cloud backups, and LLM integrations. It is organized into several functional domains:

    • MCP Connectivity: Manages connections, client calls, and connection monitoring (including OCR and internal MCP authentication).
    • Authentication: Handles user login, registration, and session refreshing at the application level.
    • Cloud Backup: Provides capabilities for creating, listing, restoring, deleting, and viewing backup details, utilizing encryption services.
    • Settings & Panel State: Manages application settings and panel status, including batch validation repositories.
    • LLM & Hook Extensions: Provides controllers and services for LLM interaction and a hook adapter layer (supporting adapter, openrouter, sdk, etc.).
    • Feedback & Reflux: Implements a feedback and data reflux system.
    • Debugger MCP: Dedicated services, storage, and controllers for debugging MCP interactions.
    • Batch Validation: Orchestrates the creation and execution of batch tasks.
    • Infrastructure: Provides common routing and various storage implementations like json-archive-store, omdb-store, and unified-chunk-store.
  2. What is OpenMCP?

    main

    OpenMCP is an all-in-one MCP (Model Context Protocol) server debugger. It functions as an integrated plugin for IDEs like VSCode, Trae, and Cursor, allowing developers to test MCP resources, tools, and prompts.

    Key features include:

    • Integrated Inspector: Test MCP resource protocols, tools, and prompts.
    • Interactive Testing: Test tools via LLM interaction in a chatbot-style module.
    • Project Management: A management panel for handling local and global MCP projects.
    • Multi-LLM Support: Compatible with DeepSeek, OpenAI, Gemini, Groq, Ollama, OpenRouter, and many others.
    • XML Mode: Supports XML-based patterns and custom tool selection.
  3. Understand the MCP Tool Test Case Management System

    main

    The MCP Tool Test Case Management System is a feature within the OpenMCP Client designed to help developers record, manage, and execute tests for MCP tools. It allows for:

    • Recording Input/Output: Capture specific tool arguments and their resulting outputs.
    • Test Lifecycle Management: Create, edit, delete, and run tests individually or in batches.
    • Quick Generation: Automatically generate test cases from the tool executor by capturing current execution parameters.
    • Regression Testing: Ensure tool updates do not break existing functionality by running the accumulated test suite.
    • Documentation: Use test cases as living documentation to demonstrate how tools should be used.
  4. Overview of OpenMCP Software architecture

    main

    The software directory represents the initialized workspace for the software version of openmcp-client.

    Frontend Strategy

    The frontend is designed to reuse openmcp-client/renderer. Scripts for dev, build, and preview in software/package.json are forwarded to ../renderer to maintain feature and style parity.

    Rust Service Implementation

    A new Rust rewrite skeleton is located in software/service-rust. This implementation aims to align with the core capability domains of openmcp-client/service, including:

    • MCP
    • Auth
    • Cloud Backup
    • Settings
    • LLM
    • Feedback
    • Panel
    • Batch Validation
    • Debugger MCP
  5. How OpenMCP architecture works

    main

    OpenMCP uses a layered modular design. By assembling different modules, it can be deployed in various modes:

    • OpenMCP Web: Uses a Renderer for the frontend, OpenMCPService for the backend, and Nginx as a reverse proxy.
    • OpenMCP Plugin: Integrates Renderer and OpenMCPService directly into IDEs like VSCode.
    • OpenMCP App: A desktop application using Electron to wrap the Renderer and OpenMCPService.
    • QQ Robot: Uses Lagrange.OneBot for protocol adaptation with OpenMCPService handling business logic.
  6. How LLM requests flow from the Renderer

    main

    The llm_service manages the interaction between the user interface (renderer) and the Large Language Model (LLM).

    Data Flow Lifecycle:

    1. Input Handling: The llm_service receives requests and routes them based on type (image, text, or video) to specialized handlers.
    2. Post-Processing: Handlers pass data to a post_process stage.
    3. LLM Interaction: The post_process stage sends the final processed payload to the llm for inference.
  7. Test Case Data Structure

    main

    Test cases are managed within ToolStorage and follow a specific schema.

    TestCase Object Schema

    Each TestCase object contains:

    • id: string (Unique ID)
    • name: string (Name of the test case)
    • toolName: string (The name of the tool being tested)
    • input: object (The JSON parameters passed to the tool)
    • actualOutput: object (The actual response received from the tool)
    • status: string (Current execution status)

    ToolStorage State

    ToolStorage maintains the following state:

    • testCases: TestCase[] (Array of all test cases)
    • currentToolName: string (The currently active tool name)
    • formData: object (Current form data)
    • lastToolCallResponse: (The result of the most recent tool execution)
  8. Configure and use OpenMCP Skills

    main

    OpenMCP loads skills from directories specified by the SKILL_PATH environment variable. A skill is identified by a directory containing a SKILL.md file.

    Directory Structure Example:

    skills/
      my-skill/
        SKILL.md
      another-skill/
        SKILL.md

    Manage skills via CLI: Note: The Gateway must be running for these commands to work.

    List loaded skills:

    openmcp skills list

    Load a specific skill:

    openmcp skills load --skill-name my-skill

    Read a skill file:

    openmcp skills read-file --skill-name my-skill --file-path SKILL.md
    openmcp skills list
    openmcp skills load --skill-name my-skill
  9. How OpenMCP's modular architecture works

    main

    OpenMCP uses a layered modular design that allows it to be implemented across different platforms (Web, VSCode Plugin, Desktop App, or Bot) by assembling different modules.

    Core Components

    • Renderer: Handles the UI/Frontend rendering.
    • OpenMCPService: Handles the core logic and backend services.

    Platform Implementations

    • OpenMCP Web: Combines Renderer and OpenMCPService with an Nginx reverse proxy.
    • OpenMCP Plugin (VSCode/Trae/Cursor): Integrates Renderer and OpenMCPService directly into the IDE via VSCode plugin code.
    • OpenMCP App (Desktop): Uses Electron to package the Renderer and OpenMCPService into a desktop application.
    • QQ Bot: Uses Lagrange.OneBot for protocol adaptation, connecting to OpenMCPService for business logic.
  10. Understand the OpenMCP Client architecture

    main

    OpenMCP Client is a Turbo-managed monorepo. The architecture is divided into several key layers:

    • VSCode Extension (src/): The entry point for the extension, handling activation, command registration, and webview lifecycle management.
    • Backend Service (service/): A Node.js layer responsible for MCP (Model Context Protocol) connection management, request routing, and aggregating LLM, settings, and panel modules.
    • Frontend Renderer (renderer/): A Vue + Vite based layer that handles the UI panels, user interaction, and message bridging.
    • SDK (sdk/): A TypeScript SDK designed for external or internal integration, providing stable APIs and hiding internal communication complexities.
    • Gateway (gateway/): A layer used to wrap runtime capabilities into independent entry points or service processes.
    • CLI (cli/): A command-line interface for scripting, development, and operational tasks.
  11. How OpenMCP CLI communicates with Services

    main

    The OpenMCP CLI maintains architectural consistency with VSCode extensions and Web frontends. Instead of using a separate HTTP API, the CLI communicates via WebSocket by sending { command, data } packets.

    These messages are handled by the Gateway, which then calls the @Controller registered items within the service. This ensures the CLI uses the exact same routing logic (routeMessage) as the rendering layer's MessageBridge.

  12. Understand the Test Case status lifecycle

    main

    Test cases transition through a specific state machine during execution:

    1. pending: The initial state before a test is run.
    2. running: The state while mcpClientAdapter.callTool() is actively executing the tool.
    3. passed: The tool executed successfully and met expectations.
    4. failed: The execution encountered an error or the output did not match the expected result.