mcp server authoring

    1

    Build and structure MCP servers with correct transport, tool schemas, and host-specific configurations.

    Free

    1 useSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    mcp server authoring

    Example session with this skill installed

    I need to build an MCP server for a local database. I want to use it in Claude Desktop. How should I structure the tools and config?

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

    I will help you structure your MCP server for a local database integration. To ensure it works correctly with Claude Desktop, we will use the stdio transport, route logs to stderr, and define a compact tool surface.

    MCP Server Implementation Plan

    ComponentSpecification
    Transportstdio (Local subprocess via Claude Desktop)
    SDK@modelcontextprotocol/sdk
    Loggingconsole.error (to protect stdout protocol stream)
    Tool SurfaceConsolidated query and inspect_schema tools

    Claude Desktop Configuration

    Add this to your claude_desktop_config.json file:

    {
      "mcpServers": {
        "local-db-connector": {
          "command": "node",
          "args": [
            "/absolute/path/to/your-server/dist/index.js"
          ],
          "env": {
            "DB_CONNECTION_STRING": "your_connection_string_here"
          }
        }
      }
    }
    

    Tool Definition Example

    server.tool(
      "execute_query",
      "Use to run read-only SQL queries against the local database when the user asks for data analysis.",
      {
        sql: z.string().describe("The SQL query to execute"),
        limit: z.number().optional().default(100).describe("Max rows to return")
      },
      async ({ sql, limit }) => {
        // Implementation with error handling
        try {
          const results = await db.query(sql, limit);
          return { content: [{ type: "text", text: JSON.stringify(results) }] };
        } catch (err) {
          return { 
            isError: true, 
            content: [{ type: "text", text: `Database error: ${err.message}` }] 
          };
        }
      }
    );
    

    Next steps

    • Initialize your project using @modelcontextprotocol/sdk.
    • Implement the execute_query tool with strict input validation.
    • Verify that all debug logging uses stderr before testing in Claude Desktop.

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

    About this skill

    Building Model Context Protocol (MCP) servers requires strict adherence to transport protocols and schema constraints to avoid context bloat or host crashes. This skill provides the architectural patterns and implementation rules needed to expose local tools and resources to MCP-aware hosts like Claude Desktop, Claude Code, and Cursor.

    What it does

    • Transport selection guidance for choosing between local stdio subprocesses or remote Streamable HTTP.
    • Tool surface design to minimize context window impact by optimizing JSON schemas and descriptions.
    • Error handling strategies to differentiate between recoverable tool errors and fatal protocol errors.
    • Host configuration generation for Claude Desktop, Claude Code, Cursor, and Augment.
    • Logging management to prevent protocol corruption by correctly routing output to stderr.

    How it works

    1. Select transport based on whether the server is local-only or requires remote/multi-user access.
    2. Define tool schemas by writing "when to use" descriptions and strict JSON input validation.
    3. Implement lifecycle rules including input validation, idempotency, and non-crashing error returns.
    4. Export host configs using specific JSON shapes for target IDEs and agents.

    Frameworks & tools

    This skill uses the @modelcontextprotocol/sdk and targets environments like Claude Desktop, Claude Code, Cursor, Augment, and claude.ai. It focuses on TypeScript/Node.js for server implementation and JSON Schema for tool definitions.

    Why this beats prompting it yourself

    Generic prompts often lead to servers that crash on bad input or corrupt the stdio stream with console logs. This skill enforces protocol-specific rules like stderr logging and schema consolidation that prevent agent performance degradation.

    Use cases

    • Convert a local Python script or Node.js library into a tool for Claude.
    • Fix protocol corruption errors caused by debug logs writing to stdout.
    • Optimize a server with too many tools using tool-search and deferred schemas.
    • Set up a remote MCP server for shared team access via Streamable HTTP.

    Known limitations

    This skill focuses on authoring servers, not consuming them. It does not cover generic REST API design outside of the MCP context.

    Focuses on server authoring only, not calling/consuming MCP servers. Does not cover general REST/GraphQL design unrelated to MCP.

    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 any payment.

    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

    1 use

    Times used to date

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 28 days ago

    • Free with an Agensi account

    Requires

    Aware MCP

    Permissions

    Terminal / Shell
    Network Access
    Listed28 days ago

    What's inside

    Frequently Asked Questions

    This skill provides the architectural logic and strict implementation rules required to build stable Model Context Protocol servers, preventing common issues like stdout corruption, host crashes, and context window bloat.

    It is fully compatible with major MCP-aware hosts including Claude Desktop, Claude Code, Cursor, and Augment, and includes specific configuration generation for each environment.

    The skill focuses on the official `@modelcontextprotocol/sdk` using TypeScript/Node.js and JSON Schema, ensuring your servers meet the formal protocol specifications.

    Yes, the skill includes logic for both local stdio subprocesses for individual desktop use and Streamable HTTP for remote or multi-user server deployments.

    You receive the complete architectural patterns, tool schema optimization rules, error-handling strategies, and host-specific configuration templates defined in the product description.

    It addresses the common mistake of debug logs leaking into stdout by enforcing stderr routing, ensuring that logging never interferes with the underlying JSON-RPC communication.

    New in LLM Ops