MCP client integration patterns for packages/tools/src/mcp/. Docker container lifecycle, transport auto-detection, two-phase container naming, and cleanup. Use when working on MCP server configuration, docker-based MCP tools, or the mcp-client.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# MCP Integration Patterns
## The Critical Rule
```
docker rm -f <containerName> is the ONLY reliable container stop.
subprocess.kill() is NOT sufficient.
```
Killing the `docker run` process leaves the container alive in the Docker daemon. `docker rm -f` is the only operation that reliably terminates AND removes the container. This is non-negotiable.
## Two Docker MCP Patterns
| Pattern | Examples | Container behavior |
|---------|---------|-------------------|
| **stdio MCP** | GitHub MCP, filesystem MCP | Container reads JSON-RPC from stdin; responds on stdout |
| **HTTP-only MCP** | mcp/context7 | Container starts an HTTP server on a port; ignores stdin |
Both are handled transparently. The client auto-detects which pattern applies.
## Transport Auto-Detection
The MCP client races two connection methods when starting a docker container:
1. **stdio connect** — attempts to connect via stdin/stdout immediately
2. **HTTP URL detection** — watches container stderr for a URL pattern (e.g., `http://localhost:3000`)
When HTTP wins the race, the client switches to port-mapped HTTP mode automatically. No manual configuration needed.
…
The line at the top of this page pins the label git:20260410.eb63c8f, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
GET https://markdownregistry.com/api/v1/artifacts/art_w4bg4xjfzkmu4gxk
GET https://markdownregistry.com/api/v1/resolve?ref=tylerjrbuell/reactive-agents-ts/mcp-integration
GET https://markdownregistry.com/api/v1/blob/2e0899c7003b8934a5b1a498607d0d76d8e57d8bfa933b5a54b9633d4ab6c95b
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
tylerjrbuell/reactive-agents-ts · .agents/skills/agent-tdd/SKILL.md · Test-Driven Development for the Reactive Agents codebase. Effect-TS aware TDD with mandatory timeout flags, Effect.flip…
tylerjrbuell/reactive-agents-ts · .agents/skills/architecture-audit/SKILL.md · Use when the architecture may have drifted from documentation, packages have grown complex, dead code or disabled…
tylerjrbuell/reactive-agents-ts · .agents/skills/build-package/SKILL.md · Add a new package to the Reactive Agents monorepo. Covers scaffolding, package.json, tsconfig, layer wiring, and index…
tylerjrbuell/reactive-agents-ts · .agents/skills/codebase-health-sweep/SKILL.md · Use when the codebase may have accumulated bugs, failing tests, type errors, dead code, inefficiencies, or drift from…
tylerjrbuell/reactive-agents-ts · .agents/skills/effect-abstraction-audit/SKILL.md · Use when analyzing the Reactive Agents codebase for architectural improvements, abstraction opportunities…
tylerjrbuell/reactive-agents-ts · .agents/skills/effect-ts-patterns/SKILL.md · Mandatory Effect-TS coding patterns for the Reactive Agents framework. Use when writing any TypeScript code, creating…
tylerjrbuell/reactive-agents-ts · .agents/skills/execute-backlog/SKILL.md · Use when ready to attack the GitHub issue backlog with discipline. Scans open issues, bundles related work into an…
tylerjrbuell/reactive-agents-ts · .agents/skills/harness-improvement-loop/SKILL.md · Harness improvement loop on the H3 frozen suite. SELECT the top harness-attributable failure reason from `rax-diagnose…
tylerjrbuell/reactive-agents-ts · .agents/skills/implement-service/SKILL.md · Create a new Effect-TS service following the mandatory Reactive Agents patterns. Use when adding a service to any…
tylerjrbuell/reactive-agents-ts · .agents/skills/implement-test/SKILL.md · Write tests for a Reactive Agents package or service using Bun test runner and Effect-TS patterns. Use when creating…
tylerjrbuell/reactive-agents-ts · .agents/skills/kernel-debug/SKILL.md · Debug agent reasoning failures using the composable kernel phase map. Maps symptoms to specific files and `repo find`…
anthropics/claude-plugins-official · plugins/plugin-dev/skills/mcp-integration/SKILL.md · This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use…
nota-america/forgecat-agent-profiles · profiles/anthropics/claude-plugins-official/anthropics_claude-plugins-official_plugin-dev/for-claude/.claude/skills/mcp-integration/SKILL.md · This skill should be used when the user asks to "add MCP server",
nota-america/forgecat-agent-profiles · profiles/anthropics/claude-plugins-official/anthropics_claude-plugins-official_plugin-dev/for-forgecat/skills/mcp-integration/SKILL.md · This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use…
nota-america/forgecat-agent-profiles · profiles/anthropics/claude-plugins-official/anthropics_claude-plugins-official_plugin-dev/for-codex/.agents/skills/mcp-integration/SKILL.md · This skill should be used when the user asks to "add MCP server",
nota-america/forgecat-agent-profiles · profiles/anthropics/claude-plugins-official/anthropics_claude-plugins-official_plugin-dev/for-cursor/.cursor/skills/mcp-integration/SKILL.md · This skill should be used when the user asks to "add MCP server",
sivan757/dsh-agent-plugins-market · plugins/plugin-dev/skills/mcp-integration/SKILL.md · This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use…