> ## 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.

# What is the API endpoint to link a prompt to an MCP server?

> Raw endpoint structures for configuring generic Server-to-Prompt mapping associations.

# The Server Prompt Association Endpoint

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

To orchestrate the binding of abstract Provider Prompts to independent MCP Server execution rings, you utilize the targeted sub-routing association structure via an HTTP `POST`.

## The API Endpoint

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

In this pattern, `{serverId}` serves as the immutable base context for the orchestration logic.

### Structural Requirements

You must provide a [`CreateServerPromptRequest`](/api-reference/servers/prompts/create-mcp-server-prompt-association) payload in order to instantiate the linkage mapping. The schema demands exactly two parameters grouped within a `prompt` block:

```json theme={null}
{
 "prompt": {
 "serverID": "sE8vKd2qLp9",
 "promptID": "mX5vTr9pK2w"
 }
}
```

* **`serverID`**: The exact same 11-char hash provided in the URL directory `[{serverId}]`.
* **`promptID`**: The specific Provider Prompt structure that the LLM connecting to the server should be allowed to interact with. You do not need to identify the origin provider, as the manager resolves the `promptID` globally.

A successful assignment yields a `200 OK` housing a [`CreateServerPromptResponse`](/api-reference/servers/prompts/create-mcp-server-prompt-association) with a copy of the saved mapping schema.
