A Model Context Protocol (MCP) server that provides cognitive tools for thought processes, goal tracking, and dynamic skill creation with user registration and email verification.
Try it out here: https://www.val.town/x/c15r/Chat
- Email Registration: Register with email verification
- Access Tokens: Secure token-based authentication
- User-Scoped Resources: All resources are isolated per user
- Admin Access: Admin users can access legacy global resources
- AI-Enhanced Thought Forking: Automatically generate parallel explorations using OpenAI
- Goal Tracking: Create, update, and monitor goals with hierarchical structure
- Task Management: Break down goals into actionable tasks with state tracking
- State Management: Track and persist cognitive states across sessions
- Blob Storage: Secure key-value storage with automatic user namespacing
- SQLite Database: General-purpose database operations with user-scoped table isolation
- Resource Deletion: Full deletion support with foreign key dependency handling
- Skill Creation: Write and store reusable scripts as "skills"
- Skill Execution: Dynamically invoke created skills as tools
- Skill Management: List, update, and delete skills with execution history
- Automatic AI Generation: Create thought forks with 2-8 parallel AI-generated explorations
- Perspective Analysis: AI generates diverse analytical perspectives automatically
- AI Synthesis: Merge explorations using AI to create comprehensive insights
- Insight Extraction: Automatically extract key insights from each exploration
βββ backend/
β βββ database/
β β βββ migrations.ts # Database schema (user-scoped + legacy)
β β βββ queries.ts # Database operations with user scoping
β β βββ user-queries.ts # User management operations
β βββ mcp/
β β βββ server.ts # MCP server implementation
β β βββ auth.ts # Authentication (admin + user tokens)
β β βββ tools/ # Cognitive tools
β β βββ blob.ts # Blob storage management
β β βββ fork-thought.ts # AI-enhanced thought forking
β β βββ goals.ts # Goal management with deletion
β β βββ tasks.ts # Task management with deletion
β β βββ states.ts # Cognitive state management
β β βββ skills.ts # Dynamic skills with deletion
β β βββ user-registration.ts # User registration & verification
β βββ index.ts # Main entry point with verification endpoint
βββ shared/
β βββ types.ts # Shared TypeScript types (user-scoped)
βββ README.md
MCP_AUTH_TOKEN: Admin authentication token (optional)BASE_URL: Base URL for email verification links (optional)
GET /- API documentation and statusGET /health- Health check endpointPOST /register- User registration (no auth required)GET /verify?token=...- Email verification (no auth required)POST /mcp- Main MCP protocol endpoint (conditional auth)GET /tools- List available tools (conditional auth)
# Register via HTTP endpoint curl -X POST https://your-server.com/register \ -H "Content-Type: application/json" \ -d '{"email": "user@example.com"}' # Or via MCP (no auth required) { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "register_user", "arguments": { "email": "user@example.com" } } }
Check your email and click the verification link, or visit:
https://your-server.com/verify?token=YOUR_VERIFICATION_TOKEN
Use the access token from the verification page in the Authorization header:
curl -X POST https://your-server.com/mcp \ -H "Authorization: YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'
Create AI-enhanced thought forks that automatically generate multiple perspectives:
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "create_thought_fork", "arguments": { "title": "AI Ethics in Healthcare", "description": "Explore the ethical implications of AI in medical diagnosis and treatment", "branches": 4 } } }
This will:
- Create a thought fork
- Generate 4 different analytical perspectives using AI
- Create parallel explorations for each perspective
- Extract key insights from each exploration
- Return the complete thought fork with all explorations
Merge the explorations with AI synthesis:
{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "merge_thought_fork", "arguments": { "id": "thought-fork-id" } } }
The blob storage system provides secure, user-namespaced key-value storage for arbitrary data:
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "blob_set", "arguments": { "key": "user-preferences", "value": { "theme": "dark", "language": "en", "notifications": true } } } }
Retrieve stored data:
{ "jsonrpc": "2.0", "id": 2, "method": "tools/call", "params": { "name": "blob_get", "arguments": { "key": "user-preferences" } } }
List all your stored blobs:
{ "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "blob_list", "arguments": { "prefix": "config-" } } }
- Automatic Namespacing: All blob keys are automatically prefixed with your user ID
- JSON Support: Automatic JSON serialization/deserialization (can be disabled)
- Prefix Filtering: List blobs with specific prefixes
- Existence Checking: Check if a blob exists without retrieving its value
- Admin Access: Admin users can access global blob storage
- Secure Isolation: Users can only access their own blobs
All resources support full deletion with dependency handling:
- Goals: Deleting a goal removes all subgoals and associated tasks
- Tasks: Deleting a task removes it from goals and other task dependencies
- Thought Forks: Deleting removes all associated explorations
- Skills: Deleting removes all execution history
- States: Direct deletion of cognitive states
- Obtained through email verification
- Scoped to user's own resources
- Required for all cognitive tools
- Set via
MCP_AUTH_TOKENenvironment variable - Access to legacy global resources
- Full system access
- User registration tools only
- No authentication required
register_user- Register with emailverify_email- Verify email with tokenresend_verification- Resend verification email
- Blob Storage:
blob_list,blob_get,blob_set,blob_delete,blob_exists - Thought Forking:
create_thought_fork,merge_thought_fork,delete_thought_fork - Goals:
create_goal,update_goal,delete_goal,list_goals - Tasks:
create_task,update_task,delete_task,list_tasks - States:
save_cognitive_state,load_cognitive_state,delete_cognitive_state - Skills:
create_skill,execute_skill,delete_skill,list_skills
skill_[name]- Execute user-created skills dynamically
- Register:
register_userwith email - Verify: Click email link to get access token
- Store Data: Use
blob_setto store configuration or data - Create Goal: Use
create_goalto set objectives - Fork Thoughts: Use
create_thought_forkfor AI-assisted analysis - Merge Insights: Use
merge_thought_forkfor AI synthesis - Create Tasks: Break down goals with
create_task - Build Skills: Create reusable tools with
create_skill - Save State: Capture progress with
save_cognitive_state
- Email verification required for access
- User-scoped resource isolation
- Automatic blob storage namespacing
- Secure skill execution sandboxing
- Token-based authentication
- Foreign key constraint handling
Server Version: 2.0.0 - Now with user registration and AI-enhanced cognitive tools