Model Context Protocol (MCP) Server Kit (stdio + SSE)
Production-ready Model Context Protocol (MCP) server reference kit supporting stdio transport for local desktop AI agents (Claude Desktop, Cursor, Antigravity) and Server-Sent Events (SSE) HTTP transport for remote microservices. Features strict JSON-RPC 2.0 validation, tool sandboxing, and security boundaries.
docker compose up -d
# Model Context Protocol (MCP) Server Kit (stdio + SSE) — Claude Code Guidelines (CLAUDE.md)
# Auto-generated from rules/source/*.md by tools/transpiler.py. Do NOT edit directly.
## Quick Reference & Non-Negotiable Standards
### MCP Architecture and Protocol Standards
> Core specifications for Model Context Protocol servers.
# MCP Architecture and Protocol Standards
## 1. Protocol Conformance
- Always use the official `@modelcontextprotocol/sdk` to implement server logic.
- Declare explicit capabilities during initialization: `tools`, `resources`, `prompts`.
- Adhere strictly to the JSON-RPC 2.0 specification for requests, responses, and error payloads.
## 2. Directory Layout
- **Transports**: `src/transports/` (`stdio.ts`, `sse.ts`).
- **Tools**: `src/tools/` (individual tool definitions with Zod schemas).
- **Resources**: `src/resources/` (dynamic URI-based data providers).
- **Prompts**: `src/prompts/` (reusable prompt templates).
## 3. Never-List
- Never use `eval()` or `new Function()` in tool implementations.
| Design Token | Specification | Standard Enforcement |
|---|---|---|
| color.brand | #e85d26 (Orange status accent) | Status lights, active tabs, focus rings, primary CTA |
| color.surface.dark | #0A0A0B (Base) • #131316 (Raised) • #26262C (Hairline) | Dark-first showcase theme, hairline borders, no shadows |
| font.family.ui | Instrument Sans (14px base, tight scale) | Small and dense dashboard typography, zero AI slop |
| focus.ring | 2px #e85d26 outline, 2px offset | Universal high-visibility focus ring, WCAG 2.2 AA compliant |
Clone and Inspect
Clone repository, navigate to kits/mcp-tools-kit, and start container services via docker compose.
Anchor AI Agent
Feed the Agent Bootstrap Prompt into Claude Code, Cursor, Codex, or Copilot. Agent consumes native rules and skills.
Verify Security Gates
Run automated CI evaluation. Security scanners assert zero vulnerabilities before merging features to production.
7-Part Installation & Setup Standard
1. Prerequisites Table
| Tool | Minimum Version | Check Command | Where to Get |
|---|---|---|---|
| Docker Engine | 24.0+ | docker --version | docker.com |
| Docker Compose | v2.20+ | docker compose version | Bundled with Docker |
| Git | 2.40+ | git --version | git-scm.com |
2. Quickstart Execution
git clone https://github.com/Umar-444/Techtalks-stack-kits.git cd Techtalks-stack-kits/kits/mcp-tools-kit/starter cp .env.example .env docker compose up --build -d
3. Multi-Agent Rule Placement
4. Post-Install Verification Probes
Kit FAQ & Operational Details
What is the Model Context Protocol (MCP) and how does this kit implement it? ↓
MCP is an open standard created by Anthropic that standardizes how AI applications connect to external tools and data sources. This kit implements official @modelcontextprotocol/sdk with full support for stdio and SSE transports.
When should I use stdio transport versus SSE HTTP transport? ↓
Use stdio transport when integrating directly with desktop AI clients like Claude Desktop, Cursor IDE, or local CLI agents. Use SSE (Server-Sent Events) over HTTP when deploying the MCP server as a microservice in Docker, Kubernetes, or multi-agent swarms.
How does this kit prevent path traversal attacks in file-related tools? ↓
The read_secure_file tool resolves target file paths against an explicit ALLOWED_SANDBOX_DIR root using path.resolve(). If the normalized target path does not start with the sandbox root, execution is terminated immediately.
How are tool input parameters validated? ↓
All tools declare input schemas using Zod. The MCP server automatically transforms Zod definitions into JSON Schema for AI model discovery, and validates all runtime tool invocations before execution.
Can I connect this MCP server to Claude Desktop? ↓
Yes. Add an entry to claude_desktop_config.json pointing to node and the compiled dist/transports/stdio.js file. Claude Desktop will automatically launch the process and expose registered tools in the chat UI.
What tools are included in the starter scaffold? ↓
The starter includes three canonical tools: system_info (returns OS and Node telemetry), read_secure_file (reads allowed files within the sandbox), and calculator (safe arithmetic evaluator).
How does rootless containerization work in this MCP kit? ↓
The Dockerfile defines an appuser with non-root UID 10001:10001. All Node processes and HTTP listeners execute under this unprivileged user, preventing privilege escalation vulnerabilities.
Does the server support dynamic MCP Resources? ↓
Yes. The server registers dynamic resource templates using the resource() API, allowing AI agents to read configuration files and logs via standard URI patterns like internal://config/{key}.
What is the token consumption benchmark tier for this kit? ↓
The kit is benchmarked at Tier A+ (14,800 median build tokens) due to its minimal dependencies, zero-SPA architecture, and concise declarative tool definitions.
How are JSON-RPC 2.0 errors formatted and returned? ↓
Errors conform to standard JSON-RPC 2.0 error specifications with codes such as -32600 (Invalid Request), -32601 (Method not found), -32602 (Invalid params), and -32603 (Internal error).
How do I test MCP tools locally without Claude Desktop? ↓
You can run the official MCP Inspector using npx @modelcontextprotocol/inspector node dist/transports/stdio.js, or run the included Vitest test suite via npm test.
How is authentication handled in SSE mode? ↓
The SSE transport includes middleware that validates an incoming Authorization: Bearer
Can tools report execution progress back to the agent? ↓
Yes. Long-running tools can use extra.sendNotification() to transmit progress events containing total and completed steps back to the client.
What automated security scans run in CI for this kit? ↓
GitHub Actions executes Gitleaks for credential detection, Semgrep with OWASP Top 10 rules, TypeScript typechecking, and manifest schema validation.
Paste this exact prompt into Claude Code, Cursor, Copilot, or Antigravity to anchor the agent in the kit's rules and invariants:
You are building with the Model Context Protocol (MCP) Server Kit (stdio + SSE) kit. Adhere strictly to rules in CLAUDE.md / .cursor/rules, design tokens in DESIGN.md, and steps/agent-build-steps.md.