> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hasmcp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I associate a prompt to my MCP server?

> Understand the API workflow for linking reusable Prompts from Provider catalogs to active MCP Server endpoints.

# Associating a Prompt to an MCP Server

*Note: Visual UI management for Provider Prompts is currently under active development. Utilizing Prompts currently requires the HasMCP REST API.*

A `Prompt` acts as a pre-constructed system instruction or conversational template for the Model Context Protocol. While they are created and stored inside **Providers**, they must be explicitly associated with a **Server** before an LLM agent can invoke them.

## Using REST API

To map an existing prompt instruction set to your running agent container, use the routed `POST` Server endpoints.

### The API Endpoint

**`POST /servers/{serverId}/prompts`**

### Preparing the Payload

The mapping architecture requires establishing exactly which server is receiving the mapping, and exactly which prompt logic is being exposed.

Unlike tools, which require establishing the provider relationship explicitly, the `prompt` schema infers the provider configuration automatically based on the `promptID`.

```bash theme={null}
curl -X POST https://app.hasmcp.com/api/v1/servers/sE8vKd2qLp9/prompts \
 -H "Authorization: Bearer YOUR_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{
 "prompt": {
 "serverID": "sE8vKd2qLp9",
 "promptID": "mX5vTr9pK2w"
 }
 }'
```

If the `promptID` mapping exists and the auth token has execution authorization on the targeted `serverID`, the orchestrator immediately saves the binding and responds with a `201 Created`.
