A powerful task management application that integrates seamlessly with ChatGPT through the OpenAI Apps SDK. Manage your tasks naturally through conversation and get things done without leaving your chat.
- Natural Language Task Management: Create, update, and manage tasks using simple chat commands
- Smart Organization: Automatically categorize and prioritize tasks based on context
- Real-time Updates: See your task list update in real-time within ChatGPT
- Rich Visual Interface: Interactive widgets for better task visualization
- Cross-platform: Access your tasks from any device with ChatGPT
- Node.js 18+ and npm
- OpenAI Developer Account with Apps SDK access
- ChatGPT account with app development access
-
Clone the repository:
git clone https://github.com/sholajegede/chatgpt-task-manager-app.git cd chatgpt-task-manager-app -
Install dependencies:
npm install
-
Set up environment variables:
cp .env.local.example .env.local # Update the environment variables in .env.local -
Run the development server:
npm run dev
Deploy your Task Manager with one click:
- Push your code to a GitHub repository
- Import the repository to Vercel
- Set up the required environment variables
- Deploy!
Create a .env.local file with the following variables:
# Required for local development
NEXT_PUBLIC_APP_NAME=TaskManager
NEXT_PUBLIC_APP_DESCRIPTION="Your AI-powered task management assistant"
NEXT_PUBLIC_APP_URL=http://localhost:3000
# Required for production
NEXT_PUBLIC_VERCEL_URL=${VERCEL_URL}
NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL=${VERCEL_PROJECT_PRODUCTION_URL}
# Add your OpenAI API key if needed
# OPENAI_API_KEY=your_openai_api_key
.
βββ app/
β βββ api/ # API routes
β βββ mcp/ # Model Context Protocol implementation
β βββ components/ # Reusable React components
β βββ lib/ # Shared utilities and services
β βββ types/ # TypeScript type definitions
βββ public/ # Static files
βββ tests/ # Test files
npm run dev- Start development servernpm run build- Build for productionnpm start- Start production servernpm test- Run testsnpm run lint- Run ESLint
This app integrates with ChatGPT using the OpenAI Apps SDK, allowing users to manage tasks through natural language. The MCP server exposes several tools that can be called from within ChatGPT.
- "Add a task to buy groceries tomorrow at 5pm"
- "Show me my tasks for today"
- "Mark 'Finish project' as complete"
- "What's my most important task?"
- Tool Invocation: ChatGPT calls a tool registered in
app/mcp/route.ts - Task Processing: The MCP server processes the task and updates the database
- Widget Rendering: Task lists and details are rendered in interactive widgets
- Real-time Updates: The UI updates automatically when tasks change
For detailed documentation on the OpenAI Apps SDK and MCP server implementation, please refer to:
- OpenAI Apps SDK Documentation
- Model Context Protocol (MCP) Reference
- Widget Development Guide
- Next.js Documentation
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ using Next.js and the OpenAI Apps SDK
const nextConfig: NextConfig = {
assetPrefix: baseURL, // Prevents 404s on /_next/ files in iframe
};Without this, Next.js will attempt to load assets from the iframe's URL, causing 404 errors.
Handles browser OPTIONS preflight requests required for cross-origin RSC (React Server Components) fetching during client-side navigation:
export function middleware(request: NextRequest) {
if (request.method === "OPTIONS") {
// Return 204 with CORS headers
}
// Add CORS headers to all responses
}The <NextChatSDKBootstrap> component patches browser APIs to work correctly within the ChatGPT iframe:
What it patches:
history.pushState/history.replaceState- Prevents full-origin URLs in historywindow.fetch- Rewrites same-origin requests to use the correct base URL<html>attribute observer - Prevents ChatGPT from modifying the root element
Required configuration:
<html lang="en" suppressHydrationWarning>
<head>
<NextChatSDKBootstrap baseUrl={baseURL} />
</head>
<body>{children}</body>
</html>Note: suppressHydrationWarning is currently required because ChatGPT modifies the initial HTML before the Next.js app hydrates, causing hydration mismatches.
npm install
# or
pnpm installnpm run dev
# or
pnpm devOpen http://localhost:3000 to see the app.
The MCP server is available at:
http://localhost:3000/mcp
-
Deploy your app to Vercel using the button below:
-
After deployment, copy your deployed URL (e.g.,
https://your-app.vercel.app) -
In ChatGPT, navigate to Settings β Connectors β Create and add your MCP server URL with the
/mcppath (e.g.,https://your-app.vercel.app/mcp)
Note: Connecting MCP servers to ChatGPT requires developer mode access. See the connection guide for setup instructions.
app/
βββ mcp/
β βββ route.ts # MCP server with tool/resource registration
βββ layout.tsx # Root layout with SDK bootstrap
βββ page.tsx # Homepage content
βββ globals.css # Global styles
middleware.ts # CORS handling for RSC
next.config.ts # Asset prefix configuration
- Tool Invocation: ChatGPT calls a tool registered in
app/mcp/route.ts - Resource Reference: Tool response includes
templateUripointing to a registered resource - Widget Rendering: ChatGPT fetches the resource HTML and renders it in an iframe
- Client Hydration: Next.js hydrates the app inside the iframe with patched APIs
- Navigation: Client-side navigation uses patched
fetchto load RSC payloads
- OpenAI Apps SDK Documentation
- OpenAI Apps SDK - MCP Server Guide
- Model Context Protocol
- Next.js Documentation
This project is designed to work seamlessly with Vercel deployment. The baseUrl.ts configuration automatically detects Vercel environment variables and sets the correct asset URLs.
The configuration automatically handles:
- Production URLs via
VERCEL_PROJECT_PRODUCTION_URL - Preview/branch URLs via
VERCEL_BRANCH_URL - Asset prefixing for correct resource loading in iframes