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

# Search code

> Hybrid semantic search over an indexed collection.



## OpenAPI

````yaml POST /v1/search
openapi: 3.1.0
info:
  title: SHARC MCP Backend API
  version: 1.0.0
  description: >-
    HTTP endpoints used by the SHARC MCP server for indexing and semantic search
    workflows.
servers:
  - url: https://api.sharc.sh
    description: Production
security: []
paths:
  /v1/search:
    post:
      tags:
        - MCP backend
      summary: Search indexed code
      description: Hybrid semantic search over an indexed collection.
      operationId: searchCode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
      responses:
        '200':
          description: Search results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
      security:
        - apiKey: []
components:
  schemas:
    SearchRequest:
      type: object
      properties:
        query:
          type: string
        collection:
          type: string
        limit:
          type: integer
          minimum: 1
          maximum: 50
        extensionFilter:
          type: array
          items:
            type: string
      required:
        - query
        - collection
    SearchResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/SearchResult'
    SearchResult:
      type: object
      properties:
        score:
          type: number
        content:
          type: string
        relativePath:
          type: string
        startLine:
          type: integer
        endLine:
          type: integer
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Pass your key in Authorization: Bearer <key>.'

````