← ClaudeAtlas

mcp-builderlisted

MCP (Model Context Protocol) server building principles. Tool design, resource patterns, best practices.
phuonghx/aim-cli · ★ 1 · AI & Automation · score 77
Install: claude install-skill phuonghx/aim-cli
# MCP Builder > Principles for building MCP servers. --- ## 1. MCP Overview ### What is MCP? Model Context Protocol - standard for connecting AI systems with external tools and data sources. ### Core Concepts | Concept | Purpose | |---------|---------| | **Tools** | Functions AI can call | | **Resources** | Data AI can read | | **Prompts** | Pre-defined prompt templates | --- ## 2. Server Architecture ### Project Structure ``` my-mcp-server/ ├── src/ │ └── index.ts # Main entry — McpServer from @modelcontextprotocol/sdk ├── package.json # dep: @modelcontextprotocol/sdk └── tsconfig.json ``` > TypeScript SDK: `@modelcontextprotocol/sdk` (`McpServer`). Python SDK: `mcp` (`pip install "mcp[cli]"`, `FastMCP` bundled in `mcp.server.fastmcp`). ### Transport Types | Type | Use | |------|-----| | **stdio** | Local, CLI-based | | **Streamable HTTP** | Remote/web servers (replaced the deprecated HTTP+SSE transport) | > The current spec (2025-06-18) defines two standard transports: stdio and Streamable HTTP. WebSocket is not a standard transport. Validate the `Origin` header on Streamable HTTP servers. --- ## 3. Tool Design Principles ### Good Tool Design | Principle | Description | |-----------|-------------| | Clear name | Action-oriented (get_weather, create_user) | | Single purpose | One thing well | | Validated input | Schema with types and descriptions | | Structured output | Predictable response format | ### Input Schema Design | Field | Required?