원클릭으로
mcp-server-development
Build MCP servers with Python FastMCP and TypeScript SDK — tools, resources, prompts, and transport configuration.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Build MCP servers with Python FastMCP and TypeScript SDK — tools, resources, prompts, and transport configuration.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Tool-agnostic search — query construction, tool selection, source trust hierarchy.
Auto-continue through todos with idle detection and safety gates. Use for multi-step orchestration.
Level 2 — Pantheon-native context compression with priority scoring, semantic summarization, downstream-aware compression, budget allocation, and cross-references
Automated visual review pipeline — Playwright screenshots, self-analysis, fix loop, escalation. Used by Aphrodite for UI verification.
Multi-agent orchestration with model routing, category delegation, and sprint management. Use for coordinating Pantheon agents.
MCP security hardening — credential leakage prevention, input sanitization, and tool access control. Use for reviewing agent MCP configurations.
| name | mcp-server-development |
| description | Build MCP servers with Python FastMCP and TypeScript SDK — tools, resources, prompts, and transport configuration. |
| context | fork |
| globs | [] |
| alwaysApply | false |
Build MCP (Model Context Protocol) servers with Python FastMCP and TypeScript SDK. Covers tools, resources, prompts, transport, and security.
from fastmcp import FastMCP
mcp = FastMCP("my-server")
@mcp.tool()
def calculate(expression: str) -> float:
"""Evaluate a mathematical expression."""
return eval(expression)
@mcp.resource("config://settings")
def get_settings() -> str:
"""Return server configuration."""
return '{"version": "1.0"}'
if __name__ == "__main__":
mcp.run()
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
const server = new McpServer({ name: "my-server", version: "1.0.0" });
server.tool("calculate", { expression: z.string() }, async ({ expression }) => ({
content: [{ type: "text", text: String(eval(expression)) }]
}));
const transport = new StdioServerTransport();
await server.connect(transport);
@mcp.tool()
def search_docs(query: str, limit: int = 5) -> list[dict]:
"""Search documentation for relevant information."""
return vector_store.search(query, top_k=limit)
from pydantic import BaseModel, Field
class SearchParams(BaseModel):
query: str = Field(..., min_length=1, max_length=500)
limit: int = Field(default=5, ge=1, le=20)
@mcp.resource("docs://{path}")
def read_doc(path: str) -> str:
"""Read a documentation file."""
return Path(f"docs/{path}.md").read_text()
@mcp.prompt()
def analyze_code(file_path: str, issue: str) -> str:
"""Generate a prompt for code analysis."""
return f"Analyze {file_path} for: {issue}"
| Transport | Use Case | Setup |
|---|---|---|
| stdio | Local CLI tools | Default |
| HTTP | Web servers | mcp.run(transport="http") |
| SSE | Real-time streaming | mcp.run(transport="sse") |
# HTTP transport
mcp.run(transport="http", host="0.0.0.0", port=8000)
# SSE transport
mcp.run(transport="sse", host="0.0.0.0", port=8000)
from fastmcp import ToolError
@mcp.tool()
def risky_operation(data: str) -> str:
try:
result = process(data)
return result
except ValueError as e:
raise ToolError(f"Invalid input: {e}")
except Exception as e:
raise ToolError(f"Internal error: {e}")
def test_calculate_tool():
result = mcp.tools["calculate"].execute(expression="2 + 2")
assert result == 4.0
def test_invalid_input():
with pytest.raises(ToolError):
mcp.tools["calculate"].execute(expression="invalid")