MCP Production Demo
Provides tools to interact with the GitHub REST API, including retrieving repository information and searching issues.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Production Demoget repository info for microsoft/typescript"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Production Demo (TypeScript)
A minimal but genuinely production-shaped MCP server: real API calls (live GitHub API), typed config validation, structured logging, consistent error handling, auth on the network transport, health checks, graceful shutdown, Docker packaging, and tests. This is what the toy stdio scripts were missing.
What's different from the toy version
Concern | Toy version | This version |
Data | hardcoded fake dict | live GitHub REST API |
Config | none |
|
Errors | uncaught = crash/hang | every handler wrapped, typed errors, client never sees a stack trace |
Logging | none | structured JSON (pino), stderr-only so it can't corrupt stdio protocol |
Timeouts | none | every outbound call has an |
Auth | none | bearer token required on the HTTP transport |
Transport | stdio only | both |
Deployment | none | multi-stage Dockerfile, non-root user, health check |
Tests | none | error-handling contract covered with |
Related MCP server: GitHub Prod MCP
Project layout
src/
config.ts env validation (zod) — the only place process.env is read
lib/
logger.ts pino logger, stderr-only
errors.ts typed error classes (Validation / Upstream / Timeout)
http.ts fetch wrapper: timeout + typed errors
safeTool.ts wraps every tool: catch, log, clean client-facing result
tools/
github.ts real tools: get_repo, search_issues (live GitHub API)
mcpServer.ts registers all tools onto an McpServer instance
stdioEntry.ts entrypoint for local/desktop clients
httpEntry.ts entrypoint for a deployed, authenticated server
safeTool.test.ts tests for the error-handling contractSetup
npm install
cp .env.example .env
# edit .env: add a GITHUB_TOKEN (unauthenticated GitHub calls are capped
# at 60/hour and will 403 fast — I hit this in testing), and if you'll
# run the HTTP transport, an MCP_AUTH_TOKEN (openssl rand -hex 32)Run it — stdio (local/desktop)
npm run dev:stdioThis is what you'd point Claude Desktop / Claude Code at directly (see their MCP config docs) instead of writing your own client script.
Run it — HTTP (deployed)
MCP_TRANSPORT=http npm run dev:http
# in another terminal:
curl http://localhost:3000/health
curl -X POST http://localhost:3000/mcp \
-H "Authorization: Bearer $MCP_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1.0"}}}'A request with no/wrong Authorization header gets a 401 before it ever
reaches the MCP layer.
Tests
npm testCovers the actual thing that matters in production: no matter what a tool
handler throws, the client always gets back a well-formed
{ content, isError } — never a raw stack trace, never a hang.
Docker
docker build -t mcp-production-demo .
docker run -p 3000:3000 \
-e MCP_AUTH_TOKEN=$(openssl rand -hex 32) \
-e GITHUB_TOKEN=ghp_xxx \
mcp-production-demoMulti-stage build (compiled output only ships, no devDependencies),
runs as a non-root user, has a HEALTHCHECK.
Production decisions worth understanding (not just copying)
Logs go to stderr, always. stdout is reserved for the JSON-RPC protocol stream on the stdio transport. A single stray
console.logwould silently corrupt every message after it — this bit me in early testing of similar setups, which is whylogger.tscalls it out explicitly.Fail fast on bad config.
config.tsvalidates env vars at import time and callsprocess.exit(1)on failure, with the specific field that's wrong. A server that boots "successfully" into a broken state is worse than one that refuses to start.Never forward raw errors to the client.
safeTool.tslogs full detail server-side (including stack traces for unexpected errors) but only ever returns a small set of clean, typed messages to the MCP client. I confirmed this live: an unauthenticated call to the GitHub API from this sandbox hit their real rate limit and returned a403with a detailed message — the client only saw "The upstream service returned an error (403). Please try again later," while the full GitHub response was in the server log.Stateless HTTP by default. Each
/mcprequest gets a freshMcpServer+StreamableHTTPServerTransport. No shared session state means it scales horizontally with zero coordination. If you need long-lived stateful sessions (e.g. server-initiated notifications between calls), you'd switch to the SDK's stateful mode with asessionId -> transportmap — more capable, more to get right.Every outbound call has a timeout.
lib/http.tsusesAbortControllerso a hung upstream can't hang your tool call indefinitely and, transitively, whatever's waiting on it.Graceful shutdown matters for zero-downtime deploys.
httpEntry.tshandlesSIGTERM/SIGINTby stopping new connections and waiting for in-flight ones to finish, with a forced-exit timeout as a backstop. Without this, a rolling deploy on k8s/ECS kills in-flight requests mid-response.
Where this still isn't "enterprise production"
Being straight about the gaps rather than overselling it:
Auth is a single shared bearer token. Fine for an internal tool; for anything multi-tenant you'd want the SDK's OAuth support instead.
No rate limiting on the HTTP endpoint itself (only on the upstream GitHub calls) — add something like
express-rate-limitbefore internet exposure.No metrics/tracing (Prometheus, OpenTelemetry) — logs alone aren't enough to debug latency issues at scale.
No CI pipeline —
npm testanddocker buildshould run in GitHub Actions (or similar) on every PR, not just locally.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityBmaintenanceA production-grade MCP server offering modules for GitHub issue/PR triage, live website auditing, and automated release note generation. It provides robust security features like write-operation confirmation gates, rate limiting, and dual-read storage backends.MIT
- AlicenseCqualityBmaintenanceA production-ready MCP server for GitHub operations, providing tools for repository management, issues, pull requests, and more via both MCP stdio and REST API.27MIT
- AlicenseAqualityBmaintenanceA secure MCP server for interacting with GitHub issues, pull requests, repository files, and search, supporting both github.com and GitHub Enterprise Server.11AGPL 3.0
- AlicenseBqualityDmaintenanceMCP (Model Context Protocol) server for GitHub API integration. This server provides comprehensive tools for interacting with GitHub repositories, issues, pull requests, branches, and code search through a unified interface.157MIT
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server that gives your AI access to the source code and docs of all public github repos
Scan any public GitHub MCP-server repo for security issues. 37 MCP-specific L1 rules, 8 languages.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/balaji-w/Mcp-demo'
If you have feedback or need assistance with the MCP directory API, please join our Discord server