Expert in groups, rings, fields, and algebraic structures with applications to cryptography and number theory
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Comprehensive MCP server development guide covering FastMCP 2.14.3 features, Anthropic standards, ecosystem integration, and production deployment across all agentic IDEs
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
설치 방법 보기설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Master the complete MCP server development lifecycle with FastMCP 2.14.3, covering architecture design, implementation best practices, ecosystem integration, and production deployment across Claude Desktop, Cursor, Windsurf, and all agentic IDEs.
Activate for:
# Initialize with FastMCP 2.14.3
pip install fastmcp>=2.14.3,<3.0.0
mcpb init my-server
cd my-server
# Standard project structure
src/my_server/
├── __init__.py
├── server.py # FastMCP server
├── tools/ # Tool implementations
├── config.py # Configuration
└── utils.py # Helper functions
tests/
docs/
pyproject.toml
from fastmcp import FastMCP
# FastMCP 2.14.3 server with sampling support
app = FastMCP(
"my-server",
version="1.0.0",
description="My MCP server with advanced features"
)
@app.tool()
async def sample_workflow(iterations: int = 5) -> dict:
"""Demonstrate FastMCP 2.14.3 sampling capabilities."""
results = []
for i in range(iterations):
# Implement sampling logic here
result = await process_sample(i)
results.append(result)
return {
"success": True,
"samples_processed": iterations,
"results": results
}
if __name__ == "__main__":
app.run()
# pyproject.toml
[build-system]
requires = ["mcpb>=0.1.0"]
build-backend = "mcpb.build"
[project]
name = "my-server"
version = "1.0.0"
description = "My MCP server"
requires-python = ">=3.8"
[project.dependencies]
fastmcp = ">=2.14.3,<3.0.0"
[tool.mcpb]
server-script = "src/my_server/server.py"
# tests/test_server.py
import pytest
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
async def test_sample_workflow():
# MCP protocol testing
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
result = await session.call_tool(
"sample_workflow",
arguments={"iterations": 3}
)
assert result.success
assert len(result.results) == 3
@app.tool()
async def iterative_refinement(
ctx,
prompt: str,
max_iterations: int = 5,
quality_threshold: float = 0.8
) -> dict:
"""FastMCP 2.14.3 sampling-enabled iterative refinement."""
best_result = None
best_score = 0.0
for iteration in range(max_iterations):
# Generate candidate
candidate = await generate_candidate(prompt, iteration)
# Evaluate quality
score = await evaluate_quality(candidate)
# Sampling decision
if score > best_score:
best_result = candidate
best_score = score
# Early termination if quality threshold met
if score >= quality_threshold:
break
# Provide progress feedback
await ctx.report_progress(iteration + 1, max_iterations)
return {
"final_result": best_result,
"quality_score": best_score,
"iterations_used": iteration + 1
}
@app.tool()
async def collaborative_analysis(
ctx,
data_source: str,
analysis_type: str,
collaborators: list[str] = None
) -> dict:
"""Cooperative tool pattern for multi-step analysis."""
# Phase 1: Data collection
raw_data = await collect_data(data_source)
await ctx.report_progress(1, 4, "Data collection complete")
# Phase 2: Initial processing
processed_data = await process_data(raw_data, analysis_type)
await ctx.report_progress(2, 4, "Initial processing complete")
# Phase 3: Collaborative enhancement (if collaborators specified)
if collaborators:
enhanced_data = await collaborative_enhancement(
processed_data, collaborators
)
await ctx.report_progress(3, 4, "Collaborative enhancement complete")
else:
enhanced_data = processed_data
# Phase 4: Final analysis
final_result = await final_analysis(enhanced_data)
await ctx.report_progress(4, 4, "Final analysis complete")
return {
"result": final_result,
"cooperative_mode": bool(collaborators),
"phases_completed": 4
}
| Feature | Claude Desktop | Cursor | Windsurf | Zed |
|---|---|---|---|---|
| Basic Tools | ✅ | ✅ | ✅ | ✅ |
| Sampling | ✅ (2.14.3+) | ✅ | ✅ | 🟡 |
| Cooperative | ✅ (2.14.3+) | ✅ | ✅ | 🟡 |
| MCPB Install | ✅ | ✅ | ✅ | ❌ |
| Auto-Updates | ✅ | ✅ | ✅ | ❌ |
{
"name": "my-server",
"version": "1.0.0",
"description": "Advanced MCP server with sampling",
"author": "Your Name",
"homepage": "https://github.com/your/repo",
"mcpb": {
"server_script": "src/my_server/server.py",
"requirements": ["fastmcp>=2.14.3"]
},
"tags": ["productivity", "ai", "automation"],
"screenshots": ["demo1.png", "demo2.png"]
}
{
"identifier": "my-server",
"createdAt": "2026-01-20",
"meta": {
"title": "My Advanced Server",
"description": "FastMCP 2.14.3 server with sampling",
"tags": ["mcp", "fastmcp", "ai"],
"category": "productivity"
},
"config": {
"systemRole": "You are an advanced MCP server assistant...",
"mcpServers": {
"my-server": {
"command": "python",
"args": ["-m", "my_server"],
"env": {}
}
}
}
}
# ✅ CORRECT: Structured error handling
@app.tool()
async def robust_operation(param: str) -> dict:
try:
result = await risky_operation(param)
logger.info("Operation completed", extra={
"operation": "robust_operation",
"param_length": len(param),
"correlation_id": ctx.get("correlation_id")
})
return {"success": True, "result": result}
except ValueError as e:
logger.error("Invalid parameter", extra={
"operation": "robust_operation",
"error": str(e),
"error_type": type(e).__name__
})
return {"error": "Invalid parameter", "recovery": "Check input format"}
except Exception as e:
logger.error("Unexpected error", extra={
"operation": "robust_operation",
"error": str(e),
"traceback": traceback.format_exc()
})
return {"error": "Internal error", "recovery": "Contact support"}
# tests/test_mcp_protocol.py
async def test_tool_protocol():
"""Test MCP protocol compliance."""
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
# Test tool listing
tools = await session.list_tools()
assert len(tools) > 0
# Test tool execution
result = await session.call_tool("sample_workflow", {"iterations": 1})
assert result.success
# Test error handling
error_result = await session.call_tool("invalid_tool", {})
assert "error" in error_result
# Connection pooling
from aiohttp import ClientSession
from contextlib import asynccontextmanager
@asynccontextmanager
async def managed_session():
session = ClientSession(
connector=aiohttp.TCPConnector(limit=100, ttl_dns_cache=30),
timeout=aiohttp.ClientTimeout(total=30)
)
try:
yield session
finally:
await session.close()
# Caching layer
from cachetools import TTLCache
import asyncio
_cache = TTLCache(maxsize=1000, ttl=300) # 5-minute TTL
async def cached_operation(key: str, operation):
if key in _cache:
return _cache[key]
result = await operation()
_cache[key] = result
return result
Error: MCP server connection timeout
Solution: Implement connection pooling and retry logic
Error: Tool returned malformed response
Solution: Validate response structure against MCP schema
Error: Tool not appearing in IDE
Solution: Check MCPB manifest and IDE-specific requirements
Issue: Server becoming unresponsive
Solution: Implement async patterns, connection limits, monitoring
Last Updated: January 2026 FastMCP Version: 2.14.3 Sources: Anthropic FastMCP docs, MCPB specification, Glama.ai marketplace, LobeHub ecosystem, community server repositories
Quality Score: 98/100
This comprehensive guide transforms MCP server development from trial-and-error to systematic excellence, ensuring your servers work flawlessly across the entire agentic IDE ecosystem. 🚀
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
Expert in groups, rings, fields, and algebraic structures with applications to cryptography and number theory
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Expert in Japanese honorific language covering 尊敬語・謙譲語・丁寧語 with deep understanding of situational usage, business contexts, and cultural nuances
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Use when planning, scaffolding, validating, or packaging Claude skills inside Advanced Memory MCP.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Structured Zettelkasten workflow for AMD — observe, draft, enrich, retrieve, decide, preview, write, verify. Produces high-quality atomic knowledge cards with deliberate linking.
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Master AI debate techniques with comprehensive counter-arguments against slop criticism, safety concerns, philosophical objections, and political rhetoric
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.
Master AI-integrated development environments with comprehensive coverage of Windsurf, Cursor, Antigravity, Zed, Cline, and FOSS newcomers, including intelligent usage patterns, cost optimization, and the evolution toward fully agentic development
한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.