# Build Production-Ready MCP Servers

MCP server projects can become hard to secure, test, and maintain. This skill guides Claude, Codex, and Claude Code through architecture, security, performance, testing, and operations patterns.

## Install

```bash
npx skillstore add emillindfors/mcp-best-practices
```

## Metadata

- Status: approved
- Slug: emillindfors-mcp-best-practices
- Skillstore revision: r1
- Version status: missing
- Tree hash: 58750de59fb6f3a0d5debaeb76af45d58e9a68431a1649553e9f872f410a42c4
- Author: EmilLindfors
- GitHub username: EmilLindfors
- License: MIT
- Repository: https://github.com/EmilLindfors/claude-marketplace/tree/main/plugins/rust-mcp-server/skills/mcp-best-practices
- Ref: a06681402992ceae98ba04d54cfd4ab004862696
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: scripts, external\_commands, network, env\_access
- Quality score: 77
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/emillindfors-mcp-best-practices
- Manifest: https://skillstore.pages.dev/api/skills/emillindfors-mcp-best-practices/manifest

## Capabilities

- Explains layered, hexagonal, and repository architecture patterns for MCP services.
- Provides Rust examples for error types, retries, and validation.
- Shows authentication, authorization, and SQL injection prevention patterns.
- Covers connection pooling, caching, concurrent async work, and timeouts.
- Describes unit tests, integration tests, logging, metrics, and configuration management.

## Use Cases

- Design a New MCP Server: Plan service layers, domain boundaries, repositories, and adapters before implementation.
- Review Security Controls: Check validation, authentication, authorization, and database query patterns in an existing MCP service.
- Prepare Production Operations: Add tests, metrics, structured logs, configuration loading, and maintenance checklists before launch.

## Prompt Templates

### Review My MCP Design

```
Review my MCP server design for architecture, security, testing, and operations. Ask for missing details before giving recommendations.
```

### Improve Error Handling

```
Review my MCP error handling strategy. Check error types, retry behavior, user-facing messages, and recovery paths.
```

### Audit Security Patterns

```
Check this MCP service for validation, authentication, authorization, SQL safety, secret handling, and audit gaps. List the highest risks first.
```

### Create a Launch Checklist

```
Create a production readiness checklist for my MCP server. Include architecture, security, tests, observability, configuration, deployment, and maintenance.
```

## Limitations

- Provides guidance only; it does not generate or run a complete server by itself.
- Examples focus on Rust and rmcp-style services, not every MCP framework.
- Security advice is illustrative and must be adapted to each deployment.
- It does not replace code review, threat modeling, or production monitoring.

## Best Practices

- Validate every tool input and map errors to clear, stable error types.
- Keep MCP transport code separate from domain logic and external adapters.
- Test security, database, and external service behavior before production release.

## Anti Patterns

- Building business logic directly inside transport handlers.
- Using string concatenation for database queries.
- Adding logs and metrics after incidents instead of during development.

## Security Audit

- Audited at: 2026-07-06T15:01:30.007\+00:00
- Summary: The skill is a Markdown-only guidance file with Rust examples for MCP server architecture, security, testing, and operations. Static findings are false positives caused by fenced code blocks, method names, database examples, and deliberately labeled bad examples; no prompt injection or malicious intent was found.

## Stats

- Views: 214
- Downloads: 10
- Favorites: 0
- Popularity score: 0
