
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
mcp-mcp-mcp
Advanced tools
A small, simple, web-first framework for building MCP servers.
npm install mcp-mcp-mcp
# or
bun add mcp-mcp-mcp
# or
pnpm add mcp-mcp-mcp
import { Hono } from "hono";
import { McpServer, StreamableHttpTransport } from "mcp-mcp-mcp";
// Create MCP server
const mcp = new McpServer({
name: "example-server",
version: "1.0.0",
});
// Add a tool
mcp.tool("echo", {
description: "Echoes the input message",
inputSchema: {
type: "object",
properties: {
message: { type: "string" },
},
required: ["message"],
},
handler: (args: { message: string }) => ({
content: [{ type: "text", text: args.message }],
}),
});
// Create HTTP transport
const transport = new StreamableHttpTransport();
const httpHandler = transport.bind(mcp);
// Integrate with HTTP framework
const app = new Hono();
app.all("/mcp", async (c) => {
const response = await httpHandler(c.req.raw);
return response;
});
Main server class for managing tools, prompts, and resources:
import { McpServer } from "mcp-mcp-mcp";
const server = new McpServer({
name: "my-server",
version: "1.0.0",
});
HTTP transport layer that handles JSON-RPC 2.0 communication:
import { StreamableHttpTransport } from "mcp-mcp-mcp";
const transport = new StreamableHttpTransport();
const httpHandler = transport.bind(server);
mcp.tool("add", {
description: "Adds two numbers",
inputSchema: {
type: "object",
properties: {
a: { type: "number" },
b: { type: "number" },
},
required: ["a", "b"],
},
handler: (args: { a: number; b: number }) => ({
content: [{ type: "text", text: String(args.a + args.b) }],
}),
});
Supports schema validators like Zod, Valibot, etc.:
import { z } from "zod";
const AddSchema = z.object({
a: z.number(),
b: z.number(),
});
mcp.tool("add", {
description: "Adds two numbers",
inputSchema: AddSchema,
handler: (args) => ({
// args is now typed as { a: number; b: number }
content: [{ type: "text", text: String(args.a + args.b) }],
}),
});
mcp.tool("status", {
description: "Returns server status",
handler: () => ({
content: [{ type: "text", text: "Server is running" }],
}),
});
Add middleware to intercept and process requests:
// Logging middleware
mcp.use(async (ctx, next) => {
console.log("Request:", ctx.request.method);
await next();
});
import { RpcError } from "mcp-mcp-mcp";
mcp.tool("divide", {
description: "Divides two numbers",
inputSchema: {
type: "object",
properties: {
a: { type: "number" },
b: { type: "number" },
},
required: ["a", "b"],
},
handler: (args: { a: number; b: number }) => {
if (args.b === 0) {
throw new RpcError("Division by zero", -32000);
}
return {
content: [{ type: "text", text: String(args.a / args.b) }],
};
},
});
Standard JSON-RPC 2.0 error codes are available:
import { JSON_RPC_ERROR_CODES } from "mcp-mcp-mcp";
// Use predefined error codes
throw new RpcError("Invalid params", JSON_RPC_ERROR_CODES.INVALID_PARAMS);
The framework supports MCP protocol version 2025-06-18.
All communication follows JSON-RPC 2.0 specification with proper request/response handling and error codes.
Works with any HTTP framework that provides standard Request/Response objects:
// Hono
import { Hono } from "hono";
import { McpServer, StreamableHttpTransport } from "mcp-mcp-mcp";
// Create MCP server
const mcp = new McpServer({
name: "my-server",
version: "1.0.0",
});
// Add some tools
mcp.tool("echo", {
description: "Echoes the input message",
inputSchema: {
type: "object",
properties: {
message: { type: "string" },
},
required: ["message"],
},
handler: (args: { message: string }) => ({
content: [{ type: "text", text: args.message }],
}),
});
// Create HTTP transport and bind server
const transport = new StreamableHttpTransport();
const httpHandler = transport.bind(mcp);
// Setup Hono app
const app = new Hono();
// Basic MCP endpoint
app.all("/mcp", async (c) => {
const response = await httpHandler(c.req.raw);
return response;
});
export default app;
See the playground/ directory for complete working examples including:
FAQs
Unknown package
The npm package mcp-mcp-mcp receives a total of 22 weekly downloads. As such, mcp-mcp-mcp popularity was classified as not popular.
We found that mcp-mcp-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.