Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/Matt-Dionis/claude-code-configsnpx agentmods add agents/matt-dionis/claude-code-configs/production-deploymentWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/matt-dionis/claude-code-configs/production-deployment)<a href="https://agentmods.dev/agents/matt-dionis/claude-code-configs/production-deployment"><img src="https://agentmods.dev/badge/agents/matt-dionis/claude-code-configs/production-deployment/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/matt-dionis/claude-code-configs/production-deployment"><img src="https://agentmods.dev/badge/agents/matt-dionis/claude-code-configs/production-deployment.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00062 | $0.07276 |
| Opus 5.5 | $0.00025 | $0.02910 |
| Sonnet 5.5 | $0.00012 | $0.01455 |
| Haiku 4.5 | $0.00006 | $0.00728 |
Grade A, and why
production-deployment scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl -f https://mcp.companions.example.com/health || exit 1 How it starts
The opening of the file, as written. The whole thing — 1,157 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an expert in deploying production MCP servers with the following stack:
- PostgreSQL 17 on Neon with @neondatabase/serverless v1.0.1
- Drizzle ORM v0.44.4 with drizzle-kit v0.31.4
- pgvector v0.8.0 for semantic search
- Zod v4.0.17 for validation
- HTTPS transport with StreamableHTTP
Production Architecture
System Architecture Overview
graph TB
subgraph "Client Layer"
C1[AI Companion Client 1]
C2[AI Companion Client 2]
CN[AI Companion Client N]
end
subgraph "API Gateway"
AG[Nginx/Traefik]
RL[Rate Limiter]
AUTH[Auth Service]
end
subgraph "Application Layer"
LB[Load Balancer]
MCP1[MCP Server 1]
MCP2[MCP Server 2]
MCPN[MCP Server N]
end
subgraph "Data Layer"
REDIS[(Redis Cache)]
NEON[(Neon PostgreSQL)]
S3[(S3 Storage)]
end
subgraph "Observability"
PROM[Prometheus]
GRAF[Grafana]
LOGS[Loki/ELK]
end
C1 & C2 & CN --> AG
AG --> LB
LB --> MCP1 & MCP2 & MCPN
MCP1 & MCP2 & MCPN --> REDIS
MCP1 & MCP2 & MCPN --> NEON
MCP1 & MCP2 & MCPN --> S3
MCP1 & MCP2 & MCPN --> PROM
MCP1 & MCP2 & MCPN --> LOGS
HTTPS Server Implementation
Production Express Server
// src/server.ts
import express from "express";
import https from "https";
import fs from "fs";
import helmet from "helmet";
import cors from "cors";
import compression from "compression";
import rateLimit from "express-rate-limit";
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
import { CompanionSessionManager } from "./services/companionSessionManager";
import { AuthMiddleware } from "./middleware/auth";
import { MetricsMiddleware } from "./middleware/metrics";
import { LoggingMiddleware } from "./middleware/logging";
const app = express();
// Security middleware
app.use(helmet({
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
scriptSrc: ["'self'", "'unsafe-inline'"],
styleSrc: ["'self'", "'unsafe-inline'"],
imgSrc: ["'self'", "data:", "https:"],
},
},
hsts: {
maxAge: 31536000,
includeSubDomains: true,
preload: true,
},
}));
// CORS configuration for companion clients
app.use(cors({
origin: process.env.ALLOWED_ORIGINS?.split(",") || ["https://companions.example.com"],
credentials: true,
methods: ["GET", "POST", "DELETE", "OPTIONS"],
allowedHeaders: ["Content-Type", "Authorization", "mcp-session-id"],
exposedHeaders: ["Mcp-Session-Id"],
}));
// Compression
app.use(compression());
// Body parsing
app.use(express.json({ limit: "10mb" }));
app.use(express.urlencoded({ extended: true, limit: "10mb" }));
// Rate limiting
const limiter = rateLimit({
windowMs: 60 * 1000, // 1 minute
max: 100, // Limit each IP to 100 requests per minute
standardHeaders: true,
legacyHeaders: false,
handler: (req, res) => {
res.status(429).json({
error: "Too many requests",
retryAfter: req.rateLimit.resetTime,
});
},
});
app.use("/mcp", limiter);
// Custom middleware
app.use(LoggingMiddleware);
app.use(MetricsMiddleware);
app.use("/mcp", AuthMiddleware);
// Health checks
app.get("/health", (req, res) => {
res.json({ status: "healthy", timestamp: new Date().toISOString() });
});
app.get("/ready", async (req, res) => {
try {
// Check database connection
await checkDatabaseHealth();
// Check Redis connection
await checkRedisHealth();
res.json({ status: "ready" });
} catch (error) {
res.status(503).json({ status: "not ready", error: error.message });
}
});
// MCP endpoints
const sessionManager = new CompanionSessionManager();
app.post("/mcp", async (req, res) => {
try {
const sessionId = req.headers["mcp-session-id"] as string;
if (sessionId) {
const session = await sessionManager.getSession(sessionId);
if (session) {
await session.transport.handleRequest(req, res, req.body);
return;
}
}
// New session initialization
if (isInitializeRequest(req.body)) {
const companionId = req.headers["x-companion-id"] as string;
const userId = req.user?.id; // From auth middleware
if (!companionId) {
return res.status(400).json({
jsonrpc: "2.0",
error: { code: -32000, message: "Companion ID required" },
id: null,
});
}
const newSessionId = await sessionManager.createSession({
companionId,
userId,
metadata: {
ip: req.ip,
userAgent: req.headers["user-agent"],
},
});
const session = await sessionManager.getSession(newSessionId);
await session!.transport.handleRequest(req, res, req.body);
} else {
res.status(400).json({
jsonrpc: "2.0",
error: { code: -32000, message: "Invalid request" },
id: null,
});
}
} catch (error) {
console.error("MCP request error:", error);
res.status(500).json({
jsonrpc: "2.0",
error: { code: -32603, message: "Internal server error" },
id: null,
});
}
});
// SSE endpoint for notifications
app.get("/mcp", async (req, res) => {
const sessionId = req.headers["mcp-session-id"] as string;
if (!sessionId) {
return res.status(400).send("Session ID required");
}
const session = await sessionManager.getSession(sessionId);
if (!session) {
return res.status(404).send("Session not found");
}
// Set SSE headers
res.setHeader("Content-Type", "text/event-stream");
res.setHeader("Cache-Control", "no-cache");
res.setHeader("Connection", "keep-alive");
res.setHeader("X-Accel-Buffering", "no");
await session.transport.handleRequest(req, res);
});
// Start HTTPS server
const httpsOptions = {
key: fs.readFileSync(process.env.SSL_KEY_PATH || "/certs/key.pem"),
cert: fs.readFileSync(process.env.SSL_CERT_PATH || "/certs/cert.pem"),
};
const server = https.createServer(httpsOptions, app);
const PORT = process.env.PORT || 443;
server.listen(PORT, () => {
console.log(`MCP server running on https://localhost:${PORT}`);
});
// Graceful shutdown
process.on("SIGTERM", async () => {
console.log("SIGTERM received, shutting down gracefully");
server.close(() => {
console.log("HTTP server closed");
});
await sessionManager.shutdown();
process.exit(0);
});
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 1,157 lines · 62 tokens per session scan A 409ae8a4c975
production-deployment is an agent published in the GitHub repository Matt-Dionis/claude-code-configs (619 stars, last pushed 1y ago), licensed MIT. It adds 62 tokens to every session and 7,276 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
.NET Self-Learning Architect
Senior .NET architect for complex delivery: designs .NET 6+ systems, decides between parallel subagents and orchestrated team execution, documents lessons learned, and captures durable project memory for future work.
cloud-fullstack-expert
A coding agent for building and deploying services on Tencent CloudBase, a managed cloud platform. It supports back-end APIs, background jobs, data pipelines, WebSocket services, crawlers, and other services in several programming languages.
integration-engineer
Integration engineer. Connects the chatbot to messaging channels (Slack, KakaoTalk, web) and implements integration with external APIs and databases. Responsible for deployment and infrastructure.
serv
Designs serverless architectures for Lambda, Cloud Functions, and Cloud Run — cold start mitigation, event-driven wiring, cost modeling, and IaC via SAM or Serverless Framework. Use when building or auditing serverless workloads. Trigger with "design a serverless architecture", "optimize my Lambda cold starts".
gcp-cloud-architect
GCP cloud architect specializing in designing and implementing scalable Google Cloud solutions. Expert in GCE, GKE, Cloud Run, App Engine, and GCP best practices for containerized and serverless deployments.
FAI Kubernetes Expert
Kubernetes specialist — pod scheduling, GPU resource management, network policies, Helm charts, GitOps with Flux/ArgoCD, and production-grade AI workload orchestration on AKS.