GitHub · Capability
GitHub Search API — Code
GitHub Search API — Code. 1 operations. Lead operation: GitHub Search Code. Self-contained Naftiko capability covering one Github business surface.
What You Can Do
GET
Searchcode
— GitHub Search Code
/v1/search/code
MCP Tools
github-search-code
GitHub Search Code
read-only
idempotent
Capability Spec
naftiko: 1.0.0-alpha2
info:
label: GitHub Search API — Code
description: 'GitHub Search API — Code. 1 operations. Lead operation: GitHub Search Code. Self-contained Naftiko capability
covering one Github business surface.'
tags:
- Github
- Code
created: '2026-05-19'
modified: '2026-05-19'
binds:
- namespace: env
keys:
GITHUB_API_KEY: GITHUB_API_KEY
capability:
consumes:
- type: http
namespace: search-code
baseUri: ''
description: GitHub Search API — Code business capability. Self-contained, no shared references.
resources:
- name: search-code
path: /search/code
operations:
- name: searchcode
method: GET
description: GitHub Search Code
outputRawFormat: json
outputParameters:
- name: result
type: object
value: $.
inputParameters:
- name: q
in: query
type: string
description: The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search
to specific areas of GitHub Enterprise Server. The REST
required: true
- name: sort
in: query
type: string
description: Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been
indexed by the GitHub Enterprise Server search infrastructu
- name: order
in: query
type: string
description: Determines whether the first search result returned is the highest number of matches (`desc`) or lowest
number of matches (`asc`). This parameter is ignored unl
- name: Authorization
in: header
type: string
- name: X-GitHub-Api-Version
in: header
type: string
- name: Accept
in: header
type: string
exposes:
- type: rest
namespace: search-code-rest
port: 8080
description: REST adapter for GitHub Search API — Code. One Spectral-compliant resource per consumed operation, prefixed
with /v1.
resources:
- path: /v1/search/code
name: search-code
description: REST surface for search-code.
operations:
- method: GET
name: searchcode
description: GitHub Search Code
call: search-code.searchcode
with:
q: rest.q
sort: rest.sort
order: rest.order
Authorization: rest.Authorization
X-GitHub-Api-Version: rest.X-GitHub-Api-Version
Accept: rest.Accept
outputParameters:
- type: object
mapping: $.
- type: mcp
namespace: search-code-mcp
port: 9090
transport: http
description: MCP adapter for GitHub Search API — Code. One tool per consumed operation, routed inline through this capability's
consumes block.
tools:
- name: github-search-code
description: GitHub Search Code
hints:
readOnly: true
destructive: false
idempotent: true
call: search-code.searchcode
with:
q: tools.q
sort: tools.sort
order: tools.order
Authorization: tools.Authorization
X-GitHub-Api-Version: tools.X-GitHub-Api-Version
Accept: tools.Accept
outputParameters:
- type: object
mapping: $.