diff --git a/prompts.config.ts b/prompts.config.ts index 593c6af0..a94b62b7 100644 --- a/prompts.config.ts +++ b/prompts.config.ts @@ -62,6 +62,8 @@ export default defineConfig({ aiSearch: true, // Enable AI-powered generation features (requires OPENAI_API_KEY) aiGeneration: true, + // Enable MCP (Model Context Protocol) features including API key generation + mcp: true, }, // Homepage customization diff --git a/public/context7.svg b/public/context7.svg new file mode 100644 index 00000000..ab994df7 --- /dev/null +++ b/public/context7.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/app/[username]/page.tsx b/src/app/[username]/page.tsx index 786e2104..719031ee 100644 --- a/src/app/[username]/page.tsx +++ b/src/app/[username]/page.tsx @@ -7,6 +7,7 @@ import { getPromptUrl } from "@/lib/urls"; import { Calendar, ArrowBigUp, FileText, Settings, GitPullRequest, Clock, Check, X, Pin, BadgeCheck, Users, ShieldCheck } from "lucide-react"; import { auth } from "@/lib/auth"; import { db } from "@/lib/db"; +import config from "@/../prompts.config"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; @@ -326,7 +327,7 @@ export default async function UserProfilePage({ params, searchParams }: UserProf {/* Actions - desktop only */}
- + {config.features.mcp !== false && } {isOwner && ( +
+ + ); +} + +interface ColorCardProps { + color: string; + name: string; + description: string; +} + +function ColorCard({ color, name, description }: ColorCardProps) { + const [copied, setCopied] = useState(false); + + const handleCopy = async () => { + await navigator.clipboard.writeText(color); + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }; + + return ( + + ); +} + +function isLight(color: string): boolean { + const hex = color.replace("#", ""); + const r = parseInt(hex.substr(0, 2), 16); + const g = parseInt(hex.substr(2, 2), 16); + const b = parseInt(hex.substr(4, 2), 16); + const brightness = (r * 299 + g * 587 + b * 114) / 1000; + return brightness > 128; +} + +export default function BrandAssetsPage() { + const branding = useBranding(); + + // Redirect if using clone branding + if (branding.useCloneBranding) { + notFound(); + } + + return ( +
+

Brand Assets

+

+ Official logos, colors, and brand guidelines for {branding.name}. Free to use for press, partnerships, and community projects. +

+ +
+ {/* Logos Section */} +
+

Logos

+
+ {/* Logo for light backgrounds */} + + prompts.chat logo + + + {/* Logo for dark backgrounds */} + + prompts.chat logo dark + + + {/* Logo with text - light */} + +
+ prompts.chat logo + {branding.name} +
+
+ + {/* Logo with text - dark */} + +
+ prompts.chat logo dark + {branding.name} +
+
+
+
+ + {/* Colors Section */} +
+

Brand Colors

+

Click to copy hex value

+
+ + + + +
+
+ + {/* Usage Guidelines */} +
+

Usage Guidelines

+
+
    +
  • Do not stretch, distort, or rotate the logo
  • +
  • Maintain adequate spacing around the logo
  • +
  • Use the dark logo on light backgrounds and vice versa
  • +
  • Do not add effects like shadows or gradients to the logo
  • +
  • The logo should be clearly visible against the background
  • +
+
+
+ + {/* License */} +
+

License

+

+ The {branding.name} brand assets are provided under{" "} + + CC0 1.0 Universal + + . You are free to use these assets for any purpose without attribution. +

+
+
+
+ ); +} diff --git a/src/app/categories/[slug]/page.tsx b/src/app/categories/[slug]/page.tsx index 9a1b8579..ded5c0ac 100644 --- a/src/app/categories/[slug]/page.tsx +++ b/src/app/categories/[slug]/page.tsx @@ -5,6 +5,7 @@ import { getTranslations } from "next-intl/server"; import { ArrowLeft } from "lucide-react"; import { auth } from "@/lib/auth"; import { db } from "@/lib/db"; +import config from "@/../prompts.config"; import { Button } from "@/components/ui/button"; import { PromptList } from "@/components/prompts/prompt-list"; import { SubscribeButton } from "@/components/categories/subscribe-button"; @@ -139,7 +140,7 @@ export default async function CategoryPage({ params }: CategoryPageProps) { {category._count.subscribers} subscribers - + {config.features.mcp !== false && } diff --git a/src/app/docs/api/page.tsx b/src/app/docs/api/page.tsx index 90e71477..053d9f95 100644 --- a/src/app/docs/api/page.tsx +++ b/src/app/docs/api/page.tsx @@ -10,10 +10,11 @@ import { TableRow, } from "@/components/ui/table"; import { McpConfigTabs } from "@/components/mcp/mcp-config-tabs"; +import config from "@/../prompts.config"; export const metadata = { title: "API Documentation - prompts.chat", - description: "MCP-first API for searching and discovering AI prompts programmatically", + description: "API for searching and discovering AI prompts programmatically", }; export default async function ApiDocsPage() { @@ -25,83 +26,87 @@ export default async function ApiDocsPage() {

API Documentation

- prompts.chat provides an MCP-first API for searching and discovering AI prompts programmatically. - Use the MCP endpoint directly with any MCP-compatible client, or make standard HTTP requests. + {config.features.mcp !== false + ? "prompts.chat provides an MCP-first API for searching and discovering AI prompts programmatically. Use the MCP endpoint directly with any MCP-compatible client, or make standard HTTP requests." + : "prompts.chat provides an API for searching and discovering AI prompts programmatically." + }

- {/* MCP Overview */} -
-

- - MCP-First API -

-

- Our API is built on the{" "} - - Model Context Protocol (MCP) - - , enabling seamless integration with AI assistants, IDEs, and automation tools. - The same endpoint works for both MCP clients and traditional REST-style requests. -

-
-

# MCP Endpoint

-

POST {baseUrl}/api/mcp

-
-
- - {/* Using with MCP Clients */} -
-

- - Using with MCP Clients -

-

- Add prompts.chat to your MCP client configuration. Choose your client and connection type below: -

- -

- Remote connects directly to prompts.chat API. Local runs the MCP server locally via npx. -

-
- - {/* Authentication */} -
-

- - Authentication -

-

- Most API features work without authentication. However, to save prompts via MCP or access your private prompts, - you need to authenticate using an API key. -

- -
-
-

Generate an API Key

+ {config.features.mcp !== false && ( + <> + {/* MCP Overview */} +
+

+ + MCP-First API +

- Go to{" "} - - Settings + Our API is built on the{" "} + + Model Context Protocol (MCP) - {" "}to generate your API key. Keys start with pchat_. + , enabling seamless integration with AI assistants, IDEs, and automation tools. + The same endpoint works for both MCP clients and traditional REST-style requests.

-
-
-

Using the API Key

-

- Pass your API key via the PROMPTS_API_KEY header. -

-
-
+
+

# MCP Endpoint

+

POST {baseUrl}/api/mcp

+
+
-
-
{`# Remote: HTTP transport with headers
+            {/* Using with MCP Clients */}
+            
+

+ + Using with MCP Clients +

+

+ Add prompts.chat to your MCP client configuration. Choose your client and connection type below: +

+ +

+ Remote connects directly to prompts.chat API. Local runs the MCP server locally via npx. +

+
+ + {/* Authentication */} +
+

+ + Authentication +

+

+ Most API features work without authentication. However, to save prompts via MCP or access your private prompts, + you need to authenticate using an API key. +

+ +
+
+

Generate an API Key

+

+ Go to{" "} + + Settings + + {" "}to generate your API key. Keys start with pchat_. +

+
+
+

Using the API Key

+

+ Pass your API key via the PROMPTS_API_KEY header. +

+
+
+ +
+
{`# Remote: HTTP transport with headers
 "prompts-chat": {
   "url": "${baseUrl}/api/mcp",
   "headers": {
@@ -123,30 +128,30 @@ curl -X POST ${baseUrl}/api/mcp \\
   -H "Content-Type: application/json" \\
   -H "PROMPTS_API_KEY: pchat_your_api_key_here" \\
   -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}'`}
-
+
-

- Remote (HTTP) sends requests to prompts.chat with the API key in headers. - Local (stdio) runs the MCP server locally via npx with the API key as an environment variable. - With authentication, you can use the save_prompt tool - and search results will include your private prompts. -

- +

+ Remote (HTTP) sends requests to prompts.chat with the API key in headers. + Local (stdio) runs the MCP server locally via npx with the API key as an environment variable. + With authentication, you can use the save_prompt tool + and search results will include your private prompts. +

+ - {/* MCP Prompts */} -
-

- - MCP Prompts -

-

- All public prompts are exposed as native MCP prompts. This allows MCP clients to list - and use prompts directly via slash commands or prompt pickers. You can filter prompts - by category or tag using URL query parameters. -

- -
-
{`# Filter by users (one or more usernames)
+            {/* MCP Prompts */}
+            
+

+ + MCP Prompts +

+

+ All public prompts are exposed as native MCP prompts. This allows MCP clients to list + and use prompts directly via slash commands or prompt pickers. You can filter prompts + by category or tag using URL query parameters. +

+ +
+
{`# Filter by users (one or more usernames)
 "prompts-chat": {
   "url": "${baseUrl}/api/mcp?users=f,torvalds"
 }
@@ -165,24 +170,24 @@ curl -X POST ${baseUrl}/api/mcp \\
 "prompts-chat": {
   "url": "${baseUrl}/api/mcp?users=f&categories=coding&tags=js"
 }`}
-
- -
-
-

prompts/list

-

Browse all available prompts with pagination support.

-
-
-

prompts/get

-

- Retrieve a prompt by ID. Variables ({"${name}"} or {"${name:default}"}) are automatically - substituted with provided arguments. -

-
-
+
+ +
+
+

prompts/list

+

Browse all available prompts with pagination support.

+
+
+

prompts/get

+

+ Retrieve a prompt by ID. Variables ({"${name}"} or {"${name:default}"}) are automatically + substituted with provided arguments. +

+
+
-
-
{`# List prompts
+              
+
{`# List prompts
 curl -X POST ${baseUrl}/api/mcp \\
   -H "Content-Type: application/json" \\
   -H "Accept: application/json, text/event-stream" \\
@@ -201,15 +206,15 @@ curl -X POST ${baseUrl}/api/mcp \\
       "arguments": { "topic": "AI safety" }
     }
   }'`}
-
-
+
+ - {/* Available Tools */} -
-

- - Available Tools -

+ {/* Available Tools */} +
+

+ + Available Tools +

{/* search_prompts Tool */}
@@ -408,17 +413,17 @@ curl -X POST ${baseUrl}/api/mcp \\
- {/* MCP Protocol Example */} -
-

- - MCP Protocol Examples -

+ {/* MCP Protocol Example */} +
+

+ + MCP Protocol Examples +

-
-

Initialize Connection

-
-
{`curl -X POST ${baseUrl}/api/mcp \\
+              
+

Initialize Connection

+
+
{`curl -X POST ${baseUrl}/api/mcp \\
   -H "Content-Type: application/json" \\
   -H "Accept: application/json, text/event-stream" \\
   -d '{
@@ -431,13 +436,13 @@ curl -X POST ${baseUrl}/api/mcp \\
       "clientInfo": { "name": "my-app", "version": "1.0.0" }
     }
   }'`}
-
-
+
+
-
-

List Available Tools

-
-
{`curl -X POST ${baseUrl}/api/mcp \\
+              
+

List Available Tools

+
+
{`curl -X POST ${baseUrl}/api/mcp \\
   -H "Content-Type: application/json" \\
   -H "Accept: application/json, text/event-stream" \\
   -d '{
@@ -445,13 +450,13 @@ curl -X POST ${baseUrl}/api/mcp \\
     "id": 2,
     "method": "tools/list"
   }'`}
-
-
+
+
-
-

Search Prompts

-
-
{`curl -X POST ${baseUrl}/api/mcp \\
+              
+

Search Prompts

+
+
{`curl -X POST ${baseUrl}/api/mcp \\
   -H "Content-Type: application/json" \\
   -H "Accept: application/json, text/event-stream" \\
   -d '{
@@ -466,18 +471,18 @@ curl -X POST ${baseUrl}/api/mcp \\
       }
     }
   }'`}
-
-
-
+
+ + - {/* Response Format */} -
-

Response Format

-

- The search_prompts tool returns results in the following format: -

-
-
{`{
+            {/* Response Format */}
+            
+

Response Format

+

+ The search_prompts tool returns results in the following format: +

+
+
{`{
   "query": "code review",
   "count": 2,
   "prompts": [
@@ -495,14 +500,16 @@ curl -X POST ${baseUrl}/api/mcp \\
     }
   ]
 }`}
-
-
+
+
+ + )} {/* REST API Alternative */}
-

REST API Alternative

+

REST API

- For simpler integrations, you can also use the standard REST endpoint: + Use the standard REST endpoint to search and retrieve prompts:

{`# Search prompts via REST
@@ -513,17 +520,6 @@ curl "${baseUrl}/api/prompts/{id}"`}
- {/* Server Info */} -
-

Server Information

-

- Get MCP server information and available tools: -

-
-

GET {baseUrl}/api/mcp

-
-
- {/* Rate Limits */}

Rate Limits

diff --git a/src/app/docs/self-hosting/page.tsx b/src/app/docs/self-hosting/page.tsx index 93ee15b6..45582018 100644 --- a/src/app/docs/self-hosting/page.tsx +++ b/src/app/docs/self-hosting/page.tsx @@ -2,6 +2,7 @@ import Link from "next/link"; import Image from "next/image"; import { Server, Database, Key, Palette, Globe, Settings, HardDrive, Cpu, BookOpen } from "lucide-react"; import DeepWikiIcon from "@/../public/deepwiki.svg"; +import Context7Icon from "@/../public/context7.svg"; import { Table, TableBody, @@ -41,47 +42,83 @@ export default function SelfHostingPage() {
- {/* DeepWiki */} -
-

- - DeepWiki -

-

- - DeepWiki - - {" "}provides AI-powered documentation and insights for this repository. It automatically generates comprehensive documentation from the codebase, making it easier to understand the project structure, APIs, and implementation details. -

-
    -
  • AI-generated documentation from source code
  • -
  • Interactive codebase exploration
  • -
  • Architecture diagrams and component relationships
  • -
  • Ask questions about the codebase
  • -
+ {/* Using Documentation AI-Agents */} +
+

Using Documentation AI-Agents

+ +
+ {/* DeepWiki */} +
+

+ + DeepWiki +

+

+ + DeepWiki + + {" "}provides AI-powered documentation and insights for this repository. +

+
    +
  • AI-generated documentation from source code
  • +
  • Interactive codebase exploration
  • +
  • Architecture diagrams and component relationships
  • +
  • Available as an MCP server
  • +
+
+ + {/* Context7 */} +
+

+ + Context7 +

+

+ + Context7 + + {" "}is an AI-powered chat interface for exploring and understanding this repository. +

+
    +
  • Chat with the codebase using natural language
  • +
  • Get answers with code references
  • +
  • Understand implementation details quickly
  • +
  • Available as an MCP server
  • +
+
+
- {/* Prerequisites */} -
-

- - Prerequisites -

-
    -
  • Node.js 18+
  • -
  • PostgreSQL database
  • -
  • npm or yarn
  • -
-
+ {/* Manually */} +
+

Manually

- {/* Installation */} -
-

Quick Start

+ {/* Prerequisites */} +
+

+ + Prerequisites +

+
    +
  • Node.js 18+
  • +
  • PostgreSQL database
  • +
  • npm or yarn
  • +
+
+ + {/* Installation */} +
+

Quick Start

# Clone the repository

git clone https://github.com/f/awesome-chatgpt-prompts.git

@@ -96,14 +133,14 @@ export default function SelfHostingPage() {

# Start development server

npm run dev

-
+ - {/* Environment Variables */} -
-

- - Environment Variables -

+ {/* Environment Variables */} +
+

+ + Environment Variables +

Create a .env file based on .env.example:

@@ -280,14 +317,14 @@ export default function SelfHostingPage() {
-
+ - {/* Configuration */} -
-

- - Configuration (prompts.config.ts) -

+ {/* Configuration */} +
+

+ + Configuration (prompts.config.ts) +

Customize your instance by editing prompts.config.ts:

@@ -508,14 +545,14 @@ export default function SelfHostingPage() {
-
+ - {/* White-label */} -
-

- - White-Label Mode -

+ {/* White-label */} +
+

+ + White-Label Mode +

Set useCloneBranding = true at the top of the config to:

@@ -530,14 +567,14 @@ export default function SelfHostingPage() {

// prompts.config.ts

const useCloneBranding = true;

-
+ - {/* Production */} -
-

- - Production Deployment -

+ {/* Production */} +
+

+ + Production Deployment +

npm run build

npm run start

@@ -545,11 +582,11 @@ export default function SelfHostingPage() {

Deploy to Vercel, Railway, Render, or any Node.js hosting platform. Make sure to set all environment variables in your hosting provider's dashboard.

-
+ - {/* Support */} -
-

Support

+ {/* Support */} +
+

Support

For issues and questions, please open a{" "} {" "}file in the repository. -

+

+
diff --git a/src/app/prompts/page.tsx b/src/app/prompts/page.tsx index d74eddff..2e0f32f9 100644 --- a/src/app/prompts/page.tsx +++ b/src/app/prompts/page.tsx @@ -183,7 +183,7 @@ export default async function PromptsPage({ searchParams }: PromptsPageProps) { {!config.homepage?.useCloneBranding && (
- + {config.features.mcp !== false && }
)}