API Keys & MCP
MCP (Model Context Protocol) lets AI assistants like Claude Desktop read and write to your UnaFonte account directly. You say "I just launched a giveaway on X, ends Friday" and the AI proposes a ledger entry for you to approve. No copy-pasting, no context switching.
Two Access Levels
- Public (Read) — Anyone's AI can verify your identity and read your ledger. No API key needed.
- Authenticated (Write) — Your AI can propose ledger entries on your behalf. Requires an API key.
Generating an API Key
- Go to
Dashboard → API Keys - Click Generate API Key
- Give it a descriptive name ("Claude Desktop", "My GPT", "LangChain Agent", etc.)
- Optionally set an expiry date (recommended for agent keys)
- Copy the key immediately — it's shown only once
Never share your API key
Connecting Claude Desktop
- Open your Claude Desktop config at
~/.claude/claude_desktop_config.json - Add the UnaFonte MCP server:
{
"mcpServers": {
"unafonte": {
"command": "npx",
"args": ["@unafonte/mcp-server@latest"],
"env": {
"UNAFONTE_API_KEY": "uf_abc123..."
}
}
}
}- Save the file and fully restart Claude Desktop
- Claude will now have access to UnaFonte tools — try saying "I just launched a giveaway, can you add it to my ledger?"
Available MCP Tools
Once connected, your AI has access to these tools:
- unafonte_verify — Answer verification questions (public)
- unafonte_get_identity — Get identity info for any user (public)
- unafonte_get_ledger — Get active ledger and NOT ME rules (public)
- unafonte_propose_entry — Propose a ledger entry for approval (authenticated)
- unafonte_verify_agent — Verify an agent credential (public)
- unafonte_register_agent — Register a new AI agent (authenticated)
- unafonte_list_agents — List your registered agents (authenticated)
- unafonte_revoke_agent — Revoke an agent credential (authenticated)
The Propose Entry Flow
When your AI proposes a ledger entry via unafonte_propose_entry, it's created in the PENDING state. You'll get an email notification with a one-click approve/reject link. Approved entries go live immediately; rejected entries are deleted.
Human in the loop by design
Revoking API Keys
Revoke keys from Dashboard → API Keys any time. Revocation is instant — the next API call using that key will fail with a 401. Revoked keys are kept in the database for audit trail purposes but can no longer authenticate.
Security Details
- Keys are hashed with SHA-256 before storage — the raw key is never saved
- Key verification uses timing-safe comparison to prevent timing attacks
- Every API call logs the key's last-used timestamp so you can spot unusual activity
- Rate limiting is enforced per-key (10 writes/min, 30 reads/min)
Direct API Access
You can also call UnaFonte's API directly without MCP. Include the key as a bearer token:
curl https://unafonte.com/api/ledger/propose \
-H "Authorization: Bearer uf_abc123..." \
-H "Content-Type: application/json" \
-d '{
"type": "GIVEAWAY",
"title": "iPhone 15 Giveaway",
"channels": ["X", "YouTube"],
"expiresAt": "2026-04-15T23:59:59Z"
}'