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

# Create MCP Server Tool Association



## OpenAPI

````yaml post /servers/{id}/tools
openapi: 3.0.4
info:
  title: HasMCP Manager API
  version: 1.0.0
  description: >-
    API for managing HasMCP components like Variables, Providers, MCP Servers,
    Resources, and Prompts.
servers: []
security:
  - bearerAuth: []
paths:
  /servers/{id}/tools:
    post:
      summary: Create MCP Server Tool Association
      operationId: createServerTool
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: MCP Server ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateServerToolRequest'
      responses:
        '201':
          description: Tool associated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateServerToolResponse'
      security:
        - oauth2:
            - server:update
components:
  schemas:
    CreateServerToolRequest:
      type: object
      properties:
        tool:
          $ref: '#/components/schemas/ServerTool'
    CreateServerToolResponse:
      type: object
      properties:
        tool:
          $ref: '#/components/schemas/ServerTool'
    ServerTool:
      type: object
      properties:
        serverID:
          type: string
          pattern: ^[A-Za-z0-9]{11}$
          example: kSuB9Gf6aD4
        providerID:
          type: string
          pattern: ^[A-Za-z0-9]{11}$
          example: kSuB9Gf6aD4
        toolID:
          type: string
          pattern: ^[A-Za-z0-9]{11}$
          example: kSuB9Gf6aD4
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Enter 'Bearer' followed by a space and your token (e.g., 'Bearer
        ${HASMCP_ACCESS_TOKEN}').
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.hasmcp.com/oauth2/auth
          tokenUrl: https://accounts.hasmcp.com/oauth2/token
          scopes:
            gitconnection:list: List Git connections
            gitconnection:delete: Delete Git connection
            variable:list: List variables
            variable:create: Create variable
            variable:update: Update variable
            variable:delete: Delete variable
            provider:list: List providers
            provider:create: Create provider
            provider:read: Get provider
            provider:update: Update provider
            provider:delete: Delete provider
            server:list: List MCP servers
            server:create: Create MCP server
            server:read: Get MCP server
            server:update: Update MCP server
            server:delete: Delete MCP server
            server:create_token: Create MCP server token

````