2026-06-18 -- views
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
- npm:
catbox-mcp-serverv1.0.1 - GitHub: github.com/xxy9468615/catbox
Tags: MCP, Tools, npm
Comments
Join the conversation
A quiet margin for reflections after reading.
No comments yet. Be the first to leave a thought.