AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How Pieces Integrates with VS Code and JetBrains IDEs to Manage Code Context

前山千鶴 · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Pieces manages code context across Visual Studio Code and JetBrains IDEs by acting as an external, cross-environment memory layer powered by a centralized local daemon (Pieces OS) and connected through the open Model Context Protocol (MCP). Instead of trapping code snippets, chat history, and architectural context inside isolated editor silos, Pieces captures developer workflow data locally, enriches it with semantic metadata, and makes it available simultaneously to AI assistants in VS Code (such as GitHub Copilot and Cursor) and JetBrains IDEs (such as IntelliJ IDEA, PyCharm, and WebStorm).

While Pieces initially relied on dedicated, editor-specific plugins, the platform has officially transitioned to MCP-based integrations. This architecture allows developers switching between VS Code and JetBrains environments to preserve their active working context, retrieve historical code snippets with original file origins, and ground local coding assistants in shared project history without repetitive copy-pasting.


1. Core Architecture: The Local Memory Engine and MCP

Understanding how Pieces integrates with developer environments requires understanding its decoupled, two-tier architecture:

+-------------------------------------------------------------+
|                     Developer Workspaces                    |
|  +---------------------------+   +-----------------------+  |
|  |     VS Code / Cursor      |   |     JetBrains IDEs    |  |
|  | (GitHub Copilot / Continue) |   | (IntelliJ, PyCharm...) |  |
|  +-------------+-------------+   +-----------+-----------+  |
+----------------|-----------------------------|--------------+
                 | (Model Context Protocol)    | (MCP / Streamable HTTP)
                 v                             v
+-------------------------------------------------------------+
|                          Pieces OS                          |
|             (Local Background Daemon : localhost:39300)      |
|  +-------------------------------------------------------+  |
|  |             Long-Term Memory Engine (LTM-2.7+)        |  |
|  | - Workflow observation (files, terminal, browser)     |  |
|  | - Code snippet repository (Pieces Drive)              |  |
|  | - Automatic metadata enrichment (tags, origin, links) |  |
|  | - Neural semantic code search                         |  |
|  +-------------------------------------------------------+  |
+-------------------------------------------------------------+

Pieces OS: The Centralized Local Daemon

Pieces does not run inside the IDE process itself. Instead, it relies on Pieces OS, a lightweight background service running directly on the developer's local machine (typically listening on localhost:39300). Pieces OS houses the storage repository, metadata indexing pipeline, and local AI engines. Because Pieces OS operates outside any single editor, it serves as the single source of truth for both VS Code and JetBrains installations on the same machine.

Long-Term Memory (LTM) Engine

The Pieces Long-Term Memory (LTM-2.7+) engine passively indexes workflow artifacts across sessions. It observes active code blocks, visited documentation, git commit patterns, and terminal snippets. When a developer queries an AI assistant in either IDE, the LTM engine surfaces relevant temporal context—such as what function was being modified thirty minutes earlier in another workspace.

The Architectural Shift from Legacy Plugins to MCP

Historically, Pieces maintained separate native plugins in the VS Code Marketplace and JetBrains Marketplace that provided in-editor sidebars and gutter quick-actions. Pieces has officially sunset these legacy extensions in favor of Anthropic's Model Context Protocol (MCP). By running an MCP server directly out of Pieces OS, Pieces exposes its snippet store and LTM context as standard tools and resources that any MCP-compliant coding assistant can access natively.


2. How Context Is Managed Across VS Code and JetBrains

Pieces approaches context management not just as simple clipboard storage, but as a dynamic graph connecting code, origins, and explanations:

Cross-IDE Context Continuity

Developers frequently switch between editors—for instance, using PyCharm or IntelliJ for backend services and VS Code for frontend frameworks or quick configuration edits. Because Pieces OS maintains a unified local database:

Automated Metadata Enrichment

When code blocks are saved to Pieces Drive (either through the Pieces Desktop app, CLI, or MCP actions), Pieces automatically parses the content and attaches critical context without manual entry:

Grounding AI Queries Without Manual Copy-Pasting

