API Documentation

This platform 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.

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 https://prompts.ahmad.wtf/api/mcp

Using with MCP Clients

Add AI Prompts to your MCP client configuration. Choose your client and connection type below:

{
  "mcp": {
    "servers": {
      "ai-prompts": {
        "type": "http",
        "url": "https://prompts.ahmad.wtf/api/mcp"
      }
    }
  }
}

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

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
"ai-prompts": {
  "url": "https://prompts.ahmad.wtf/api/mcp",
  "headers": {
    "PROMPTS_API_KEY": "pchat_your_api_key_here"
  }
}

# Local: stdio transport with environment variable
"ai-prompts": {
  "command": "npx",
  "args": ["-y", "@fkadev/ai-prompts-mcp"],
  "env": {
    "PROMPTS_API_KEY": "pchat_your_api_key_here"
  }
}

# Or via curl (remote)
curl -X POST https://prompts.ahmad.wtf/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 the API 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

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)
"ai-prompts": {
  "url": "https://prompts.ahmad.wtf/api/mcp?users=f,torvalds"
}

# Filter by categories
"ai-prompts": {
  "url": "https://prompts.ahmad.wtf/api/mcp?categories=coding,marketing"
}

# Filter by tags
"ai-prompts": {
  "url": "https://prompts.ahmad.wtf/api/mcp?tags=chatgpt,writing"
}

# Combine filters
"ai-prompts": {
  "url": "https://prompts.ahmad.wtf/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.

# List prompts
curl -X POST https://prompts.ahmad.wtf/api/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "prompts/list"}'

# Get a specific prompt with arguments
curl -X POST https://prompts.ahmad.wtf/api/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "prompts/get",
    "params": {
      "name": "code-review-assistant",
      "arguments": { "topic": "AI safety" }
    }
  }'

Available Tools

search_prompts

Search for AI prompts by keyword. Returns matching prompts with title, description, content, author, category, and tags.

ParameterTypeRequiredDescription
querystringYesSearch query to find relevant prompts
limitnumberNoMaximum results (default: 10, max: 50)
typestringNoFilter by type: TEXT, STRUCTURED, IMAGE, VIDEO, AUDIO
categorystringNoFilter by category slug
tagstringNoFilter by tag slug

get_prompt

Get a prompt by ID. If the prompt contains template variables (like ${variable} or ${variable:default}), the MCP client will be asked to provide values through elicitation.

ParameterTypeRequiredDescription
idstringYesThe ID of the prompt to retrieve

Variable Elicitation

When a prompt contains variables like ${name} or ${topic:default value}, MCP clients that support elicitation will prompt the user to fill in these values. Variables with default values (after the colon) are optional. The prompt content will be returned with variables replaced.

save_promptRequires Auth

Save a new prompt to your account. Requires API key authentication. Prompts are private by default unless you've changed the default in your settings.

ParameterTypeRequiredDescription
titlestringYesTitle of the prompt (max 200 chars)
contentstringYesThe prompt content. Can include variables like ${var}
descriptionstringNoOptional description (max 500 chars)
tagsstring[]NoArray of tag names (max 10)
categorystringNoCategory slug
isPrivatebooleanNoOverride default privacy setting
typestringNoTEXT (default), STRUCTURED, IMAGE, VIDEO, AUDIO
# Save a prompt via MCP
curl -X POST https://prompts.ahmad.wtf/api/mcp \
  -H "Content-Type: application/json" \
  -H "PROMPTS_API_KEY: pchat_your_api_key_here" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "save_prompt",
      "arguments": {
        "title": "My Code Review Prompt",
        "content": "Review this code for ${language} best practices:\n\n${code}",
        "description": "A helpful code review assistant",
        "tags": ["coding", "review"],
        "isPrivate": false
      }
    }
  }'

improve_promptRequires Auth

Transform a basic prompt into a well-structured, comprehensive prompt using AI. Searches for similar prompts for inspiration and generates improved versions.

ParameterTypeRequiredDescription
promptstringYesThe prompt to improve (max 10,000 chars)
outputTypestringNoContent type: text (default), image, video, sound
outputFormatstringNoResponse format: text (default), structured_json, structured_yaml
# Improve a prompt via MCP
curl -X POST https://prompts.ahmad.wtf/api/mcp \
  -H "Content-Type: application/json" \
  -H "PROMPTS_API_KEY: pchat_your_api_key_here" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "improve_prompt",
      "arguments": {
        "prompt": "write a blog post about AI",
        "outputType": "text",
        "outputFormat": "text"
      }
    }
  }'

save_skillRequires Auth

Save a new Agent Skill to your account. Skills are multi-file prompts that can include SKILL.md (required), reference docs, scripts, and configuration files. Perfect for creating comprehensive coding agent skills.

