Skip to main content
Glama

github-mcp-demo

A small, working MCP (Model Context Protocol) server that wraps the GitHub REST API as four tools an AI agent can call directly: search repositories, get repository details, list issues, and read a README.

This exists for two reasons:

  1. Portfolio proof — a real, tested MCP server you can point to (GitHub pin, Fiverr/Contra gig samples, Upwork portfolio) that shows exactly what the $99 "custom MCP server" gig delivers.

  2. Reusable boilerplate — the fastest way to deliver a paid job is to copy this folder and swap the API-specific pieces (see "Adapting this for a client" below), not start from a blank file each time.

What it does

Tool

What it calls

What it returns

search_repositories

GET /search/repositories

Top matching repos: name, stars, description, URL

get_repository

GET /repos/{owner}/{repo}

Stars, forks, open issues, license, topics

list_issues

GET /repos/{owner}/{repo}/issues

Open/closed issues, most recently updated first

get_readme

GET /repos/{owner}/{repo}/readme

Decoded README text (truncated to 6000 chars)

Related MCP server: @cloud9-labs/mcp-github

Setup

npm install
npm run build

This produces dist/index.js, a standard stdio-based MCP server.

Optional: raise the rate limit

Without a token, GitHub allows 60 unauthenticated API requests/hour per IP, shared across anything else on that network — you'll hit this fast in testing. Set a token for real use:

export GITHUB_TOKEN=ghp_yourPersonalAccessToken

A read-only, no-scopes personal access token is enough for public repos.

Connect to Claude Desktop

Add this to your Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "github-demo": {
      "command": "node",
      "args": ["/absolute/path/to/github-mcp-demo/dist/index.js"],
      "env": {
        "GITHUB_TOKEN": "ghp_yourPersonalAccessToken"
      }
    }
  }
}

Restart Claude Desktop, then try asking it things like:

  • "Search GitHub for popular MCP servers written in TypeScript"

  • "What are the open issues on modelcontextprotocol/typescript-sdk?"

  • "Show me the README for anthropics/anthropic-sdk-python"

Adapting this for a client (the actual delivery workflow)

This is the part that makes a $99, 48-hour turnaround realistic:

  1. Copy this whole folder, rename it.

  2. In src/index.ts, replace GITHUB_API_BASE and the auth header logic in githubRequest() with the client's API base URL and auth scheme (API key header, Bearer token, Basic auth — same shape, different values).

  3. Replace the four registerTool(...) blocks with tools matching their API's endpoints. Keep the same pattern: a Zod inputSchema for arguments, a fetch call, a small object shaping the response, textResult(...).

  4. npm run build, run it through the same test pattern (spin up an MCP client over stdio, call each tool once, check the output).

  5. Deliver dist/index.js + a short README with their own Claude Desktop config snippet filled in.

Steps 2–3 are the only genuinely custom work per client — everything else (project scaffold, error handling, stdio wiring, response shaping pattern) is already done.

Notes

  • Errors from the upstream API (rate limits, 404s, bad auth) are caught and returned as a readable message rather than crashing the server — this matters more than it sounds like once a client is testing it themselves.

  • get_readme truncates long files to ~6000 characters so a huge README doesn't eat the calling model's whole context window on one tool call.

Available Tools

4 tools
get_readmeGet repository READMEB

Fetch and decode the README file contents for a repository.

ParametersJSON Schema
NameRequiredDescriptionDefault
repoYes
ownerYes

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must fully disclose behavior. It mentions 'decode' but does not explain what decoding means, whether authentication is required, what errors occur if the README is absent, or what the output structure looks like. This leaves significant uncertainty for a tool that performs an action beyond a simple fetch.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence with no redundant words. It efficiently states the action and target, making it a model of conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The basic action is clear, but given no output schema or annotations, the description should provide more detail about return format, error cases, and any side effects. It is adequate for a simple tool but leaves gaps that could confuse an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not mention owner or repo at all. Parameter meaning is left entirely to the property names, which is insufficient compensation for the lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description uses the specific verb 'fetch and decode' and names the resource 'README file contents for a repository', clearly distinguishing it from siblings like search_repositories or list_issues.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or alternatives are mentioned, but the tool's purpose is clear enough that an agent can infer it should be used when README contents are needed. Lacks exclusions or guidance about when other repository tools might be preferable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_repositoryGet repository detailsA

Fetch metadata for a single GitHub repository: description, stars, forks, open issues, license, topics.

