AI代理永久存储服务

Hekkova MCP Server是一个为AI代理提供永久存储层的服务,支持将照片、视频、音频、文本等内容通过Polygon区块链、IPFS + Filecoin存储和Lit Protocol加密永久保存,并提供隐私分级控制。

  • by Hekkova
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 Hekkova/hekkova-mcp

使用说明

Hekkova MCP服务器

AI代理的永久存储层。通过IPFS+Filecoin存储、Lit协议加密和隐私层,将任何兼容MCP的AI(Claude、ChatGPT、Gemini、Cursor、自定义代理)和薄荷时刻(照片、视频、音频、文本)永久连接到Polygon区块链,让您控制谁看到了什么。


快速开始

# 1. Install dependencies
npm install

# 2. Copy and configure environment variables
cp .env.example .env
# Edit .env with your Supabase, Thirdweb, Pinata, and Stripe credentials

# 3. Seed the local test account and API key
npm run seed

# 4. Start the development server
npm run dev
# → Server running at http://localhost:3000/mcp

与克劳德桌面连接

将此添加到您的Claude Desktop配置文件中:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 窗户: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "hekkova": {
      "type": "url",
      "url": "http://localhost:3000/mcp",
      "headers": {
        "Authorization": "Bearer hk_test_local_dev_key_12345678"
      }
    }
  }
}

对于生产,请替换URL和API密钥:

{
  "mcpServers": {
    "hekkova": {
      "type": "url",
      "url": "https://mcp.hekkova.com/mcp",
      "headers": {
        "Authorization": "Bearer hk_live_YOUR_API_KEY"
      }
    }
  }
}

获取API密钥: hekkova.com/dashboard/keys.


工具参考

工具 说明
mint_moment 将媒体(照片、视频、音频、文本)永久复制到Polygon。基于相位加密,引脚到IPFS,创建ERC-721 NFT。返回块ID
mint_from_url 获取一个公共URL(推特、Instagram帖子、图片、网页)并对其进行薄荷处理。自动提取og:title和og:image。
list_moments 所有铸造时刻的分页列表。可按阶段、类别或搜索查询进行筛选。
get_moment 按块ID显示单个时刻的完整细节:CID、事务哈希、阶段、标签等。
update_phase 改变片刻的隐私阶段。费用为1学分(文本/图像)或2学分(视频)。传统计划包括每月10次免费的阶段转换。
export_moments 将所有时刻导出为JSON或CSV。返回一个包含所有块ID和IPFS CID的24小时下载URL。
get_balance 检查剩余的薄荷信用额度、当前计划(免费/arc_builder/legation)和相移余额。
get_account 账户标识:Light ID、显示名称、钱包地址、默认阶段和传统计划状态。

隐私阶段

阶段 访问 加密
new_moon 仅限所有者 Lit协议(所有者钱包ACC)
crescent 闭环(2-10人) Lit协议(共享访问条件)
gibbous 扩展组(最多50个) 通过Hekkova ERC-721进行代币门控
full_moon 完全公开 无

时刻类别

类别 含义
super_moon 重大生活事件
blue_moon 罕见的时刻
super_blue_moon 一生一次
eclipse 时间锁定-密封至 eclipse_reveal_date
null 未分类

速率限制

计划 请求/分钟 分钟
沙盒(测试密钥) 10 1
标准(任何付费套餐) 60 10
遗产计划 120 20

每个响应中都包含速率限制标头:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
X-RateLimit-Reset: 1710680460

运行测试

# Make sure the server is running in another terminal
npm run dev

# Run the test client
npm run test-client

部署

Vercel(无服务器)

npm install -g vercel
vercel

添加一个 vercel.json:

{
  "builds": [{ "src": "src/server.ts", "use": "@vercel/node" }],
  "routes": [{ "src": "/(.*)", "dest": "src/server.ts" }]
}

在Vercel仪表板的Project下设置所有环境变量→ 设置→ 环境变量。

铁路

npm install -g @railway/cli
railway login
railway init
railway up

在铁路仪表板中设置环境变量。铁路将自动检测 npm start 脚本。

Fly.io

npm install -g flyctl
fly auth login
fly launch

Fly将生成 fly.toml.使用以下方式设置秘密:

fly secrets set SUPABASE_URL=... SUPABASE_SERVICE_KEY=... THIRDWEB_SECRET_KEY=...
fly deploy

项目结构

hekkova-mcp/
├── src/
│   ├── server.ts          # Express + MCP server, auth middleware, rate limiter
│   ├── config.ts          # Typed config from environment variables
│   ├── types/index.ts     # TypeScript interfaces (Account, Moment, ApiKey, etc.)
│   ├── services/
│   │   ├── auth.ts        # API key validation and hashing
│   │   ├── database.ts    # Supabase queries (moments, accounts, API keys)
│   │   ├── blockchain.ts  # Thirdweb/Polygon minting (stub → real)
│   │   ├── storage.ts     # Pinata IPFS pinning (stub → real)
│   │   └── encryption.ts  # Lit Protocol encryption (stub → real)
│   └── tools/
│       ├── mint-moment.ts
│       ├── mint-from-url.ts
│       ├── list-moments.ts
│       ├── get-moment.ts
│       ├── update-phase.ts
│       ├── export-moments.ts
│       ├── get-balance.ts
│       └── get-account.ts
├── scripts/
│   ├── seed.ts            # Creates test account + API key in Supabase
│   └── test-client.ts     # Exercises all 8 tools against the running server
├── package.json
├── tsconfig.json
├── .env.example
└── README.md

Supabase架构

您在Supabase项目中需要这些表:

-- Accounts
create table accounts (
  id text primary key default gen_random_uuid()::text,
  display_name text not null,
  light_id text,
  wallet_address text,
  mints_remaining integer not null default 0,
  total_minted integer not null default 0,
  default_phase text not null default 'new_moon',
  legacy_plan boolean not null default false,
  created_at timestamptz not null default now()
);

-- API Keys
create table api_keys (
  id text primary key default gen_random_uuid()::text,
  account_id text not null references accounts(id) on delete cascade,
  key_hash text not null unique,
  key_prefix text not null,
  environment text not null default 'live',
  created_at timestamptz not null default now(),
  revoked_at timestamptz
);

-- Moments
create table moments (
  id text primary key default gen_random_uuid()::text,
  account_id text not null references accounts(id) on delete cascade,
  block_id text not null unique,
  token_id integer not null,
  title text not null,
  description text,
  phase text not null,
  category text,
  encrypted boolean not null default false,
  media_cid text not null,
  metadata_cid text not null,
  media_type text not null,
  polygon_tx text not null,
  source_url text,
  source_platform text,
  eclipse_reveal_date timestamptz,
  tags text[] not null default '{}',
  timestamp timestamptz not null default now(),
  created_at timestamptz not null default now()
);

-- Indexes
create index on api_keys(key_hash);
create index on moments(account_id, timestamp desc);
create index on moments(block_id);

完整规格

请参阅完整的技术规范: hekkova-mcp-server-spec.md

生产终点: https://mcp.hekkova.com/mcp