MCP Server Authoring Guide

    by Khristian Kopachelli

    1

    Architect and package MCP servers for local tools or hosted services with proper schemas and listing metadata.

    $15

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    MCP Server Authoring Guide

    Example session with this skill installed

    Scaffold a basic stdio MCP server in Node.js for a weather service with one tool to get current temperature.

    • Read your context and instructions
    • Compiled the mcp server authoring

    I have generated the minimal scaffold for a Node.js MCP weather server using the official SDK and stdio transport.

    MCP Weather Server Scaffold

    // index.mjs
    import { Server } from "@modelcontextprotocol/sdk/server/index.js";
    import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
    import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprotocol/sdk/types.js";
    import { z } from "zod";
    
    const server = new Server(
      { name: "weather-mcp", version: "0.1.0" },
      { capabilities: { tools: {} } }
    );
    
    const GetTemperatureSchema = z.object({
      city: z.string().describe("The city name to check weather for"),
      unit: z.enum(["celsius", "fahrenheit"]).default("celsius")
    });
    
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [{
        name: "weather_get_temperature",
        description: "Get the current temperature for a specific city. Use this when the user asks for weather or local conditions.",
        inputSchema: {
          type: "object",
          properties: {
            city: { type: "string" },
            unit: { type: "string", enum: ["celsius", "fahrenheit"] }
          },
          required: ["city"]
        }
      }]
    }));
    
    server.setRequestHandler(CallToolRequestSchema, async (req) => {
      if (req.params.name !== "weather_get_temperature") {
        return { content: [{ type: "text", text: JSON.stringify({ error: "Unknown tool", hint: "Check tools/list for available actions" }) }] };
      }
    
      try {
        const { city, unit } = GetTemperatureSchema.parse(req.params.arguments);
        // Implementation logic here
        const temp = 22; 
        return {
          content: [{ type: "text", text: JSON.stringify({ city, temperature: temp, unit }) }]
        };
      } catch (err) {
        return {
          content: [{ type: "text", text: JSON.stringify({ error: "Invalid input", hint: err.message }) }]
        };
      }
    });
    
    await server.connect(new StdioServerTransport());
    

    Next steps

    1. Add "bin": {"weather-mcp": "index.mjs"} to your package.json.
    2. Create a LICENSE file in the root directory to meet Glama listing requirements.
    3. Test locally by adding the absolute path to your Claude Desktop config.json.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Building a Model Context Protocol (MCP) server involves navigating transport selection, JSON-RPC schemas, and strict marketplace requirements. This skill provides the architectural constraints and implementation patterns required to build servers that agents can actually use. It focuses on the transition from raw API to structured MCP tools, ensuring your server passes listing requirements for platforms like Glama or npm.

    What it does

    • Transport selection guides you between stdio for local tools and streamable HTTP for hosted, multi-user services.
    • Project scaffolding defines the minimal file structure including package.json bins, index.mjs entries, and required licensing.
    • Tool design enforces naming conventions, Zod/JSON-schema validation, and agent-centric descriptions.
    • Error handling replaces standard stack traces with structured {error, hint} objects designed for LLM consumption.
    • Distribution prep formats your README and configuration snippets for Claude Desktop, Cursor, and Glama.

    How it works

    1. Define scope by choosing between stdio for simplicity or HTTP for remote auth and scaling.
    2. Implement tools using the official SDK to handle JSON-RPC requests for listing and calling capabilities.
    3. Validate schemas using Zod to ensure the agent receives strict input requirements.
    4. Audit for listing by verifying the presence of LICENSE files, glama.json metadata, and copy-paste client configs.

    Frameworks & tools

    Uses the @modelcontextprotocol/sdk for Node.js. Optimized for distribution via npm, Glama, and mcprush.

    Why this beats prompting it yourself

    Generic prompts often fail to include the specific ListToolsRequestSchema requirements or the strict LICENSE file necessity for marketplace builders. This skill enforces the exact JSON-RPC patterns and folder structures that prevent silent failures in agent-to-server communication.

    Use cases

    • Convert an existing REST API into a set of MCP tools for Claude Desktop.
    • Build a local filesystem utility available via npx.
    • Prepare a TypeScript MCP server for submission to the Glama directory.
    • Debug transport-layer issues in JSON-RPC stdio implementations.

    Known limitations

    Requires Node.js 18 or higher for the official SDK. Does not cover Python-based SDK implementations.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 5 days ago

    Requires

    Nothing to install.

    Permissions

    Network Access
    Listed5 days ago

    What's inside

    Frequently Asked Questions

    This skill provides the specific architectural patterns, JSON-RPC schemas, and distribution-ready scaffolding required to build Model Context Protocol servers that are fully compatible with marketplaces like Glama and platforms like Claude Desktop.

    The skill is optimized for the official Node.js SDK and requires Node.js 18 or higher; please note that Python-based MCP implementations are not currently supported by this specific skill.

    Yes, this skill includes dedicated guidance on formatting READMEs, licensing, and glama.json metadata to ensure your server meets the strict submission requirements for major MCP directories.

    This skill provides the logic to bridge both local stdio environments (like Claude Desktop and Cursor) and remote HTTP services, including the necessary patterns for handling multi-user authentication.

    Standard error logs are often unhelpful for AI; this skill implements a specialized 'LLM-first' error handling pattern that provides structured hints to help the agent self-correct its tool calls.

    New in LLM Ops

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.