build-mcp-servers

Build FastMCP 2.x servers with token budgets and tool consolidation.

4|1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/lushly-dev/afd --skill build-mcp-servers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: build-mcp-servers
Source: https://github.com/lushly-dev/afd/tree/main/.claude/skills/build-mcp-servers
Command: npx skills add https://github.com/lushly-dev/afd --skill build-mcp-servers

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides expert guidance to build reliable MCP servers using FastMCP 2.x, focusing on crucial aspects like token budget management, tool consolidation, and Opus compatibility to prevent common LLM integration failures.

Core Features & Use Cases

  • FastMCP 2.x Server Setup: Scaffolds modern async MCP servers with stdio and SSE transports.
  • Token Budget Management: Prevents context overflow and model crashes with safe output limits.
  • Tool Consolidation: Reduces tool count using action-based and provider-based patterns.
  • Output Truncation: Enforces safe character limits on all tool outputs.
  • Execute Pattern: Implements a code-execution tool for Opus compatibility.
  • Async Subprocess: Handles non-blocking command execution with timeouts.
  • Troubleshooting: Diagnoses connection failures, context overflow, and platform-specific issues.
  • Use Case: When creating new MCP servers, debugging tool overload, optimizing token usage, or fixing silent failures in Claude Opus.

Quick Start

Use the build-mcp-servers skill to set up a new FastMCP 2.x server, ensuring token budgets and tool consolidation are optimized.

Frequently Asked Questions about build-mcp-servers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent context overflow when building an MCP server?

Consolidate MCP server tools using action-based and provider-based patterns to reduce the total tool count. This approach minimizes tool overload and streamlines schema definitions for LLM integration.

Why does my MCP tool silently fail with Claude Opus?

Claude Opus silent failures during MCP tool execution are often resolved by implementing the execute pattern. This approach uses a dedicated code-execution tool to ensure Opus compatibility and prevent silent task failures.

How do I set up an async MCP server with FastMCP 2.x?

Set up a FastMCP 2.x MCP server by scaffolding modern async architectures with stdio and SSE transports. This framework handles non-blocking subprocess execution and timeouts for robust LLM integration.

What is the best way to handle async subprocesses in an MCP server?

Handle async subprocesses in an MCP server by using non-blocking command execution with configured timeouts. This pattern prevents hanging operations and ensures safe output limits during tool execution.