Skip to content

kphed/tempo-hackathon

Repository files navigation

Dossier

Paid deep research over MPP. Dossier is a Bun + Hono API that charges 0.01 USDC per query, runs grounded Gemini research, and returns a structured dossier with citations and sources. It also exposes the same capability as an MCP server for agent clients.

Endpoints

GET /

Free self-documenting root route. Returns the service name, description, and the public API contract.

GET /health

Free health check.

{
  "service": "tempo-hackathon",
  "status": "ok"
}

POST /research

Paid research endpoint. Charged via MPP using Tempo mainnet USDC.

Request:

{
  "query": "What is the Machine Payments Protocol and how does it work?",
  "depth": "quick"
}

Response shape:

{
  "title": "How the Machine Payments Protocol Works",
  "summary": "The protocol functions as a standardized communication layer between an agent and a service.",
  "content": "Full markdown research report...",
  "sources": [
    {
      "index": 1,
      "url": "https://...",
      "title": "thepaypers.com"
    }
  ],
  "metadata": {
    "model": "gemini-3.1-flash-lite-preview",
    "depth": "quick",
    "searchQueries": [
      "how does Machine Payments Protocol work"
    ],
    "sourceCount": 6,
    "durationMs": 1234,
    "generatedAt": "2026-03-19T17:30:02.166Z"
  }
}

Live captured examples are stored in docs/artifacts/research-sample-mpp.json and docs/artifacts/research-sample-pokemon.json.

MCP Server

Run the stdio MCP server:

bun run mcp

It exposes one tool:

  • research: paid deep research with query and optional depth (quick or standard)

Example Claude Desktop / Cursor config:

{
  "mcpServers": {
    "dossier": {
      "command": "bun",
      "args": ["run", "mcp"],
      "cwd": "/Users/khoaphan/Desktop/tempo-hackathon"
    }
  }
}

Stack

  • Bun runtime and test runner
  • Hono HTTP server
  • mppx for MPP payment challenges and verification
  • Google Gemini (gemini-3.1-flash-lite-preview) for grounded research
  • MCP TypeScript SDK for agent integration

Environment

Required:

  • GEMINI_API_KEY
  • RECIPIENT_ADDRESS
  • MPP_SECRET_KEY

Optional:

  • PORT defaults to 3000

See .env.example.

Scripts

bun install
bun run dev
bun run start
bun run test
bun run lint
bun run format
bun run mcp

Local Testing

Dry-run payment challenge:

"$HOME/.local/bin/tempo" request -t --dry-run -X POST \
  --json '{"query":"What is MPP?","depth":"quick"}' \
  http://127.0.0.1:3000/research

Real paid request:

"$HOME/.local/bin/tempo" request -j -X POST \
  --json '{"query":"What is MPP?","depth":"quick"}' \
  http://127.0.0.1:3000/research

About

Dossier: Research-as-a-service over MPP. Ask a question, get cited research. One cent. Includes native MCP server support. Built in <2 hours for the Tempo.xyz hackathon.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors