Skip to content

MCP Server

Engram ships @engram-sdk/mcp, exposing SDK capabilities as MCP tools for IDEs and clients.

Run the Server

bash
OPERATOR_PRIVATE_KEY=0x... ENGRAM_NETWORK=calibration npx @engram-sdk/mcp

Default endpoint:

text
http://localhost:3456/mcp

Runtime Model

The server runs over HTTP with:

  • MCP endpoint at /mcp
  • health endpoint at /health
  • stateless request handling per HTTP request

Cursor Configuration

Create .cursor/mcp.json in your project:

json
{
  "mcpServers": {
    "engram": {
      "url": "http://localhost:3456/mcp"
    }
  }
}

Claude Desktop Configuration

Add to claude_desktop_config.json:

json
{
  "mcpServers": {
    "engram": {
      "url": "http://localhost:3456/mcp"
    }
  }
}

Tool Catalog

engram_store

Input:

  • data (required)
  • context.priority (critical|standard|temporary|ephemeral)
  • context.encrypt
  • context.ttlDays
  • context.replication

Output includes cid, dealId, ttlTimestamp, spendUSDFC, policy, optional attestationTx.

engram_retrieve

Input:

  • cid (required)

Output is stored payload (stringified JSON when needed).

engram_renew

Input:

  • cid (required)
  • force (optional)

Output is RenewResult.

engram_prune

Input:

  • cid (required)

Output is PruneResult.

engram_delegate

Input:

  • cid (required)
  • recipientDID (required)
  • ttlHours (optional, default 24)

Output includes tokenCid and token.

engram_verify_delegation

Input:

  • tokenCid (required)
  • callerDID (required)

Output includes verification result and token envelope fields.

engram_status

Input: none

Output includes:

  • identity info (agentId, pkpAddress, network) when available
  • spend/cap values
  • active CID list and count
  • storage provider and attestation mode
  • SDK version

Required and Optional Environment Variables

Required:

  • OPERATOR_PRIVATE_KEY

Optional:

  • VINCENT_SECRET_API_KEY
  • ENGRAM_NETWORK
  • ENGRAM_MCP_PORT
  • ENGRAM_ATTEST_ON_CHAIN
  • ENGRAM_BUDGET_MAX_USDFC
  • ENGRAM_RENEW_THRESHOLD_DAYS
  • ENGRAM_BUDGET_SAFETY_MARGIN_PCT
  • ENGRAM_LOG_PATH
  • BASE_RPC_URL
  • FILECOIN_RPC_URL
  • ERC8004_IDENTITY_REGISTRY
  • ERC8004_REPUTATION_REGISTRY

Health Check

bash
curl http://localhost:3456/health

Use this in deployment probes before allowing MCP clients to connect.

Raw MCP Tool Call Example

For debugging client integrations, this is the payload shape for a direct tools/call to engram_store:

json
{
  "method": "tools/call",
  "params": {
    "name": "engram_store",
    "arguments": {
      "data": { "context": "agent working state" },
      "context": { "priority": "standard" }
    }
  }
}

Released under the MIT License.