mcp-production-mastery
Click on "Deploy 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-masteryrun a database mutation to update inventory"
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.
Production MCP Agent Architecture
A production-grade, end-to-end implementation of an AI Agent connecting to external tools using the Model Context Protocol (MCP), enforcing Deterministic Structured Outputs with Zod, and instrumented with Langfuse Observability.
ποΈ Architecture Overview
ββββββββββββββββββ Stdio Transport βββββββββββββββββββββ
β β βββ 1. tools/list Discovery ββββΊ β β
β MCP Client β β MCP Server β
β (Agent Loop) β βββ 2. tools/call Execution ββββΊ β (FastMCP Engine) β
βββββββββ¬βββββββββ βββββββββββ¬ββββββββββ
β β
β 3. LLM Invocations & Structured Outputs β Audit Logs
βΌ βΌ
ββββββββββββββββββ βββββββββββββββββββββ
β OpenAI API β β Target Storage β
β (gpt-4o) β β / Infrastructureβ
βββββββββ¬βββββββββ βββββββββββ¬ββββββββββ
β
β 4. Telemetry Spans, Latency & Cost Tracing
βΌ
ββββββββββββββββββ
β Langfuse β
β Observability β
ββββββββββββββββββRelated MCP server: WEATHGARDS
β‘ Key Features
Model Context Protocol (MCP): Implements standard Client-Server decoupled tool discovery and execution over
stdiotransport using standard JSON-RPC 2.0.100% Deterministic JSON Schemas: Uses OpenAI's
zodResponseFormatandzodFunctionhelpers to eliminate non-deterministic markdown or missing fields at runtime.Full Observability & Tracing: Instrument traces, model generations, and tool execution spans via Langfuse for latency monitoring and token cost tracking.
Modular TypeScript Design: Built with Modern ES Modules, strict typing, clean separation of concerns, and native execution via
tsx.Container Ready: Includes Docker & Docker Compose setup for production deployment.
π Project Structure
mcp-production-mastery/
βββ .env.example
βββ Dockerfile
βββ docker-compose.yml
βββ package.json
βββ tsconfig.json
βββ src/
βββ client.ts # Main MCP Client agent loop & execution engine
βββ server.ts # MCP Server exposing standard operational tools
βββ config/
β βββ telemetry.ts # Centralized Langfuse SDK initialization
βββ schemas/
β βββ output.schemas.ts # Zod contracts for agent responses
βββ tools/
βββ database.tool.ts # Database mutation tool implementation
βββ ping.tool.ts # System infrastructure diagnostic toolπ Getting Started
Prerequisites
Node.js v18+
npm v9+
OpenAI API Key
Langfuse Account Key Pair (Cloud or Self-Hosted)
Step 1: Clone & Install Dependencies
git clone [https://github.com/YOUR_USERNAME/mcp-production-mastery.git](https://github.com/YOUR_USERNAME/mcp-production-mastery.git)
cd mcp-production-mastery
npm installStep 2: Configure Environment Variables
Copy .env.example to .env and fill in your API credentials:
cp .env.example .envStep 3: Run the Agent
Execute the full client-server loop in development mode:
# Run the complete agent orchestration loop
npm run start:clientTo run the standalone MCP server process listening on Stdio:
npm run start:serverπ³ Docker Deployment
To build and run the MCP Server container using Docker Compose:
# Build and run server image
docker-compose up --buildπ οΈ Modifying & Extending Tools
To add a new operational tool to the MCP Server:
Create a new Zod input schema and execution function under
src/tools/.Register the tool inside
src/server.tsusingserver.tool(...).The MCP Client will automatically discover the new tool on launch via
tools/listwithout requiring client modifications.
π License
Distributed under the MIT License. See LICENSE for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides math and weather tools accessible via LangGraph agent using MCP protocol with stdio and streamable HTTP transports.1-
- FlicenseNot gradedqualityDmaintenanceExposes MCP tools that enable remote LLMs to query local Docker containers, OS processes, and system services in real time.-
- AlicenseAqualityCmaintenanceExposes a verified tool registry (calculator, sandboxed file read, web fetch) over MCP stdio, enabling any MCP-capable client to reuse the same tools from the inspectable ReAct loop.3MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to securely discover, execute, and observe tools with role-based access control and audit logging. Serves tools over MCP stdio and HTTP for integration with Claude Desktop, Cursor, and other clients.1-