Associating a Resource to an MCP Server
Using HasMCP UI
While tools execute actions, Resources expose static or dynamic read-only data blobs (like log files, system statuses, or raw configuration data) to your AI Agents. To authorize a server to read a specific resource:- Navigate to the MCP Servers layout in your HasMCP dashboard.
- Click into your target server.
- Select the Resources tab.
- Click Add Resource.
- Select the Provider that houses the data, and pick the specific Resource you want to expose.
- Click Confirm to lock the association. The server will immediately index the new URI in its routing table.
Using REST API
To programmatically map an active data resource to a running container execution environment, utilize the server’s routedPOST resource endpoint.
The API Endpoint
POST /servers/{serverId}/resources
Building the Request
Unlike Tools (which require identifying the Provider directly in the payload), theCreateServerResourceRequest object is streamlined. You only need to declare the Server receiving access, and the unique ID of the specific Resource.
201 Created housing the successfully validated resource JSON object.