Model Context Protocol (MCP)

The PureCode AI Extension has significantly enhanced its capabilities by introducing support for the Model Context Protocol (MCP). This integration allows users to connect to a diverse range of backend services, which can include local binaries, applications running within Docker containers, or remote HTTP services.

Connect your PureCode AI Extension to diverse backends—local binaries, Docker containers, and remote services—using a simple, extensible JSON configuration format.

Flexible Configuration

JSON-based format supporting multiple servers with stdio and SSE transport protocols.

Automatic Discovery

Tools are automatically detected and made available in the sidebar with real-time status.

Extensive Architecture

Add new MCP servers without code changes—simply update your configuration.

What is MCP?

The Model Context Protocol (MCP) is an open protocol designed to standardize how applications provide context, data sources, and tools to Large Language Models (LLMs). Think of MCP as a universal adapter, much like a USB-C port for AI applications.

Key Benefits

Plug-and-Play Extensibility

Users can effortlessly add, remove, or swap out MCP servers by making simple changes to a configuration file or through the user interface. New MCP-compatible tools can be integrated without requiring updates to the core extension.

Unified User Experience

Regardless of the underlying backend, all tools exposed via MCP servers appear and behave consistently within the PureCode AI Extension's UI, reducing learning curves and streamlining workflows.

Configuring MCP Servers

Configuring MCP servers involves defining them in a structured JSON format. The configuration file serves as the central point for managing all MCP servers accessible to the PureCode AI Extension.

Basic Configuration Structure :

{
  "mcpServers": {
    "server-id": {
      "name": "Human-readable Name",
      "id": "server-id",
      "transport": {
        "type": "stdio|sse",
        // Additional transport-specific fields
      }
    }
  }
}

Transport Mechanisms

stdio (Standard Input/Output)

Used for MCP servers launched as local processes. The extension starts the process and communicates via stdin/stdout.

Fields: command, args, env (optional)

sse (Server-Sent Events)

Used for MCP servers exposing HTTP endpoints. The extension connects to the URL and receives real-time updates.

Field: url

Securing Credentials

Use the env object to securely pass API keys and tokens without hardcoding them in configuration files. This prevents accidental exposure in version control systems.

Key Configuration Fields

Field
Description
Required
Example

name

Human-readable name for display in UI

Yes

"Filesystem Indexer"

id

Unique identifier for the server

Yes

"file-system"

transport

Connection protocol and parameters

Yes

{ "type": "stdio", ... }

Technical Details and Advanced Features

Automatic Discovery

The extension automatically parses the mcpServers configuration, establishes connections, and queries each server for available tools. This happens transparently during startup or configuration reload.

Extensible Transport Layer

The architecture supports multiple transport mechanisms (stdio, SSE) and is designed to accommodate future protocols without fundamental changes to the core extension.

Seamless Integration

MCP-enabled tools are indistinguishable from native tools in the user interface. The AI can autonomously invoke these tools when appropriate to fulfill user requests.

Deployment Flexibility

Comprehensive support for local processes, Docker containers, and remote HTTP services ensures users can choose the deployment model that best fits their needs.

Supported Deployment Models

Local Processes

Run directly on your machine using stdio transport

Docker Containers

Isolated, consistent execution environments

Remote Services

Connect to HTTP endpoints via SSE transport

Last updated