agentleFS
ArgentAIOSArgentAIOS/agent-skills/pieces-mcp/SKILL.md

pieces-mcp

Skill4 starsChanged 8 months agoMITView on GitHub

Connect ArgentOS to Pieces long-term memory via MCP. Query past activity, create durable memories, and search across devices using PiecesOS.

  • Installs packages
  • Sends data out

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 10 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask the human to confirm:

    line 48
  2. Distinctive:

    If you get 404, 502, or timeout — the tunnel is down.

    line 84
  3. Very specific:

    Add the Pieces MCP server to ~/.argentos/argent.json under gateway.mcp.servers:

    line 88
  4. Distinctive:

    Write a durable memory:

    line 166
  5. Distinctive:

    Search tools (names vary by PiecesOS version) provide keyword-based search across all captured context.

    line 187
  6. Distinctive:

    Ask the human for a fresh tunnel URL

    line 195
  7. Very specific:

    Check ~/.argentos/argent.json has the gateway.mcp.servers.pieces entry

    line 199
  8. Very specific:

    Verify mcp-remote is installed: mcp-remote --help

    line 200
  9. Distinctive:

    Test the MCP URL directly with curl (Step 3)

    line 201
  10. Very specific:

    Check gateway logs: grep pieces /tmp/argent/argent-*.log

    line 202
  11. Distinctive:

    Add time: "What did I work on this morning?"

    line 207
  12. Distinctive:

    Add topic: "What have I done on the website project?"

    line 208
  13. Distinctive:

    Add context: "What debugging steps did I try for the login bug?"

    line 209
  14. Distinctive:

    If MCPorter/mcp-remote isn't working, test the MCP server directly:

    line 217

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Pieces MCP Skill for ArgentOS

Connect ArgentOS to Pieces long-term memory via MCP. Pieces captures ambient context (browser, clipboard, meetings, code) across devices. This skill teaches you how to wire it into ArgentOS so you can query that memory and create durable summaries.

When to Use This Skill

Trigger when:

  • The human mentions Pieces, PiecesOS, or long-term memory
  • They want cross-device memory: "What did I work on today?"
  • They say "Hook up to my Pieces" or "Ask Pieces"
  • You see an HTTPS tunnel URL for a Pieces MCP server

Architecture

Three components:

  1. PiecesOS MCP server — runs on the human's machine with Long-Term Memory (LTM) enabled. Exposed via HTTPS tunnel.
  2. ArgentOS gateway — this machine. Connects to the Pieces MCP server via gateway.mcp.servers config.
  3. Bridge: mcp-remote — npm package that connects to the remote /mcp endpoint and exposes it locally as a stdio MCP server.

Important: This integration is MCP-only. Always use /mcp, never /sse.

Setup Guide

Step 1: Confirm PiecesOS Is Running

Ask the human to confirm:

"Make sure PiecesOS is installed and running on your machine (or remote machine), and that Long-Term Memory (LTM) is enabled in the Pieces Desktop App."

Step 2: Get the Tunnel URL

The human needs to expose PiecesOS's MCP server via HTTPS:

For ngrok:

"On the machine running PiecesOS, run:

ngrok http 39300

Paste the HTTPS forwarding URL here (e.g., https://abc123.ngrok-free.dev)."

For custom tunnels: Any HTTPS URL that forwards to localhost:39300 works.

Step 3: Verify the MCP Endpoint

Construct the MCP URL:

MCP_URL = <tunnel_url>/model_context_protocol/2025-03-26/mcp

Quick sanity check:

curl -i "<MCP_URL>"

Expected: HTTP 400 with "mcp-session-id header or sessionId query parameter is required". This means the server is alive and ready.

If you get 404, 502, or timeout — the tunnel is down. Ask the human to check PiecesOS and the tunnel.

Step 4: Configure ArgentOS

Add the Pieces MCP server to ~/.argentos/argent.json under gateway.mcp.servers:

{
  "gateway": {
    "mcp": {
      "servers": {
        "pieces": {
          "command": "mcp-remote",
          "args": ["<MCP_URL>"]
        }
      }
    }
  }
}

Example with ngrok:

{
  "gateway": {
    "mcp": {
      "servers": {
        "pieces": {
          "command": "mcp-remote",
          "args": ["https://abc123.ngrok-free.dev/model_context_protocol/2025-03-26/mcp"]
        }
      }
    }
  }
}

Step 5: Install mcp-remote

npm install -g mcp-remote@0.1.38

Step 6: Restart the Gateway

argent gateway restart

The Pieces MCP tools are now available to all agent sessions.

Available Tools

Once connected, three Pieces tools become available:

ask_pieces_ltm

Query long-term memory with a natural language question:

{
  "name": "ask_pieces_ltm",
  "arguments": {
    "question": "What did I work on today?",
    "chat_llm": "gpt-4"
  }
}

Returns summaries[] and events[] as structured JSON. Parse this and synthesize a natural language answer for the human.

Use for:

  • "What did I work on today / this week?"
  • "What did we discuss in the standup?"
  • "What debugging steps did I try last time?"

When you answer, attribute it:

"According to your Pieces long-term memory, ..."

create_pieces_memory

Write a durable memory:

{
  "name": "create_pieces_memory",
  "arguments": {
    "summary_description": "Profile: Jason — MSP Owner",
    "summary": "# Profile: Jason\n\n## Role\nMSP owner, AI developer\n\n## Current Focus\nArgentOS development",
    "project": "ArgentOS"
  }
}

Use for:

  • Human profile (name, role, preferences)
  • Decision summaries
  • Debugging recaps
  • Project milestones

Full-Text Search Tools

Search tools (names vary by PiecesOS version) provide keyword-based search across all captured context.

Troubleshooting

MCP URL returns 404/502/timeout

  • Confirm PiecesOS is running on the remote machine
  • Confirm the tunnel is active (ngrok may have restarted)
  • Ask the human for a fresh tunnel URL

Tools not appearing after gateway restart

  1. Check ~/.argentos/argent.json has the gateway.mcp.servers.pieces entry
  2. Verify mcp-remote is installed: mcp-remote --help
  3. Test the MCP URL directly with curl (Step 3)
  4. Check gateway logs: grep pieces /tmp/argent/argent-*.log

ask_pieces_ltm times out or gives vague answers

Narrow the query:

  • Add time: "What did I work on this morning?"
  • Add topic: "What have I done on the website project?"
  • Add context: "What debugging steps did I try for the login bug?"

Raw JSON responses

This is normal. Pieces returns structured JSON with summaries[] and events[]. You (the agent) parse it and synthesize a natural language answer. The raw JSON is not an error.

Direct Testing (Debugging Only)

If MCPorter/mcp-remote isn't working, test the MCP server directly:

Create init.json:

{
  "jsonrpc": "2.0",
  "method": "initialize",
  "params": {
    "protocolVersion": "0.1.0",
    "capabilities": {},
    "clientInfo": { "name": "argentos-agent", "version": "1.0" }
  },
  "id": "1"
}
curl -i -X POST "<MCP_URL>" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "mcp-session-id: init-001" \
  --data-binary @init.json

Extract the mcp-session-id from the response headers (13-digit timestamp like 1774202062499). Use that for all subsequent requests.

Common mistakes: Use --data-binary @file.json (not inline -d), use string IDs ("id": "1" not "id": 1), always include both Content-Type and Accept headers.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.