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

# Execute MCP request (Token URL)

> Execute MCP protocol operations using a self-sufficient token URL.
No additional authentication headers required.




## OpenAPI

````yaml post /mcp/{serverId}/{accessToken}
openapi: 3.0.1
info:
  title: MCP Server API
  description: >
    The Alloy MCP Server API enables you to create and manage MCP (Model Context
    Protocol) servers that provide secure, controlled access to platform
    integrations for AI assistants.


    ## Key Features

    - Dynamic tool discovery and execution

    - Fine-grained access restrictions

    - JWT-based user isolation

    - Self-sufficient token URLs

    - Support for 21+ platform connectors
  version: '2.0'
  contact:
    name: Alloy Support
    email: support@runalloy.com
    url: https://runalloy.com
servers:
  - url: https://mcp.runalloy.com
    description: Production server
  - url: http://localhost:3000
    description: Local development server
security:
  - bearerAuth: []
tags:
  - name: Server Management
    description: Create and manage MCP servers
  - name: MCP Protocol
    description: Execute MCP protocol operations
  - name: Tools
    description: Discover and execute tools
  - name: Resources
    description: Access server resources
  - name: Prompts
    description: Access prompt templates
paths:
  /mcp/{serverId}/{accessToken}:
    post:
      tags:
        - MCP Protocol
      summary: Execute MCP request (Token URL)
      description: |
        Execute MCP protocol operations using a self-sufficient token URL.
        No additional authentication headers required.
      operationId: execute-mcp-token
      parameters:
        - name: serverId
          in: path
          required: true
          description: Server ID
          schema:
            type: string
        - name: accessToken
          in: path
          required: true
          description: Access token
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Request content type
          required: true
          schema:
            type: string
            default: application/json
        - name: Accept
          in: header
          description: Response format - must include text/event-stream for MCP
          required: true
          schema:
            type: string
            default: application/json, text/event-stream
        - name: x-alloy-user-token
          in: header
          description: JWT token for user isolation (optional)
          schema:
            type: string
        - name: x-alloy-userid
          in: header
          description: Override user ID (optional)
          schema:
            type: string
        - name: x-credential-id
          in: header
          description: Specific credential to use (optional)
          schema:
            type: string
        - name: x-redirect-uri
          in: header
          description: OAuth redirect URI for credential creation (optional)
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MCPRequest'
            examples:
              listTools:
                summary: List available tools
                value:
                  jsonrpc: '2.0'
                  method: tools/list
                  id: '1'
              executeAction:
                summary: Execute an action
                value:
                  jsonrpc: '2.0'
                  method: tools/call
                  params:
                    name: execute_action_alloy
                    arguments:
                      connectorId: slack
                      actionId: chat_postMessage
                      parameters:
                        channel: '#general'
                        text: Hello from MCP!
                  id: '1'
      responses:
        '200':
          description: MCP response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MCPResponse'
              examples:
                toolsList:
                  summary: Tools list response
                  value:
                    jsonrpc: '2.0'
                    result:
                      tools:
                        - name: list_connectors_alloy
                          description: List available platform connectors
                          inputSchema:
                            type: object
                            properties:
                              category:
                                type: string
                                description: Filter by category
                    id: '1'
        '400':
          description: Invalid request
        '401':
          description: Invalid or expired token
        '429':
          description: Rate limit exceeded
components:
  schemas:
    MCPRequest:
      type: object
      required:
        - jsonrpc
        - method
        - id
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
        method:
          type: string
          enum:
            - tools/list
            - tools/call
            - resources/list
            - resources/read
            - prompts/list
            - prompts/get
        params:
          type: object
        id:
          type: string
    MCPResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          enum:
            - '2.0'
        result:
          type: object
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
        id:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT or API Key
      description: Use either an Alloy API key or JWT token

````