{"slug": "mcp-fundamentals-building-a-typescript-mcp-server-with-tools-resources-prompts", "title": "MCP Fundamentals: Building a TypeScript MCP Server with Tools, Resources, Prompts, Sampling, and…", "summary": "A developer built a TypeScript Model Context Protocol (MCP) server for customer support that exposes all major MCP primitives but deliberately includes critical security flaws such as a shared API key, god-mode database access, weak input validation, raw PII exposure, and non-idempotent refund actions, highlighting the gap between a working demo and production readiness.", "body_md": "Member-only story\n\n# MCP Fundamentals: Building a TypeScript MCP Server with Tools, Resources, Prompts, Sampling, and Roots\n\n## A hands-on TypeScript guide to building a complete MCP customer-support server, exposing every protocol primitive, and learning why “it works on my laptop” is nowhere near production-ready.\n\n*The scariest part of this MCP server is not that it breaks — it is that it works perfectly. It can search tickets, fetch customer records, summarize threads, and issue refunds, while quietly carrying the exact security flaws that would make a production review stop cold.*\n\nArticle Summary:…\n\nThis article introduces Part 1 of the “MCP in Production” series by building a complete Model Context Protocol server in TypeScript for a customer-support and CRM use case. The server demonstrates every major MCP primitive — tools, resources, prompts, sampling, elicitation, and roots — while using stdio transport and the MCP TypeScript SDK. Rather than presenting the demo as production-ready, the article makes its flaws explicit: a shared API key, a god-mode database connection, weak input validation, raw PII exposure, and refund actions with no guardrails or idempotency. By walking through both the working implementation and its failure modes, the", "url": "https://wpnews.pro/news/mcp-fundamentals-building-a-typescript-mcp-server-with-tools-resources-prompts", "canonical_source": "https://pub.towardsai.net/mcp-fundamentals-building-a-typescript-mcp-server-with-tools-resources-prompts-sampling-and-9dd670f86fc7?source=rss----98111c9905da---4", "published_at": "2026-07-07 05:59:43+00:00", "updated_at": "2026-07-07 06:04:18.073837+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools"], "entities": ["Model Context Protocol", "TypeScript", "MCP TypeScript SDK"], "alternates": {"html": "https://wpnews.pro/news/mcp-fundamentals-building-a-typescript-mcp-server-with-tools-resources-prompts", "markdown": "https://wpnews.pro/news/mcp-fundamentals-building-a-typescript-mcp-server-with-tools-resources-prompts.md", "text": "https://wpnews.pro/news/mcp-fundamentals-building-a-typescript-mcp-server-with-tools-resources-prompts.txt", "jsonld": "https://wpnews.pro/news/mcp-fundamentals-building-a-typescript-mcp-server-with-tools-resources-prompts.jsonld"}}