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 */}
- 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." + }
- 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
-- 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. -
-- 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 */} +
- 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.
+
- 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" }
}
}'`}
-
-
+
- MCP Protocol Examples
-
+ MCP Protocol Examples
+ {`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" }
}
}'`}
-
-
+ {`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"
}'`}
-
-
+ {`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 \\
}
}
}'`}
-
-
-
+
- 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 \\
}
]
}`}
-
-
+ - 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}"`}
- Get MCP server information and available tools: -
-GET {baseUrl}/api/mcp
-- - 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. -
-+ + DeepWiki + + {" "}provides AI-powered documentation and insights for this repository. +
++ + Context7 + + {" "}is an AI-powered chat interface for exploring and understanding this repository. +
+# 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
Create a .env file based on .env.example:
Customize your instance by editing prompts.config.ts:
Set useCloneBranding = true at the top of the config to:
// prompts.config.ts
const useCloneBranding = true;
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.
- +For issues and questions, please open a{" "} {" "}file in the repository. -
+ +