ParametersJSON Schema
NameRequiredDescriptionDefault
repoYesRepository name, e.g. 'anthropic-sdk-python'
ownerYesRepository owner, e.g. 'anthropics'

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It discloses that this is a fetch/read operation and lists the metadata returned, which is helpful. However, it does not mention potential error cases (e.g., 404), authentication needs, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that efficiently communicates the purpose and key output fields. No unnecessary words or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with two well-described parameters and no output schema, the description is mostly complete. It lists the returned metadata fields, giving the agent a clear idea of the result. However, it could briefly mention error handling or authentication requirements for full completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description does not add extra meaning to the owner and repo parameters beyond what the schema already provides; it only lists the metadata fields returned, which is not directly parameter semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool fetches metadata for a single GitHub repository and lists the specific fields (description, stars, forks, etc.). This specific verb-resource combination distinguishes it from sibling tools like search_repositories and list_issues.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for when you have a known repo and need metadata, but it does not explicitly state when to use this tool versus alternatives such as search_repositories or get_readme. Sibling tool names provide context, but no direct guidance is given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_issuesList repository issuesA

List open (or closed) issues for a repository, most recently updated first.

ParametersJSON Schema
NameRequiredDescriptionDefault
repoYes
limitNo
ownerYes
stateNoopen

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must carry the burden. It discloses sort order ('most recently updated first') and state filtering ('open or closed'), but omits default state, limit behavior, and pagination details.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one concise, front-loaded sentence. It communicates the essential purpose and ordering without redundant words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema and no annotations, yet the description omits default state (open), the limit constraint, and return structure. For an autonomous agent, this leaves important gaps in understanding what the tool returns and how defaults work.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds minimal context for the 'state' parameter but does not explain owner, repo, or limit semantics. The default and constraints are only in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists issues for a repository, with a specific verb and resource. It distinguishes from sibling tools (search_repositories, get_repository, get_readme) which focus on different entities.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the usage context ('for a repository') but does not explicitly state when to prefer this tool over alternatives or provide exclusions. It is clear enough for issues but lacks explicit guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_repositoriesSearch GitHub repositoriesA

Search public GitHub repositories by keyword. Returns name, owner, stars, description, and URL for the top matches.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMax results to return (1-20)
queryYesSearch keywords, e.g. 'mcp server typescript'

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of disclosing behavior. It states that only public repositories are searched and results are 'top matches', implying ranking. However, it does not detail ordering criteria, pagination, or specify that it is read-only, though 'search' implicitly indicates a non-mutating operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences long, front-loaded with the action ('Search public GitHub repositories by keyword') and directly lists the return fields. Every word adds value, with no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of the tool (2 parameters, no output schema, no annotations), the description covers the primary use case, scope, and return fields. It does not specify sorting or result count, but these are inferable from 'top matches' and the 'limit' parameter. It is sufficient for an agent to correctly select and invoke the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents both 'query' and 'limit'. The description adds minimal extra meaning beyond tying 'query' to 'keyword' and implying the limit affects 'top matches', but this is redundant with the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'search' with a specific resource ('public GitHub repositories') and a scope ('by keyword'), and lists the output fields. It distinguishes itself from sibling tools like 'get_repository' (specific repo) and 'list_issues' by focusing on search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for use: searching public repositories by keyword. It does not explicitly mention alternatives or exclusions, but the phrase 'public GitHub repositories' implies it is for finding repositories, not for other operations like issues or readmes.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv1.0.0
    • First observedget_readme
    • First observedget_repository
    • First observedlist_issues
    • First observedsearch_repositories

TDQS

A3.8/5.0
Disambiguation5/5

Each tool clearly targets a distinct operation: searching repositories, fetching one repository's metadata, listing issues, and retrieving a README. There is no functional overlap or ambiguity.

Naming Consistency5/5

All four tool names follow the same verb_noun pattern (search_repositories, get_repository, list_issues, get_readme), making the API surface predictable and easy to navigate.

Tool Count5/5

Four tools is within the ideal 3–15 range and feels well-scoped for a read-only GitHub demo. Each tool serves a clear purpose without redundancy.

Completeness4/5

The set covers the main read operations for exploring repositories and issues, but lacks some common GitHub surface like commits, pull requests, or user info. For a demo, these are minor gaps that agents can work around.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mirajmahmudul/github-mcp-demo'

If you have feedback or need assistance with the MCP directory API, please join our Discord server