mcp-expert

Architects and orchestrates Model Context Protocol (MCP) ecosystems including server development, tool design, and transport configuration. Use when building MCP servers, designing agentic tool interfaces, configuring MCP transports, implementing OAuth security, or troubleshooting MCP connectivity. Use for outcome-oriented tools, Zod validation, progressive disclosure resources, elicitation, and async tasks.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "mcp-expert" with this command: npx skills add oakoss/agent-skills/oakoss-agent-skills-mcp-expert

MCP Expert

Overview

Definitive resource for building and managing Model Context Protocol ecosystems. Covers the full lifecycle from server development and transport configuration to security, elicitation, and async task execution. Designs agent-first tool interfaces that minimize token usage and maximize LLM accuracy.

When to use: Building MCP servers, designing tool interfaces, configuring transports (Stdio/Streamable HTTP), implementing OAuth 2.1, troubleshooting connectivity, using elicitation for server-initiated user interaction.

When NOT to use: Application-level business logic, non-MCP API design, frontend UI components, general HTTP API development unrelated to MCP.

Quick Reference

PatternAPI/ApproachKey Points
Outcome-oriented toolsSingle-call operationsAvoid chatty multi-step APIs
Argument flatteningFlat Zod schemas with descriptionsReduce model hallucination
Progressive disclosureReturn mcp:// URIs for large dataAgent reads partially via resources/read
Retryable toolsReturn retry_with suggestionsHelp LLM self-correct on bad inputs
Helpful errorsDescriptive strings with fix guidanceNever return raw exceptions or stack traces
Paginationhas_more + next_cursor metadata20-50 records per call maximum
Structured outputsJSON Schema in outputSchemaTyped tool results for programmatic consumption
Stdio transportLocal tools, stderr-only loggingNever write to stdout except JSON-RPC
Streamable HTTPRemote/cloud tools, single endpointReplaces deprecated SSE transport
OAuth 2.1 with PKCEEnterprise data accessMCP server is resource server, not auth server
ElicitationServer-initiated user inputFlat schema maps to forms, three response states
Async taskstasks/get, tasks/cancelLong-running operations return task handles
Capability scopesread:docs, write:code, admin:usersGranular permission boundaries
HITL gateconfirmation_required flagManual approval for destructive actions
URL elicitationSecure credential collectionRedirects user to browser for sensitive input
ExtensionsNamespaced capability negotiationOptional features without forking the spec
Sampling with toolsServer-initiated LLM requestsEnables server-side agent loops
MCP Inspectornpx @modelcontextprotocol/inspectorTest tools interactively without an LLM
Unit testingInMemoryTransport + VitestTest tool handlers with mock client
Evaluation frameworkSchema, error, pagination assertionsValidate tool quality for LLM consumption
Tool contract testingSchema field descriptions, edge casesEvery field described, optional params handled
CI smoke testsGitHub Actions + Inspector CLIAutomated build, test, and transport health check

Spec Versions

The current MCP specification is 2025-11-25. Key milestones:

  • 2025-03-26: Streamable HTTP transport (deprecated standalone SSE), tool annotations
  • 2025-06-18: Structured tool outputs, elicitation, OAuth auth server separation
  • 2025-11-25: Async tasks, extensions framework, sampling with tools, CIMD auth, server discovery

Onboarding Protocol

When an agent needs a new capability:

  1. Validation: Check if the required MCP server is already active
  2. Guide: If missing, provide the user with a direct installation path
  3. Config: Use uvx or npx for zero-install execution where possible

Common Mistakes

MistakeCorrect Pattern
Designing chatty APIs requiring many round-tripsBuild outcome-oriented tools that accomplish tasks in a single call
Logging to stdout breaking the Stdio transportLog only to stderr to keep the transport channel clean
Returning raw exceptions and stack traces to the LLMReturn helpful error strings with suggested corrections
Building monolithic servers with dozens of toolsKeep servers focused with 5-15 tools for discoverability and maintenance
Using deprecated HTTP+SSE transport for new serversUse Streamable HTTP for remote servers (single endpoint, optional SSE)
Hardcoding secrets in MCP server configurationUse environment variable mapping for all sensitive values
Returning large datasets in a single tool callUse pagination (20-50 records) or resource URIs for large data
Implementing auth server inside MCP serverMCP server acts as OAuth 2.1 resource server only, delegate auth externally
Vague tool descriptions causing LLM hallucinationAdd example usage and strict constraints to the tool description field
Synchronous blocking on long operationsReturn async task handles for operations exceeding timeout thresholds
Passing received tokens to upstream APIsValidate tokens locally; never forward to avoid confused deputy attacks
Requesting secrets through elicitationUse URL mode elicitation or dedicated OAuth flows for credential collection

MCP Primitives

MCP servers expose three core primitive types to clients:

  • Tools: Model-controlled actions the LLM invokes to accomplish tasks (function calling)
  • Resources: Application-controlled data exposed via mcp:// URIs that clients read on demand
  • Prompts: User-controlled templates that provide structured context for specific workflows

Servers declare which primitives they support during capability negotiation in the initialize handshake. The November 2025 spec adds Tasks as an experimental primitive for async execution.

Transport Selection

ScenarioTransportNotes
Local CLI toolsStdioFastest startup, no network overhead
Remote/cloud serversStreamable HTTPSingle endpoint, optional SSE streaming
Legacy remoteHTTP+SSEDeprecated since 2025-03-26, migrate to Streamable HTTP

Clients should support Stdio whenever possible. Streamable HTTP supports both stateless and stateful server implementations via optional Mcp-Session-Id headers.

Delegation

  • Discover and audit existing MCP server configurations: Use Explore agent to check active servers, verify connectivity, and identify missing capabilities
  • Build and deploy a new MCP server with validation and auth: Use Task agent to scaffold the server, implement Zod validation, and configure OAuth
  • Design MCP ecosystem architecture for multi-agent workflows: Use Plan agent to map tool boundaries, transport selection, and security scoping

References

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Security

application-security

No summary provided by upstream source.

Repository SourceNeeds Review
Security

database-security

No summary provided by upstream source.

Repository SourceNeeds Review
Security

quality-auditor

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

playwright

No summary provided by upstream source.

Repository SourceNeeds Review