返回日志 Back to Journal
2026-06-18

catbox-mcp-server: Technical Breakdown

From zero to npm publish — a complete workflow for building an MCP server.

From zero to npm publish — a complete workflow for building an MCP server.

Project Structure

catbox-mcp-server/
├── index.js          # Main entry point
├── README.md         # English documentation
├── package.json      # npm configuration
└── LICENSE           # MIT

Core Code

// index.js - MCP server entry point
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
import FormData from "form-data";
import axios from "axios";

const CATBOX_API = "https://catbox.moe/user/api.php";

async function apiCall(params) {
  const form = new FormData();
  for (const [k, v] of Object.entries(params)) {
    if (v !== undefined && v !== null) form.append(k, v);
  }
  const res = await axios.post(CATBOX_API, form);
  return { result: res.data.trim() };
}

Publishing to npm

npm login
npm publish

Results


Tags: MCP, Tools, npm

Comments

Join the conversation

A quiet margin for reflections after reading.

Local preview comments · kept in this browser after refresh

No comments yet. Be the first to leave a thought.

💤 Meow is sleeping...

Click to wake her up.
She can answer all your questions!