DEV Community

Alex
Alex

Posted on

What Are MCP Servers and Why Every Developer Needs Them

You're using Claude, Cursor, or another AI assistant. You ask it to check your database. It says "I can't access external systems." You copy data out, paste it in, get an answer, paste it back. Repeat 50 times a day.

MCP servers fix this. They let AI assistants call your tools directly.

What Is MCP?

MCP stands for Model Context Protocol. It's an open standard that connects AI assistants to external tools. Think of it like USB for AI — a universal way to plug capabilities into any AI that supports the protocol.

Without MCP: You copy data from Tool A, paste into AI, copy the response, paste into Tool B.

With MCP: You tell the AI "extract data from this receipt" and it calls your extraction tool automatically, returns structured results, and moves on.

How It Works

An MCP server is a small program that:

  1. Declares what tools it offers (name, description, parameters)
  2. Listens for requests from an AI client
  3. Executes the tool and returns results

The AI client (Claude Desktop, Cursor, etc.) discovers available tools at startup and calls them when relevant.

[AI Client] <--stdin/stdout--> [MCP Server] <--HTTP/DB/etc--> [Your Service]
Enter fullscreen mode Exit fullscreen mode

Communication happens over stdin/stdout. The server runs locally on your machine. No cloud, no API keys for the connection itself.

A Concrete Example

Say you have an API that extracts structured data from text. Without MCP:

1. Copy receipt text
2. Open browser
3. Go to API playground
4. Paste text
5. Click "Extract"
6. Copy JSON result
7. Paste into your code
Enter fullscreen mode Exit fullscreen mode

With MCP:

You: "Extract the receipt data from this text: Whole Foods $14.95..."
Claude: [calls extract_data tool automatically]
Claude: "Here's the structured data: {merchant: 'Whole Foods', total: 14.95, ...}"
Enter fullscreen mode Exit fullscreen mode

Seven steps become one sentence.

Setting Up Your First MCP Server

Install a Pre-Built Server

The fastest way to start is installing an existing MCP server. For structured data extraction, you can use StructureAI MCP:

git clone https://github.com/avatrix1/structureai-mcp.git
cd structureai-mcp
npm install
npm run build
Enter fullscreen mode Exit fullscreen mode

Connect to Claude Desktop

Add it to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "structureai": {
      "command": "node",
      "args": ["/path/to/structureai-mcp/dist/index.js"]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Restart Claude Desktop. The tools appear in the toolbox icon.

Connect to Cursor

Cursor uses the same config format. Add the server in Cursor's MCP settings panel.

Building Your Own MCP Server

It takes about 20 minutes. You need three things:

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";

// 1. Create the server
const server = new McpServer({
  name: "my-tool",
  version: "1.0.0",
});

// 2. Define tools
server.tool(
  "search_database",
  "Search the product database by name or category",
  {
    query: z.string().describe("Search query"),
    category: z.string().optional().describe("Filter by category"),
  },
  async ({ query, category }) => {
    const results = await db.search(query, category);
    return {
      content: [{
        type: "text" as const,
        text: JSON.stringify(results, null, 2),
      }],
    };
  }
);

// 3. Connect transport
const transport = new StdioServerTransport();
await server.connect(transport);
Enter fullscreen mode Exit fullscreen mode

That's a complete MCP server. The AI can now search your database by asking naturally.

What Makes a Good MCP Tool

Good Tool Design

// GOOD — specific name, clear description, typed parameters
server.tool(
  "get_customer_orders",
  "Retrieve orders for a specific customer by email or customer ID",
  {
    customer_id: z.string().optional(),
    email: z.string().email().optional(),
    limit: z.number().default(10),
  },
  handler
);
Enter fullscreen mode Exit fullscreen mode

Bad Tool Design

// BAD — vague name, no description, no parameter descriptions
server.tool("query", "Run a query", { q: z.string() }, handler);
Enter fullscreen mode Exit fullscreen mode

The AI reads tool names and descriptions to decide which tool to use. Vague descriptions mean the AI picks the wrong tool or doesn't use it at all.

MCP Servers You Should Know About

The ecosystem is growing fast. Here are the most useful categories:

Data & APIs

  • Database servers (Postgres, SQLite, MongoDB)
  • API wrappers (GitHub, Jira, Linear, Slack)
  • Data extraction (StructureAI)

Developer Tools

  • File system access
  • Git operations
  • Docker management
  • AWS/GCP/Azure CLIs

Productivity

  • Calendar integration
  • Email management
  • Note-taking apps

Why This Matters

MCP turns AI assistants from chat interfaces into actual tools. Instead of describing what you want and manually executing, you describe what you want and the AI executes.

The developers who adopt MCP early will have a significant productivity advantage. The ones who don't will keep copy-pasting between tabs.

Getting Started Today

  1. Pick one repetitive task you do daily
  2. Find or build an MCP server for it
  3. Connect it to your AI assistant
  4. Watch the copy-paste disappear

Start with something small. A database query tool. A deployment script wrapper. A log searcher. Once you see how much time it saves, you'll want MCP servers for everything.

The StructureAI MCP server is a good first install — 10 free requests, no API key needed, and it handles a common task (text-to-JSON extraction) that every developer needs.


Built by Avatrix LLC. Full MCP server tutorial in our previous article.

Top comments (0)