Instead of repeatedly copying utility classes, SQL schemas, or architectural guidelines into prompt windows, developers query their MCP-connected assistant. The assistant uses Pieces MCP tools to retrieve pertinent code blocks and recent workstream history from Pieces OS, grounding LLM generations in verified local context.


3. Step-by-Step Setup Guide: VS Code and JetBrains

To establish context management across both environments, follow these implementation steps.

Step 1: Install and Configure Pieces OS

  1. Download and install Pieces OS and the Pieces Desktop App from the official Pieces website.
  2. Launch Pieces OS and ensure it is actively running in the system tray or menu bar.
  3. Open the Pieces Desktop App, navigate to Settings, and enable the Long-Term Memory (LTM) engine.
  4. Verify your local MCP endpoint under Settings -> Model Context Protocol (MCP). The endpoint URL typically follows the structure:
    http://localhost:{port}/model_context_protocol/2025-03-26/mcp
    

Step 2: Connect Visual Studio Code

Option A: One-Click Connection (Cursor / VS Code via Pieces Desktop)

In the Pieces Desktop App, go to Settings -> MCP -> MCP Connections and click Add to VS Code (or Cursor). Pieces automatically updates your local editor configuration.

Option B: GitHub Copilot in VS Code

To connect Pieces LTM to GitHub Copilot chat:

  1. Open your VS Code settings.json (User or Workspace).
  2. Add the Pieces MCP server block under the MCP configuration:
    {
      "github.copilot.chat.mcpServers": {
        "pieces": {
          "type": "sse",
          "url": "http://localhost:39300/model_context_protocol/2025-03-26/mcp"
        }
      }
    }
    
    (Note: Replace 39300 with your active Pieces OS port if custom-configured.)

Option C: Continue.dev Extension (Agent Mode)

If using the open-source Continue.dev assistant in VS Code, add the Pieces MCP server to your ~/.continue/config.json. Note that MCP tool calling operates in Continue's Agent mode.

Step 3: Connect JetBrains IDEs (IntelliJ IDEA, PyCharm, WebStorm, etc.)

Native MCP Support (JetBrains 2025.2+)

Starting with version 2025.2, JetBrains IDEs natively support Model Context Protocol integrations for the built-in AI Assistant:

  1. Ensure your JetBrains IDE is updated to version 2025.2 or newer.
  2. Navigate to Settings / Preferences -> Tools -> Model Context Protocol (MCP).
  3. Add a new MCP server connection:
    • Name: Pieces
    • Transport Type: Streamable HTTP (recommended over legacy SSE transports).
    • URL: Enter your local Pieces OS MCP endpoint URL (http://localhost:39300/model_context_protocol/2025-03-26/mcp).
  4. Save and apply. The native JetBrains AI Assistant can now call Pieces MCP tools to inspect your saved snippets and long-term memory.

Alternative: Continue.dev Plugin for JetBrains

For JetBrains versions prior to 2025.2, install the Continue plugin from the JetBrains Marketplace, open its settings, and configure the Pieces MCP endpoint in agent mode to achieve equivalent context querying.


4. Feature and Workflow Comparison: VS Code vs JetBrains

DimensionVS Code EnvironmentJetBrains IDE Suite
Integration MechanismMCP via GitHub Copilot, Continue.dev, or Cursor; Pieces Desktop 1-click connectNative MCP in JetBrains 2025.2+; Continue.dev plugin for older versions
Transport ProtocolServer-Sent Events (SSE) or Streamable HTTPStreamable HTTP (recommended) or SSE
Context SynchronizationShared local memory via Pieces OS daemonShared local memory via Pieces OS daemon
Snippet RetrievalAccessible through MCP agent tools and natural language promptsAccessible through MCP assistant queries and prompt context
Legacy Extensions StatusSunset; replaced by standardized MCP serverSunset; replaced by standardized MCP server
Cross-Project ScopeReads workspace files plus Pieces OS global repositoryReads IDE project indexes plus Pieces OS global repository

5. Trade-offs, Limitations, and Operational Evaluation

Key Advantages

Operational Constraints and Considerations


References