๐Ÿ“ฆ tobinsouth / hcp-demo-old-v0

A demo app that shows how HCP could be built with Auth, LLM control, and database management

โ˜… 2 stars โ‘‚ 0 forks ๐Ÿ‘ 2 watching
๐Ÿ“ฅ Clone https://github.com/tobinsouth/hcp-demo-old-v0.git
HTTPS git clone https://github.com/tobinsouth/hcp-demo-old-v0.git
SSH git clone git@github.com:tobinsouth/hcp-demo-old-v0.git
CLI gh repo clone tobinsouth/hcp-demo-old-v0
Tobin South Tobin South Removing protocol on authkit domain. 2c1e3ee 8 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .cursor
๐Ÿ“ app
๐Ÿ“ components
๐Ÿ“ hooks
๐Ÿ“ lib
๐Ÿ“ prisma
๐Ÿ“ public
๐Ÿ“„ .env.example
๐Ÿ“„ .gitignore
๐Ÿ“„ components.json
๐Ÿ“„ eslint.config.mjs
๐Ÿ“„ middleware.ts
๐Ÿ“„ next.config.ts
๐Ÿ“„ package.json
๐Ÿ“„ pnpm-lock.yaml
๐Ÿ“„ postcss.config.mjs
๐Ÿ“„ README.md
๐Ÿ“„ tailwind.config.js
๐Ÿ“„ tsconfig.json
๐Ÿ“„ vercel.json
๐Ÿ“„ README.md

Human Context Protocol (HCP)

A research demo of the Human Context Protocol, introduced in "Robust AI Personalization Will Require a Human Context Protocol", a paper under review at NeurIPS 2025.

Running the Demo

  • Clone the repository
  • Install dependencies:
# Install pnpm if you haven't already
npm install -g pnpm

# Install project dependencies
pnpm install

  • Set up environment variables:
OPENAI_API_KEY=your_openai_api_key
DATABASE_URL="file:./dev.db"

  • You may need to set up a local redis and prisma deployment if this is your first time. For example
a. Install Redis:
  • On macOS (using Homebrew):
brew install redis
        brew services start redis
  • On Linux:
sudo apt-get install redis-server
        sudo systemctl start redis-server

b. Set up Prisma:

# Initialize the database
   pnpm prisma generate
   pnpm prisma db push

Note: The project uses SQLite as the database provider (configured in prisma/schema.prisma), so no additional database installation is required. The database file will be created at prisma/dev.db.

  • Run the development server:
pnpm dev

Open http://localhost:3000 with your browser to see the UI demo.

Once your AI client has picked up the server (e.g., Cursor:Settings/Cursor Settings/MCP) you can simple ask the agent to update your preferences.

Connecting to MCP

The simplest way to access MCP servers is via Cursor. You will find the code requried to access a workspace MCP server in .cursor/mcp.json. If you do not have access to cursor as an MCP client, this JSON will work with any other client that supports MCP (e.g., claude desktop, goose). The Connect to MCP button in the demo explains more.

Authentication Setup

The demo uses WorkOS AuthKit for authentication, implemented in lib/with-authkit.ts. For development and demonstration purposes, the authentication is simplified with a debug user. In production, you should:

  • Set up WorkOS AuthKit following their instructions here. This will involve setting up an account, accessing keys, and setting a redirect URL. This does not need to be done for local demos.
Speficially, you will need to add to .env a WORKOS_API_KEY, WORKOS_CLIENT_ID, WORKOS_COOKIE_PASSWORD

  • Remove the debug user code in lib/with-authkit.ts by uncommenting the production authentication code and removing the debug user object.

Project Structure

  • /app: Next.js application routes and pages
  • /components: React components
  • /lib: Utility functions and database configuration
  • /prisma: Database schema and migrations