MCP Server Scaffold
Generate a production-ready Model Context Protocol server with tools, resources, and prompts — ready for Claude Desktop, Cursor, or Claude Code.
Better on a larger screen
I respect your commitment to mobile productivity, but this tool works best on a laptop, tablet, or desktop for comfortable code editing and project setup.
1import { Server } from "@modelcontextprotocol/sdk/server/index.js";
2import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3import {
4 CallToolRequestSchema,
5 ListToolsRequestSchema,
6} from "@modelcontextprotocol/sdk/types.js";
7
8const server = new Server(
9 { name: "my-mcp-server", version: "1.0.0" },
10 {
11 capabilities: {
12 tools: {},
13 },
14 }
15);
16
17// List available tools
18server.setRequestHandler(ListToolsRequestSchema, async () => ({
19 tools: [
20 {
21 name: "get_weather",
22 description: "Get current weather for a city",
23 inputSchema: {
24 type: "object",
25 properties: {
26 city: { type: "string", description: "City name (e.g. London)" },
27 units: { type: "string", enum: ["celsius", "fahrenheit"] },
28 },
29 required: ["city"],
30 },
31 },
32 ],
33}));
34
35// Handle tool execution
36server.setRequestHandler(CallToolRequestSchema, async (request) => {
37 const { name, arguments: args } = request.params;
38
39 if (name === "get_weather") {
40 const city = args.city as string;
41 const units = (args.units as string) || "celsius";
42 // TODO: Replace with real API call (e.g. OpenWeatherMap)
43 return {
44 content: [{
45 type: "text",
46 text: JSON.stringify({ city, temperature: units === "celsius" ? "18°C" : "64°F", condition: "Partly cloudy", humidity: "65%" }, null, 2),
47 }],
48 };
49 }
50 throw new Error(`Unknown tool: ${name}`);
51});
52
53async function main() {
54 const transport = new StdioServerTransport();
55 await server.connect(transport);
56 console.error("my-mcp-server running on stdio");
57}
58
59main().catch((error) => {
60 console.error("Fatal:", error);
61 process.exit(1);
62});Integration Guide
MCP servers bridge AI models and your data. Once running, connect to any compliant host.
Claude Desktop
Add config to claude_desktop_config.json and restart
Cursor IDE
Add config to .cursor/mcp.json in your project
Claude Code
Add config to .mcp.json in your project root
MCP Inspector
Run "bun run inspect" to debug your tools
Need a custom MCP implementation?
I build enterprise-grade MCP servers with RAG pipelines, database integrations, and custom AI agents that connect to legacy systems.
The Model Context Protocol (MCP) is an open standard created by Anthropic that lets AI models like Claude interact with external tools, databases, APIs, and file systems. Instead of copying data into chat windows, MCP servers expose structured capabilities that AI can discover and call autonomously — making AI assistants genuinely useful for real workflows.
How MCP Servers Work
An MCP server is a lightweight process that communicates via stdio (standard input/output) or SSE (Server-Sent Events). It registers three types of capabilities: Tools (callable functions like querying a database or hitting an API), Resources (readable data endpoints identified by URIs), and Prompts (reusable prompt templates with arguments). When a host application like Claude Desktop connects, it discovers these capabilities automatically and lets the AI use them during conversations.
Why a Scaffold Generator?
Setting up an MCP server from scratch involves boilerplate: configuring the SDK, setting up TypeScript with the correct ESM module resolution, registering request handlers, and wiring up the stdio transport. This scaffold generator produces a production-ready starting point in seconds — with proper types, error handling, and working examples you can extend immediately.
Choose from five templates — Weather API (external API calls), SQL Database (parameterised queries with injection protection), File System (read/write operations), HTTP API Wrapper (generic REST client), or Blank (clean slate). Toggle Resources and Prompts capabilities to generate the corresponding handlers. Everything runs locally with Bun or Node.js.
Connecting to AI Hosts
The generated mcp-config.json provides ready-to-paste configuration for Claude Desktop, Cursor IDE, and Claude Code. The included inspect npm script launches the official MCP Inspector — a browser-based tool for testing your server's tools, resources, and prompts before connecting to production AI hosts.
Enterprise MCP Development
This scaffold covers single-server use cases. For enterprise deployments — multi-server orchestration, authenticated API gateways, RAG pipelines over internal documents, or MCP servers connecting to legacy ERP/CRM systems — get in touch. I build custom AI integration solutions that turn the MCP protocol into a competitive advantage.