ParameterTypeRequiredDescription
titlestringYesTitle of the skill (max 200 chars)
filesarrayYesArray of {filename, content}. Must include SKILL.md
descriptionstringNoOptional description (max 500 chars)
tagsstring[]NoArray of tag names (max 10)
categorystringNoCategory slug
isPrivatebooleanNoOverride default privacy setting
# Save a skill via MCP
curl -X POST https://prompts.ahmad.wtf/api/mcp \
  -H "Content-Type: application/json" \
  -H "PROMPTS_API_KEY: pchat_your_api_key_here" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "save_skill",
      "arguments": {
        "title": "PDF Processing Skill",
        "description": "Comprehensive PDF manipulation toolkit",
        "files": [
          {"filename": "SKILL.md", "content": "# PDF Processing\n\nThis skill helps with PDF manipulation..."},
          {"filename": "reference.md", "content": "# API Reference\n\n..."},
          {"filename": "scripts/extract.py", "content": "import pypdf\n..."}
        ],
        "tags": ["pdf", "documents"]
      }
    }
  }'

add_file_to_skillRequires Auth

Add a new file to an existing Agent Skill. Use this to add reference docs, scripts, or configuration files.

ParameterTypeRequiredDescription
skillIdstringYesID of the skill to add the file to
filenamestringYesFile path (e.g., reference.md, scripts/helper.py)
contentstringYesFile content

remove_file_from_skillRequires Auth

Remove a file from an existing Agent Skill. Cannot remove SKILL.md as it is required.

ParameterTypeRequiredDescription
skillIdstringYesID of the skill to remove the file from
filenamestringYesFile path to remove (cannot be SKILL.md)

get_skill

Get an Agent Skill by ID, including all its files (SKILL.md, reference docs, scripts, etc.). Returns skill metadata and file contents. Public skills are accessible without authentication; private skills require API key authentication.

ParameterTypeRequiredDescription
idstringYesThe ID of the skill to retrieve
# Get a skill via MCP
curl -X POST https://prompts.ahmad.wtf/api/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "get_skill",
      "arguments": {
        "id": "skill_id_here"
      }
    }
  }'

MCP Protocol Examples

Initialize Connection

curl -X POST https://prompts.ahmad.wtf/api/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2024-11-05",
      "capabilities": {},
      "clientInfo": { "name": "my-app", "version": "1.0.0" }
    }
  }'

List Available Tools

curl -X POST https://prompts.ahmad.wtf/api/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/list"
  }'

Search Prompts

curl -X POST https://prompts.ahmad.wtf/api/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "search_prompts",
      "arguments": {
        "query": "code review",
        "limit": 5
      }
    }
  }'

Response Format

The search_prompts tool returns results in the following format:

{
  "query": "code review",
  "count": 2,
  "prompts": [
    {
      "id": "abc123",
      "title": "Code Review Assistant",
      "description": "A prompt for conducting thorough code reviews",
      "content": "You are an expert code reviewer...",
      "type": "TEXT",
      "author": "username",
      "category": "Development",
      "tags": ["coding", "review", "development"],
      "votes": 42,
      "createdAt": "2024-01-15T10:30:00.000Z"
    }
  ]
}

Improve Prompt APIRequires Auth

Transform basic prompts into well-structured, comprehensive prompts using AI. The API uses embeddings to find similar prompts for inspiration and generates improved versions while preserving the original intent. Requires API key authentication.

ParameterTypeRequiredDescription
promptstringYesThe prompt to improve (max 10,000 chars)
outputTypestringNoContent type: text (default), image, video, sound
outputFormatstringNoResponse format: text (default), structured_json, structured_yaml
# Improve a prompt
curl -X POST https://prompts.ahmad.wtf/api/improve-prompt \
  -H "Content-Type: application/json" \
  -H "X-API-Key: pchat_your_api_key_here" \
  -d '{
    "prompt": "write a blog post about AI",
    "outputType": "text",
    "outputFormat": "text"
  }'

Response Format

{
  "original": "write a blog post about AI",
  "improved": "You are an expert technology writer...

## Task
Write an engaging blog post...",
  "outputType": "text",
  "outputFormat": "text",
  "inspirations": [
    { "title": "Blog Writer", "similarity": 85 },
    { "title": "Content Creator", "similarity": 72 }
  ],
  "model": "gpt-4o"
}

Try It Out

# API Request

curl -X POST /api/improve-prompt \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "",
    "outputType": "text",
    "outputFormat": "text"
  }'

REST API

Use the standard REST endpoint to search and retrieve prompts:

# Search prompts via REST
curl "https://prompts.ahmad.wtf/api/prompts?q=code+review&perPage=10"

# Get prompt by ID
curl "https://prompts.ahmad.wtf/api/prompts/{id}"

Rate Limits

The API is public and free to use. Please be respectful with request frequency. For high-volume usage, consider self-hosting your own instance.

Support

For issues and feature requests, please open a GitHub Issue.